{
  "openapi": "3.0.1",
  "info": {
    "title": "Danish Grid Capacity Map (Energinets Kapacitetskort)",
    "description": "Available grid capacity per transformer station in Denmark from Energinet's official Kapacitetskort: consumption and production MW, 132/150 kV and 60/10 kV, nearest station to a coordinate, status, change signals, free country-wide summary. From $0.01/station (PPE).",
    "version": "0.1",
    "x-build-id": "sH6kk4dlSWImrpimo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/codeclouds~dk-elnet-kapacitetskort/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-codeclouds-dk-elnet-kapacitetskort",
        "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/codeclouds~dk-elnet-kapacitetskort/runs": {
      "post": {
        "operationId": "runs-sync-codeclouds-dk-elnet-kapacitetskort",
        "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/codeclouds~dk-elnet-kapacitetskort/run-sync": {
      "post": {
        "operationId": "run-sync-codeclouds-dk-elnet-kapacitetskort",
        "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": {
          "nettype": {
            "title": "Grid type",
            "type": "array",
            "description": "Which grid to read. \"transmissionsnet\" = Energinet's 132/150 kV transmission grid (160 stations). \"distributionsnet\" = the 60/10 kV distribution substations (937 stations). Empty = both.",
            "items": {
              "type": "string",
              "enum": [
                "transmissionsnet",
                "distributionsnet"
              ]
            }
          },
          "netstationer": {
            "title": "Substation codes",
            "type": "array",
            "description": "Look up specific substations by their code, e.g. \"MAL_150\" (transmission) or \"FBY\" (distribution). Case is ignored. Empty = all. Note that some distribution codes are shared by two different stations — use stationsnavnIndeholder when the code alone is too vague.",
            "items": {
              "type": "string"
            }
          },
          "stationsnavnIndeholder": {
            "title": "Station name contains",
            "type": "string",
            "description": "Free-text filter on station name or substation code, e.g. \"Aarhus\" or \"Sønder\". Danish å/ø/æ are searchable both ways: \"Aarhus\" finds \"Århus\", \"Koebenhavn\" finds \"København\". Multiple filters combine with AND."
          },
          "breddegrad": {
            "title": "Latitude (north)",
            "type": "number",
            "description": "Latitude in decimal degrees (WGS84) for a point query. Must be used together with længdegrad — supplying only one raises an error, so you never accidentally buy the whole country. If latitude and longitude are swapped, the Actor corrects them automatically when it is unambiguous (and reports it in the summary)."
          },
          "længdegrad": {
            "title": "Longitude (east)",
            "type": "number",
            "description": "Longitude in decimal degrees (WGS84). Must be used together with breddegrad. Results are sorted by distance and afstandKm is filled in per station."
          },
          "maksAfstandKm": {
            "title": "Max distance (km)",
            "type": "number",
            "description": "Only stations within this distance of the coordinate are included. Default 25 km.",
            "default": 25
          },
          "maksAntalNærmeste": {
            "title": "Max nearest stations",
            "type": "number",
            "description": "How many of the nearest stations are delivered for a point query. Default 10.",
            "default": 10
          },
          "tilslutningskravMW": {
            "title": "Connection size (MW)",
            "type": "number",
            "description": "The connection size you evaluate a station against. This drives kapacitetsstatus: below the requirement = \"opbrugt\", between the requirement and 5x it = \"knap\", 5x or more = \"ledig\". Default 20 MW (a small commercial installation).",
            "default": 20
          },
          "minLedigForbrugMW": {
            "title": "Min available consumption capacity (MW)",
            "type": "number",
            "description": "Only stations with at least this much available consumption capacity (ledig forbrugskapacitet). Stations without a consumption figure in the source (null) are excluded when this field is set."
          },
          "minLedigProduktionMW": {
            "title": "Min available production capacity (MW)",
            "type": "number",
            "description": "Only stations with at least this much available production capacity (ledig produktionskapacitet), e.g. for solar, wind or other generation."
          },
          "forbrugsstatus": {
            "title": "Consumption status",
            "type": "array",
            "description": "Filter on capacity status for consumption. \"opbrugt\" = below the connection requirement, \"knap\" = between the requirement and 5x it, \"ledig\" = 5x or more, \"ukendt\" = the source gives no consumption figure for this station.",
            "items": {
              "type": "string",
              "enum": [
                "opbrugt",
                "knap",
                "ledig",
                "ukendt"
              ]
            }
          },
          "produktionsstatus": {
            "title": "Production status",
            "type": "array",
            "description": "Filter on capacity status for production (solar, wind, other generation). Same rule as consumption status.",
            "items": {
              "type": "string",
              "enum": [
                "opbrugt",
                "knap",
                "ledig",
                "ukendt"
              ]
            }
          },
          "netforstærkning": {
            "title": "Grid (existing or reinforced)",
            "type": "array",
            "description": "Filter on which grid the capacity figure comes from. \"existing_grid\" = capacity in the grid that exists today (the value used for status). \"reinforced_grid\" = stations that exist ONLY in the planned, reinforced grid — potential, not reality yet. Only transmission stations (132/150 kV) carry this value.",
            "items": {
              "type": "string",
              "enum": [
                "existing_grid",
                "reinforced_grid"
              ]
            }
          },
          "minSpændingsniveauKV": {
            "title": "Min voltage level (kV)",
            "type": "number",
            "description": "Filter on the station's voltage level. For distribution stations the first (highest) level in the field is used, so \"60/10\" counts as 60 kV. E.g. 132 returns only 132/150 kV stations."
          },
          "kunNyeEllerAendrede": {
            "title": "Only new or changed substations",
            "type": "boolean",
            "description": "Default false: every run delivers the full filtered selection. Set to true for monitoring — then only stations that are new or whose capacity/status changed since the previous run are delivered (and charged as change signals). Comparison uses a shared, persistent snapshot in a named key-value store, which scheduled runs also update.",
            "default": false
          },
          "maksAntal": {
            "title": "Max substations",
            "type": "number",
            "description": "Maximum number of substation records delivered per run (at least 1). Default 200. Without filters and coordinates the stations with the most available capacity come first, so a run with no input shows the most relevant ones. The free summary ALWAYS covers the full, untruncated selection — a country-wide overview therefore costs only 200 records. Truncation is flagged in the summary with afkortet=true and antalFoerAfkortelse, so a result never looks complete when it is not.",
            "default": 200
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}