Skip to main content
POST
/
cost-of-energy
/
v1
/
calculate
Calculate Tariff
curl --request POST \
  --url https://api.engrate.io/cost-of-energy/v1/calculate \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "end_time": "2026-01-01T00:30:00+01:00",
  "profiles": [
    {
      "name": "quarter-hourly-day-ahead-price-se1",
      "profile_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    }
  ],
  "start_time": "2026-01-01T00:00:00+01:00",
  "tariff_id": "123e4567-e89b-12d3-a456-426614174000",
  "time_series": [
    {
      "name": "quarter-hourly-energy-offtake",
      "values": [
        1.5,
        1.2
      ]
    }
  ]
}
'
{
  "components": [
    {
      "end_time": "2026-01-01T00:30:00+01:00",
      "name": "Energiskatt",
      "start_time": "2026-01-01T00:00:00+01:00",
      "time_series": [
        {
          "name": "cost",
          "resolution": "quarter_hourly",
          "unit": "SEK",
          "values": [
            0.54,
            0.432
          ]
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

Query Parameters

include_intermediate_time_series
boolean
default:false

When true, the response includes all intermediate pipeline time series (e.g. hourly-power-offtake, monthly-peak) in addition to the final cost. When false (default), only the cost time series is returned per component.

Body

application/json
end_time
string<date-time>
required

End of the calculation period (exclusive). Must include timezone offset and be after start_time. For correct monthly/daily bucketing, align to local midnight in the tariff's timezone.

start_time
string<date-time>
required

Start of the calculation period (inclusive). Must include timezone offset. For correct monthly/daily bucketing, align to local midnight in the tariff's timezone (e.g. 2026-01-01T00:00:00+01:00 for Europe/Stockholm).

tariff_id
string<uuid>
required

ID of the tariff to calculate.

profiles
InputProfile · object[] | null

Profile references for datasets. Each entry maps a dataset to a persisted profile UUID. Can be combined with time_series.

time_series
InputTimeSeries · object[] | null

Input time series data for each dataset required by the tariff's active components. Can be combined with profiles.

Response

Successful Response

components
CalculateComponentResult · object[]
required

Results per tariff component that is active within the requested period.