# Danish electricity spot price history: DK1/DK2 cutover (`thatmike1/energinet-spot-prices`) Actor

Get DK1 and DK2 day-ahead prices in EUR/MWh and DKK/MWh across the Elspotprices to DayAheadPrices transition. Native hourly and 15-minute area-day bundles, Danish time offsets, source links and coverage diagnostics. Up to 31 dates per run.

- **URL**: https://apify.com/thatmike1/energinet-spot-prices.md
- **Developed by:** [Michal Pšenčík](https://apify.com/thatmike1) (community)
- **Categories:** Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.00005 / actor start

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Danish electricity spot price history: DK1/DK2 cutover

Get complete day-ahead electricity prices for the Danish price areas DK1 (West) and DK2 (East) from Energinet's
free [Energi Data Service](https://www.energidataservice.dk/) API, across the 1 October 2025 switch from hourly
prices (`Elspotprices`) to quarter-hour prices (`DayAheadPrices`). Each result is one complete Danish calendar day
for one area, with every native interval in EUR/MWh and DKK/MWh, exact UTC and Danish-offset timestamps, the source
link and a content hash. Useful for EV charging and battery simulations, backtests and energy analytics that need
correct history on both sides of the cutover and on daylight-saving days.

### Input

```json
{
    "startDate": "2025-09-30",
    "endDateExclusive": "2025-10-02",
    "areas": ["DK1", "DK2"],
    "maxRows": 62,
    "requestIntervalMs": 1100
}
```

- `startDate` / `endDateExclusive`: Danish calendar dates (Europe/Copenhagen), give both or neither. With neither, the
  run returns yesterday. Earliest start 2024-01-01, latest included date tomorrow, at most 31 dates per run.
- `areas`: `DK1`, `DK2` or both (default both).
- `maxRows`: most bundles to store and pay for in this run (1 to 62, default 62).
- `requestIntervalMs`: idle time after each source response (1100 to 60000, default 1100).

### Output

One dataset item per complete area-day. Dates before 2025-10-01 have 24 hourly intervals (23 or 25 on
daylight-saving days); from 2025-10-01 there are 96 quarter-hours (92 or 100).

```json
{
    "recordId": "energinet:DK2:2025-09-30",
    "localDate": "2025-09-30",
    "area": "DK2",
    "timezone": "Europe/Copenhagen",
    "sourceDataset": "Elspotprices",
    "sourceUrl": "https://api.energidataservice.dk/dataset/Elspotprices?start=2025-09-30&end=2025-10-01&...",
    "observedAt": "2026-10-17T04:34:15.619Z",
    "coverageStatus": "complete",
    "expectedIntervalCount": 24,
    "intervalCount": 24,
    "contentHash": "127197d118770ab4864ea9fb769f25811dd15c9abe36794745358b5f5342fff7",
    "intervals": [
        {
            "intervalStartUtc": "2025-09-30T21:00:00Z",
            "intervalStartDK": "2025-09-30T23:00:00+02:00",
            "intervalMinutes": 60,
            "priceEUR_MWh": 92.480003,
            "priceDKK_MWh": 690.252246
        }
    ]
}
```

Prices are the source's own values, kept exactly as JSON numbers (raw exports may spell them in exponent form, such as
`9.2480003e1` for 92.480003; the value is identical) (no rounding, VAT, tariffs, kWh conversion or exchange-rate
recalculation; negative and zero prices are kept). `observedAt` is when the source was actually read: a repeat
within the cache period shows the original read time. `recordId` stays the same across runs, so you can upsert on
`recordId` and detect source corrections when `contentHash` changes. A day with any missing, duplicated-and-conflicting,
null or malformed interval is never returned as a bundle; it is listed in the free `SUMMARY` record instead.
Each stored bundle is read back (and read again whenever a run resumes after a restart) and its content hash is
recomputed from the stored row: if storage ever changed a price, the run fails with `delivery_not_exact` instead of
returning a rounded bundle as exact.

### Pricing

Pay per event: **$0.008 per complete area-day bundle stored** (including repeat checks served from the cache) plus
**$0.00005 per run start**. The four cutover bundles above cost $0.03205; 30 days for both areas cost $0.48005.
Incomplete days, errors, cooldown deferrals and the run summary are free. Set a spending limit and the actor stops
before a bundle the limit cannot cover.

### Run summary and limits

Every run writes a free `SUMMARY` record to the default key-value store: run status (`complete`, `partial`,
`failed`, `deferred`), request and cache counts, delivered record IDs, source statuses, missing or invalid UTC slots
per area and date, errors with source URL and HTTP status, `retryNotBeforeUtc` and a continuation (the first date and
areas not delivered) for the next run.

The free API is rate-limited (it answered HTTP 429 "Try again in 298 seconds" during research). The actor therefore
makes at most one request per dataset per run (two when a window spans 1 October 2025), waits at least five minutes
before asking the same dataset again (across runs) and caches validated responses for 24 hours (5 minutes when the
window includes today or tomorrow). A run that would need the source during a cooldown returns `deferred` without
charge for bundles; run it again after `retryNotBeforeUtc`. Run one backfill at a time: runs share one cache and a
simple lease, which is not a distributed lock. Longer backfills use adjacent runs.

Tomorrow's prices appear after Energinet publishes them; the source recommends requesting them around 13:00 to 14:00
CET, roughly every five minutes. An unpublished day is reported as `publication_unknown`, never as a zero price.

### Source and attribution

Data: Energinet, Energi Data Service (`api.energidataservice.dk`), datasets `Elspotprices` and `DayAheadPrices`.
Keyless public API; no personal data. This actor is not affiliated with Energinet or Nord Pool.

# Actor input Schema

## `startDate` (type: `string`):

First Danish calendar date (YYYY-MM-DD, Europe/Copenhagen), 2024-01-01 or later. Give both dates or neither; with neither, the run returns yesterday.

## `endDateExclusive` (type: `string`):

The day after the last date to return (YYYY-MM-DD). At most 31 dates per run; the last included date may be tomorrow at the latest.

## `areas` (type: `array`):

DK1 (west of the Great Belt) and/or DK2 (east).

## `maxRows` (type: `integer`):

Most area-day bundles to store (and pay for) in this run, 1 to 62.

## `requestIntervalMs` (type: `integer`):

Idle time after each source response before the next request, 1100 to 60000. Per-dataset five-minute cooldowns apply on top.

## Actor input object example

```json
{
  "areas": [
    "DK1",
    "DK2"
  ],
  "maxRows": 62,
  "requestIntervalMs": 1100
}
```

# Actor output Schema

## `bundles` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("thatmike1/energinet-spot-prices").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("thatmike1/energinet-spot-prices").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call thatmike1/energinet-spot-prices --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thatmike1/energinet-spot-prices"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/4wWUGdnzj0jirl2wI/builds/viliX9AGAQ1g8y38H/openapi.json
