Grid Tariff API
The Grid Tariff API gives you the grid tariffs (elnätstariffer) of Göteborg Energi Nät AB in a machine-readable format. Each tariff describes every fee a customer pays for their grid connection, and exactly how each fee is calculated. With this you can, for example:
- show customers which tariffs exist and what they cost,
- calculate what a customer's grid fee will be based on their consumption,
- shift electricity use, such as EV charging or heating, to hours when the grid fee is low.
Base path: /gridtariff/v0, on the UAT or production base URL (see Getting started).
A shared industry standard
The API follows the Swedish data standard for grid tariffs (Eltariff API). Swedish grid companies are developing the standard together with vehicle manufacturers and smart-charging companies, in a project coordinated by RISE Research Institutes of Sweden and funded by the Swedish Energy Agency (Energimyndigheten).
Grid companies that adopt the standard publish their tariffs in the same format, so code you write for Göteborg Energi can also be used with them.
- elnätsavgift.se: about the standard and the project (in Swedish).
- Eltariff API specification on GitHub: the OpenAPI specification and its documentation.
Göteborg Energi currently implements version 0.3.2 of the standard. GET /info shows which version the API implements.
Endpoints
| Method and path | Returns |
|---|---|
GET /info | Information about the API: standard version, operator and when the tariff data was last updated. |
GET /tariffs/ | All tariffs, plus the calendar patterns they refer to. |
GET /tariffs/{id} | A single tariff, by its ID (a UUID), plus the calendar patterns. |
GET /prices?product={product} | Hourly prices for a tariff with a dynamic power fee. |
GET /prices?componentId={id} | The same, identified by the price component's ID instead. |
/prices also accepts a time range, see Hourly prices.
The standard also defines POST /tariffs/search, for finding the tariff of a specific metering point. Göteborg Energi does not offer it yet.
Tariffs
A tariff is the price list for one type of grid connection, for example GNM63, "Småhus och företag, Max 63A" (houses and businesses with a main fuse of at most 63 A). Its main fields:
| Field | Meaning |
|---|---|
id | Unique ID of this version of the tariff. |
product | Product code, e.g. GNM63. The same code can appear more than once, with different validity periods. |
name, description | Name and description, in Swedish. |
validPeriod | When this version applies: from fromIncluding up to, but not including, toExcluding. |
direction | consumption for electricity taken from the grid, production for electricity fed into the grid. |
billingPeriod | How often the customer is billed. P1M means monthly. |
timeZone | Time zone for all times in the tariff: Europe/Stockholm. |
fixedPrice, energyPrice, powerPrice | The three kinds of fees, described below. A tariff can have one, two or all three. |
When tariffs change, for example at the start of a new year, the API returns both the current and the upcoming versions. Use validPeriod to pick the version that applies on a given date.
Fees and price components
A tariff's total grid fee is the sum of its three fee groups:
| Group | What the customer pays for | Typical unit |
|---|---|---|
fixedPrice | Having a grid connection (subscription fee). | SEK per year (pricedPeriod: "P1Y"), billed per billingPeriod. |
energyPrice | The amount of electricity transferred, including energy tax. | SEK per kWh |
powerPrice | How much power the customer uses at the same time. | SEK per kW |
Each group contains one or more components. A component has a price, a unit and its own validPeriod, and the type says how it is used:
type | Meaning |
|---|---|
public | A fixed amount per period. |
fixed | A fixed price per unit, e.g. per kWh. |
peak | A price per kW, applied to the customer's highest power use ("peaks"), see below. |
dynamic | A price that changes every hour. The prices are fetched from /prices, see below. |
All prices are given both without and with VAT (priceExVat, priceIncVat), in currency (SEK).
How costs are calculated
Each fee group has a costFunction that describes how to combine its components:
costFunction | Reads as |
|---|---|
sum(price(c)) | Add up the prices of all components. |
sum(energy(c)*price(c)) | For each component: energy used (kWh) × price. Then add them up. |
sum(peak(c)*price(c)) | For each component: the customer's peak power (kW) × price. Then add them up. |
sum(power(h)*price(h)) | For each hour: average power used that hour (kW) × that hour's price. Then add them up. |
Peaks
For peak components, peakIdentificationSettings describes how the peak is measured. For example:
"peakIdentificationSettings": {
"peakFunction": "peak(main)",
"peakIdentificationPeriod": "P1D",
"peakDuration": "PT1H",
"numberOfPeaksForAverageCalculation": 3
}
This means: power is measured as an average per hour (PT1H), at most one peak is counted per day (P1D), and the fee is based on the average of the 3 highest peaks in the billing period, i.e. the three highest hours on three different days.
When a component applies
Some components only apply at certain times, for example a higher power fee on weekdays between 07:00 and 20:00. This is described by recurringPeriods:
"recurringPeriods": [
{
"reference": "main",
"frequency": "P1D",
"activePeriods": [
{
"fromIncluding": "07:00:00",
"toExcluding": "20:00:00",
"calendarPatternReferences": {
"include": ["weekdays"],
"exclude": ["holidays"]
}
}
]
}
]
The names in calendarPatternReferences refer to the calendarPatterns returned next to the tariffs:
reference | Meaning |
|---|---|
weekdays | Monday to Friday (days 1–5) |
weekends | Saturday and Sunday (days 6–7) |
holidays | The dates listed in dates |
A period from 00:00:00 to 00:00:00 covers the whole day.
Components can also be seasonal: their own validPeriod can cover only part of the tariff's validity period, for example January to March.
Hourly prices
Tariffs with a dynamic power fee have a component with "type": "dynamic" and a url pointing to its prices:
{
"name": "Timpris, effektavgift",
"type": "dynamic",
"unit": "kW",
"price": null,
"url": "/prices?product=GN6KWST"
}
Get the prices with:
curl "https://api.uat.goteborgenergi.cloud/gridtariff/v0/prices?product=GN6KWST"
{
"currency": "SEK",
"unit": "kW",
"actual": [
...
{
"created": "2026-10-13T14:00:05.252558+02:00",
"start": "2026-10-14T08:00:00+02:00",
"end": "2026-10-14T09:00:00+02:00",
"priceExVat": 0.1071127,
"priceIncVat": 0.1338909
},
...
],
"preview": [ ... ]
}
actualcontains prices that are set. These are the prices that apply, and they don't change once set.previewcontains estimated prices for the 5 days after the set ones. They are an indication based on what we know today, not a promise. The estimates are recalculated every day, and the set price for an hour can differ from its last estimate. Use them for rough planning, never for billing.- Each hour has a
startand anend. A day normally has 24 hours, but 23 or 25 on the days when clocks change to and from daylight saving time.
The price is per kW. The cost for an hour is the customer's average power during that hour × that hour's price.
When prices are published
New prices are calculated and published every day, at the latest by 15:00 Swedish time. Each publication:
- Sets the prices for the next day (all its hours) and adds them to
actual. They are calculated from scratch, independently of the earlier estimates for that day. - Recalculates the estimates for the 5 days after that, in
preview.
For example, a publication on Monday at 15:00:
| Covers | Status | |
|---|---|---|
actual | Tuesday | Set: the price the customer pays |
preview | Wednesday to Sunday | Estimated: recalculated on Tuesday at 15:00 |
Fetch the prices after 15:00 to plan the next day.
Choosing a time range
Without parameters, /prices returns the set prices from today onwards and the estimates after them. To get other periods:
| Parameter | Example | Returns |
|---|---|---|
date | date=2026-10-14 | One day. The hours are returned in actual or preview, depending on whether that day's prices are set yet. |
fromIncluding, toExcluding | fromIncluding=2026-10-12T00:00:00+02:00&toExcluding=2026-10-14T00:00:00+02:00 | A time range. Both values are timestamps with UTC offset. Encode + as %2B in the URL. |
Historical prices
- Production has prices from the day hourly prices launch onwards. There is no history from before that.
- UAT has historical prices from 28 September 2021 to the end of 2025, so you can test with realistic data. See them in the price history.
Errors
| Status | When |
|---|---|
400 Bad Request | A parameter is missing or invalid, for example /prices without product or componentId, an invalid date, or a tariff ID that isn't a UUID. |
404 Not Found | There are no prices for the given product or component. |
429 Too Many Requests | Too many requests in a short time. Wait a minute and try again. |
See Getting started for the error format.
Next steps
- Find the cheapest hours to run devices when the grid fee is low.
- Calculate a monthly grid fee from a tariff and hourly consumption.
- Use hourly prices in Home Assistant.