{
  "openapi": "3.0.1",
  "info": {
    "title": "Danish Electricity Prices: Spot + Full Consumer Price per kWh",
    "description": "DK1/DK2 spot prices plus the real price per kWh for your grid company (tariffs, elafgift, VAT), cheapest hours and the best charging window.",
    "version": "0.2",
    "x-build-id": "gUswSztNaeh5s2QhB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nordic_open_data~dk-electricity-consumer-prices/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nordic_open_data-dk-electricity-consumer-prices",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/nordic_open_data~dk-electricity-consumer-prices/runs": {
      "post": {
        "operationId": "runs-sync-nordic_open_data-dk-electricity-consumer-prices",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/nordic_open_data~dk-electricity-consumer-prices/run-sync": {
      "post": {
        "operationId": "run-sync-nordic_open_data-dk-electricity-consumer-prices",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "Output mode",
            "enum": [
              "prices",
              "summary",
              "evCharging"
            ],
            "type": "string",
            "description": "'prices' returns one row per 15-minute interval. 'summary' returns ONE compact record (current price, next 24 h hourly, cheapest window from now, min/max/average), ideal for Home Assistant REST sensors and the run-sync API. 'evCharging' returns ONE charging plan (start, end, expected cost) using full consumer prices. In summary and EV modes, period/startDate are ignored.",
            "default": "prices"
          },
          "period": {
            "title": "Period",
            "enum": [
              "today",
              "tomorrow",
              "todayAndTomorrow",
              "last7Days",
              "last30Days",
              "custom"
            ],
            "type": "string",
            "description": "Which days to fetch (Danish local dates). 'tomorrow' returns status NOT_YET_PUBLISHED before the prices are out. 'Last 7/30 days' are complete past days ending yesterday (no ranking cut-off).",
            "default": "todayAndTomorrow"
          },
          "startDate": {
            "title": "Start date (custom)",
            "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string",
            "description": "YYYY-MM-DD, inclusive. Only with period = custom. Earliest 2025-10-01."
          },
          "endDate": {
            "title": "End date (custom)",
            "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string",
            "description": "YYYY-MM-DD, inclusive. Default: same as start. Max 31 days."
          },
          "gridCompanySelect": {
            "title": "Grid company (pick from list)",
            "enum": [
              "5790001095451",
              "5790000705184",
              "5790000610099",
              "5790000836239",
              "5790001095277",
              "5790001100520",
              "5790000392551",
              "5790001088309",
              "5790000681105",
              "5790001090166",
              "5790000682102",
              "5790000704842",
              "5790000683345",
              "5790001090111",
              "5790001103460",
              "5790001089023",
              "5790002502699",
              "5790001089030",
              "5790000611003",
              "5790000681358",
              "5790000395620",
              "5790000610877",
              "5790000705689",
              "5790000681327",
              "5790000836727",
              "5790001095444",
              "5790000706419",
              "5790000392261",
              "5790000706686",
              "5790001088217",
              "5790000610976",
              "5790001089375"
            ],
            "type": "string",
            "description": "The 32 grid companies (netselskaber) with a household tariff in DatahubPricelist, labelled with area and towns. A choice here overrides the free-text field below. Leave empty to use the text field."
          },
          "gridCompany": {
            "title": "Grid company (name or GLN, free text)",
            "type": "string",
            "description": "Your grid company (netselskab) as on your electricity bill: full name (e.g. 'Radius Elnet A/S', 'N1 A/S - 131'), a short name ('radius', 'cerius') or the 13-digit GLN. Exact full names win over fuzzy matches; ambiguous names (e.g. 'N1', 'Konstant') return an error listing the candidates. The price area (DK1/DK2) is derived from it. Former names are recognised too, e.g. 'DONG Energy Eldistribution'/'Ørsted Net' → Radius, 'SEAS-NVE Net' → Cerius, 'Energi Fyn Net' → Vores Elnet, 'NRGi Net' → Konstant, 'Eniig'/'Evonet' → N1. Via the API, prefer the name (e.g. \"Radius Elnet A/S\") over a bare GLN: it is readable and self-documenting. Precedence: list > this field > postcode. If you also give a postcode, it must match (otherwise the run stops with an error)."
          },
          "postcode": {
            "title": "Postcode (best-effort alternative)",
            "pattern": "^\\d{4}$",
            "type": "string",
            "description": "Danish postcode, e.g. 2100 (København Ø) or 8000 (Aarhus C). Used to find your grid company when neither the grid company list nor the free-text field is set. If you set a grid company too, the postcode must match it, otherwise the run stops with an error (or warns if the postcode can't be checked). Not every postcode is covered; then set your grid company (it's on your bill)."
          },
          "priceArea": {
            "title": "Price area",
            "enum": [
              "DK1",
              "DK2"
            ],
            "type": "string",
            "description": "Derived automatically from postcode/grid company. Required only for spot-only runs without a location."
          },
          "includeTariffs": {
            "title": "Include full consumer price",
            "type": "boolean",
            "description": "Add grid tariff, Energinet tariffs, elafgift and 25% VAT (needs gridCompany or postcode). On by default; turn off (or leave gridCompany and postcode empty via API) for spot prices only. If tariffs can't be found the run fails without charging.",
            "default": true
          },
          "tariffCode": {
            "title": "Grid tariff code (advanced)",
            "type": "string",
            "description": "Override the auto-selected household tariff (DatahubPricelist ChargeTypeCode). Rarely needed."
          },
          "supplierMarkupDkkPerKwh": {
            "title": "Supplier markup (DKK/kWh incl. VAT)",
            "minimum": -1,
            "maximum": 5,
            "type": "number",
            "description": "Your electricity supplier's surcharge on top of spot (tillæg), entered incl. VAT as on supplier price lists. In the output, supplierMarkupDkkPerKwh is shown excl. VAT (e.g. 0.40 incl. VAT → 0.32), like all other component fields; the 25% VAT on it is part of vatDkkPerKwh, and variablePriceDkkPerKwh/totalPriceDkkPerKwh are incl. VAT."
          },
          "gridSubscriptionDkkPerMonth": {
            "title": "Grid subscription (DKK/month incl. VAT)",
            "minimum": 0,
            "maximum": 2000,
            "type": "number",
            "description": "Your GRID company's monthly subscription (netabonnement; on the bill as 'Netabonnement' from e.g. Radius/N1), entered incl. VAT. Not your supplier's fee – that goes in 'Supplier subscription'. Needs 'Annual consumption'; it is then spread per kWh into fixedCostsDkkPerKwh and totalPriceDkkPerKwh (both incl. VAT)."
          },
          "supplierSubscriptionDkkPerMonth": {
            "title": "Supplier subscription (DKK/month incl. VAT)",
            "minimum": 0,
            "maximum": 2000,
            "type": "number",
            "description": "Your electricity SUPPLIER's monthly fee (abonnement from the company you buy power from, e.g. Andel Energi, OK, Norlys), entered incl. VAT. Not the grid subscription – that goes in 'Grid subscription'. Needs 'Annual consumption'; spread per kWh into fixedCostsDkkPerKwh and totalPriceDkkPerKwh (incl. VAT)."
          },
          "annualConsumptionKwh": {
            "title": "Annual consumption (kWh)",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Required when you enter a subscription: fixed monthly costs × 12 ÷ this value is added per kWh (fixedCostsDkkPerKwh, incl. VAT). Without subscriptions fixedCostsDkkPerKwh is 0."
          },
          "cheapestHours": {
            "title": "Cheapest N hours per day",
            "minimum": 0,
            "maximum": 24,
            "type": "integer",
            "description": "Flag the N cheapest individual clock hours per day.",
            "default": 3
          },
          "windowHours": {
            "title": "Cheapest contiguous block (hours)",
            "minimum": 0,
            "maximum": 24,
            "type": "integer",
            "description": "Find the cheapest run of N consecutive hours, per day and over the whole range.",
            "default": 3
          },
          "windowQuarterHours": {
            "title": "Cheapest contiguous block (quarter-hours)",
            "minimum": 0,
            "maximum": 96,
            "type": "integer",
            "description": "Same, in 15-minute steps (e.g. 6 = 1.5 hours).",
            "default": 0
          },
          "onlyFuture": {
            "title": "Only rank future intervals",
            "type": "boolean",
            "description": "On by default: when the period includes today, rank only hours/intervals that haven't started yet. Ignored for periods entirely in the past or future.",
            "default": true
          },
          "failOnEmpty": {
            "title": "Fail if empty or implausible (monitoring)",
            "type": "boolean",
            "description": "Make the run FAIL when no data is returned, a requested day is missing, or sanity checks fail. Useful for schedules and alerts.",
            "default": false
          },
          "evEnergyKwh": {
            "title": "EV: energy to add (kWh)",
            "minimum": 0.1,
            "maximum": 250,
            "type": "number",
            "description": "kWh to add to the battery, e.g. 30 (from 40% to 80% of a 75 kWh battery). Required for mode evCharging."
          },
          "chargerKw": {
            "title": "EV: charging power (kW)",
            "minimum": 0.5,
            "maximum": 400,
            "type": "number",
            "description": "Charger power, e.g. 11 (3-phase 16 A), 7.4 (1-phase 32 A) or 3.7. Required for mode evCharging."
          },
          "readyBy": {
            "title": "EV: ready by (Danish local time)",
            "type": "string",
            "description": "\"07:00\" = the next 07:00 after the start, or a date-time \"2026-10-16T07:00\". Required for mode evCharging. The window can be at most 48 hours."
          },
          "earliestStart": {
            "title": "EV: earliest start (optional)",
            "type": "string",
            "description": "\"2026-10-15T22:00\" (Danish local time). Empty = now (the next quarter-hour)."
          },
          "chargingEfficiency": {
            "title": "EV: charging efficiency (optional)",
            "minimum": 0.5,
            "maximum": 1,
            "type": "number",
            "description": "Share of grid energy that ends up in the battery, e.g. 0.9 (typical AC charging 0.85–0.95). Default 1 (no losses). Cost is based on grid energy = kWh ÷ efficiency."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}