> ## Documentation Index
> Fetch the complete documentation index at: https://docs.minstroem.app/llms.txt
> Use this file to discover all available pages before exploring further.

# 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}
```

<Accordion title="Parameters">
  |          |        |              |                                                                  |
  | -------- | ------ | ------------ | ---------------------------------------------------------------- |
  | `region` | String | **Required** | See [Regions](/api-reference/shared#regions) for possible values |
</Accordion>

<Accordion title="Response">
  ```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`. |
</Accordion>

***

## 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

<Tabs>
  <Tab title="Coordinate lookup">
    One of the easiest ways to get prices including charges.

    ```javascript theme={null}
    GET /prices/location?latitude={latitude}&longitude={longitude}
    ```

    <Accordion title="Parameters">
      |             |        |              |               |
      | ----------- | ------ | ------------ | ------------- |
      | `latitude`  | Double | **Required** | The latitude  |
      | `longitude` | Double | **Required** | The longitude |
    </Accordion>

    <Accordion title="Response">
      ```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`. |
    </Accordion>
  </Tab>

  <Tab title="Address lookup">
    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:

    <Steps>
      <Step title="Search addresses" icon="magnifying-glass" iconType="solid">
        Search for the end-user's address so they can select the correct location.
      </Step>

      <Step title="Get prices for address" icon="chart-simple" iconType="solid">
        You can now request electricity prices incl. all current and applicable charges.
      </Step>
    </Steps>

    <Tip>
      If you already have the DAWA address ID, you can skip Step 1 and go directly to Step 2.
    </Tip>

    ### 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}
    ```

    <Accordion title="Parameters">
      |         |        |              |                                           |
      | ------- | ------ | ------------ | ----------------------------------------- |
      | `query` | String | **Required** | The free text address query to search for |
    </Accordion>

    <Accordion title="Response">
      ```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                                                               |
    </Accordion>

    ### Get prices for address

    With a valid address you can now lookup prices including charges (best effort):

    ```javascript theme={null}
    GET /prices/addresses/{addressId}
    ```

    <Accordion title="Parameters">
      |             |        |              |                                                               |
      | ----------- | ------ | ------------ | ------------------------------------------------------------- |
      | `addressId` | String | **Required** | The address ID returned from the address susgestion endpoint. |
    </Accordion>

    <Accordion title="Response">
      ```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`. |
    </Accordion>
  </Tab>
</Tabs>

***

# 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}
```

<Accordion title="Parameters">
  |             |        |              |                                         |
  | ----------- | ------ | ------------ | --------------------------------------- |
  | `latitude`  | Double | **Required** | The latitude                            |
  | `longitude` | Double | **Required** | The longitude                           |
  | `date`      | Date   | **Required** | ISO8601 timestamp of the price validity |
</Accordion>

<Accordion title="Response">
  ```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        |
</Accordion>

***

## 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}
```

<Accordion title="Parameters">
  |             | 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 |
</Accordion>

<Accordion title="Response">
  ```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         |
</Accordion>

***

# API Usage

## Request count

Get the running request count for your account

```javascript theme={null}
GET /currentRequestCount
```

<Accordion title="Response">
  ```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` |
</Accordion>
