# Authentication
Source: https://docs.minstroem.app/api-reference/authentication
The Min Strøm API uses **Bearer** authentication.
## Prerequisites
1. API key
2. API secret
Click here to get in contact to obtain API key and secret.
## Generate Bearer token
Create an `HMAC-SHA256` hash of the **API key** with **API secret** as key
Concatenate your **API key** with the hashed value with a `:`
```ruby theme={null}
API_KEY:HASHED_VALUE
```
Create a Base64 encoded string of the above concatenation
Include this as **Bearer** token in the HTTP header:
```json theme={null}
"Authorization": "Bearer "
```
# Endpoints
Source: https://docs.minstroem.app/api-reference/endpoints
## Base URL
The Min Strøm API is accessed through the following base URL:
```
https://api.minstroem.app/thirdParty
```
***
# Prices
## Spot prices
Get the future hourly electricity spot prices excl. charges.
```javascript theme={null}
GET /prices/{region}
```
| | | | |
| -------- | ------ | ------------ | ---------------------------------------------------------------- |
| `region` | String | **Required** | See [Regions](/api-reference/shared#regions) for possible values |
```json theme={null}
[
{
"date": "2023-10-12T14:00:00Z",
"price": 2.04095,
"color": "yellow"
},
{
"date": "2023-10-12T15:00:00Z",
"price": 3.6294125,
"color": "yellow"
}
]
```
| Parameter | Type | | Description |
| --------- | ------ | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `date` | String | **Required** | ISO8601 timestamp of the price interval start |
| `price` | Double | **Required** | The *total* electricity price for that hour, but only spot price if charges are unavailable. |
| `color` | String | *Optional* | The suggested color to show along with the `price`. This is dynamic based on `region` and whether `charges` are available or not. Possible values are: `green`, `yellow`, `red`. |
***
## Full prices (incl. charges)
There are two overall approaches to get electricity prices including all charges.
1. **Coordinate lookup** - Using lat/long to look up charges
2. **Address lookup** - Using a free text address query to look up charges
One of the easiest ways to get prices including charges.
```javascript theme={null}
GET /prices/location?latitude={latitude}&longitude={longitude}
```
| | | | |
| ----------- | ------ | ------------ | ------------- |
| `latitude` | Double | **Required** | The latitude |
| `longitude` | Double | **Required** | The longitude |
```json theme={null}
[
{
"date": "2023-10-12T14:00:00Z",
"price": 2.04095,
"charges": 1.4335,
"color": "yellow"
},
{
"date": "2023-10-12T15:00:00Z",
"price": 3.6294125,
"charges": 2.277875,
"color": "yellow"
}
]
```
| Parameter | Type | | Description |
| --------- | ------ | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `date` | String | **Required** | ISO8601 timestamp of the price interval start |
| `price` | Double | **Required** | The *total* electricity price for that hour, but only spot price if charges are unavailable. |
| `charges` | Double | *Optional* | The total amount of charges. |
| `color` | String | *Optional* | The suggested color to show along with the `price`. This is dynamic based on `region` and whether `charges` are available or not. Possible values are: `green`, `yellow`, `red`. |
If you know the address of the user, this approach is the quickest way to get full electricity prices.
This process consists of **2** steps:
Search for the end-user's address so they can select the correct location.
You can now request electricity prices incl. all current and applicable charges.
If you already have the DAWA address ID, you can skip Step 1 and go directly to Step 2.
### Search address
In order to get prices including charges you first need to get a valid address to make the lookup with.
```javascript theme={null}
GET /prices/addresses/suggestions/{query}
```
| | | | |
| ------- | ------ | ------------ | ----------------------------------------- |
| `query` | String | **Required** | The free text address query to search for |
```json theme={null}
[
{
"id": "645db24a-f11a-3388-e044-0003ba298018",
"suggestion": "Solbakkevej 11, 2630 Taastrup, 2. tv.",
"streetName": "Solbakkevej",
"streetNumber": "11",
"floor": "2",
"door": "tv",
"zipCode": "2630",
"city": "Taastrup",
}
]
```
| Parameter | Type | | Description |
| -------------- | ------ | ------------ | ---------------------------------------------------------------------- |
| `id` | String | **Required** | The ID of the address to pass on to subsequent endpoints as parameter |
| `suggestion` | String | **Required** | The full text string representation of the address to show to the user |
| `streetName` | String | *Optional* | The street name |
| `streetNumber` | String | *Optional* | The street number |
| `floor` | String | *Optional* | The floor |
| `door` | String | *Optional* | The door |
| `zipCode` | String | *Optional* | The zip code |
| `city` | String | *Optional* | The city |
### Get prices for address
With a valid address you can now lookup prices including charges (best effort):
```javascript theme={null}
GET /prices/addresses/{addressId}
```
| | | | |
| ----------- | ------ | ------------ | ------------------------------------------------------------- |
| `addressId` | String | **Required** | The address ID returned from the address susgestion endpoint. |
```json theme={null}
[
{
"date": "2023-10-12T14:00:00Z",
"price": 2.04095,
"charges": 1.4335,
"color": "yellow"
},
{
"date": "2023-10-12T15:00:00Z",
"price": 3.6294125,
"charges": 2.277875,
"color": "yellow"
}
]
```
| Parameter | Type | | Description |
| --------- | ------ | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `date` | String | **Required** | ISO8601 timestamp of the price interval start |
| `price` | Double | **Required** | The *total* electricity price for that hour, but only spot price if charges are unavailable. |
| `charges` | Double | *Optional* | The total amount of charges. |
| `color` | String | *Optional* | The suggested color to show along with the `price`. This is dynamic based on `region` and whether `charges` are available or not. Possible values are: `green`, `yellow`, `red`. |
***
# Charges
## Hour specific
Get full charges information for a specific location and date
```javascript theme={null}
GET /prices/charges/location?latitude={latitude}&longitude={longitude}&date={date}
```
| | | | |
| ----------- | ------ | ------------ | --------------------------------------- |
| `latitude` | Double | **Required** | The latitude |
| `longitude` | Double | **Required** | The longitude |
| `date` | Date | **Required** | ISO8601 timestamp of the price validity |
```json theme={null}
{
"date": "2024-04-19T23:00:00Z",
"address": "Feldskovvej 1B, 3. mf., 4180 Sorø",
"subscriptions": [
{
"name": "TSO - System Abonnement",
"ownerName": "Energinet",
"price": 0.625
},
{
"name": "Net abo C forbrug time",
"ownerName": "Cerius A/S",
"price": 2.19791
}
],
"tariffs": [
{
"name": "Transmissions nettarif",
"ownerName": "Energinet",
"price": 0.0925
},
{
"name": "Systemtarif",
"ownerName": "Energinet",
"price": 0.06375
},
{
"name": "Elafgift",
"ownerName": "Energinet",
"price": 0.95125
},
{
"name": "Nettarif C time",
"ownerName": "Cerius A/S",
"price": 0.14075
}
]
}
```
| Parameter | Type | | Description |
| --------------- | ------ | ------------ | --------------------------------------- |
| `date` | String | **Required** | ISO8601 timestamp of the price validity |
| `address` | String | *Optional* | The address of the location |
| `subscriptions` | Array | **Required** | A list of all applicable subscriptions |
| `tariffs` | Array | **Required** | A list of all applicable tariffs |
***
## Historic charges
Get historical full charges information for a specific location and date range.
```javascript theme={null}
GET /prices/charges/location/history?latitude={latitude}&longitude={longitude}&fromDate={fromDate}&toDate={toDate}
```
| | Type | | Description |
| ----------- | ------ | ------------ | -------------------------------------------------------------------------------------------------- |
| `latitude` | Double | **Required** | The latitude of the location |
| `longitude` | Double | **Required** | The longitude of the location |
| `fromDate` | String | **Required** | ISO8601 timestamp marking the start of the date range (inclusive) |
| `toDate` | String | *Optional* | ISO8601 timestamp marking the end of the date range (exclusive). Defaults to the current date/time |
```json theme={null}
{
"from": "2025-02-14T21:31:50Z",
"to": "2025-05-14T21:31:50Z",
"tariffs": [
{
"price": { "static": { "price": 0.9 } },
"ownerName": "Energinet",
"name": "Elafgift",
"from": "2024-12-31T23:00:00Z"
},
// ... additional tariff entries ...
],
"subscriptions": [
{
"name": "Net abo C forbrug",
"price": { "static": { "price": 26.686367 } },
"ownerName": "N1 A/S - 131",
"from": "2024-12-31T23:00:00Z"
},
// ... additional subscription entries ...
]
}
```
| Parameter | Type | | Description |
| --------------- | ------ | ------------ | ------------------------------------------------- |
| `from` | String | **Required** | ISO8601 timestamp marking the start of the period |
| `to` | String | *Optional* | ISO8601 timestamp marking the end of the period |
| `tariffs` | Array | **Required** | List of tariffs with time intervals |
| `subscriptions` | Array | **Required** | List of subscriptions with time intervals |
***
# API Usage
## Request count
Get the running request count for your account
```javascript theme={null}
GET /currentRequestCount
```
```json theme={null}
[
{
"date": "2024-05-16T22:00:00Z",
"requestCount": 1257
},
{
"date": "2024-05-17T22:00:00Z",
"requestCount": 1104
}
]
```
| Parameter | Type | | Description |
| -------------- | ------ | ------------ | --------------------------------------------------------------- |
| `date` | String | **Required** | ISO8601 timestamp of the day |
| `requestCount` | Int | **Required** | The *total* requests logged for your account on the given `day` |
# Introduction
Source: https://docs.minstroem.app/introduction
Welcome to the Min Strøm API docs
## Overview
Get set up quickly with the Min Strøm API guide.
Get set up with authentication for API endpoints
Get an overview of the available endpoints