A savings response reports how much money a site has saved over a given period by operating with the Lunar system, compared to what the bill would have been without it.
Get savings
GET /api/v2/sites/{siteId}/savings
Returns cost savings for a site broken down by time bucket over the requested interval.
Parameters
| Parameter | Required | Description |
|---|---|---|
interval | Yes | ISO 8601 time interval, e.g. 2026-01-01T00:00:00Z/2026-06-01T00:00:00Z or 2026-01-01T00:00:00Z/P6M. Times must be UTC. |
resolution | Yes | Time bucket size. P1M returns one entry per calendar month. |
Response fields
| Field | Type | Description |
|---|---|---|
entries | array | One entry per time bucket within the requested interval. |
entries[].interval | string (ISO 8601) | The bucket interval in canonical UTC form. |
entries[].savings | number | Cost savings in the site's currency for this bucket. |
Example request
curl -s \
-H "Authorization: Bearer ${access_token}" \
"https://${api_base_url}/api/v2/sites/${siteId}/savings?interval=2026-01-01T00%3A00%3A00Z%2F2026-06-01T00%3A00%3A00Z&resolution=P1M"Example response
{
"entries": [
{
"interval": "2026-01-01T00:00Z/2026-02-01T00:00Z",
"savings": 48.30
},
{
"interval": "2026-02-01T00:00Z/2026-03-01T00:00Z",
"savings": 52.10
}
]
}