{
  "openapi": "3.0.1",
  "info": {
    "title": "GB Grid Connection Queue Tracker: TEC and DNO Changes",
    "description": "Every move in Great Britain's grid connection queue: new projects, MW changes, connection dates that slip, status and Gate changes, withdrawals. TEC and DNO registers in one schema, with before and after values. Monthly MW reports by technology or substation.",
    "version": "0.1",
    "x-build-id": "y0VF21LgP1HriDmyK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/arjs1000~gb-grid-connection-pipeline/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-arjs1000-gb-grid-connection-pipeline",
        "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/arjs1000~gb-grid-connection-pipeline/runs": {
      "post": {
        "operationId": "runs-sync-arjs1000-gb-grid-connection-pipeline",
        "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/arjs1000~gb-grid-connection-pipeline/run-sync": {
      "post": {
        "operationId": "run-sync-arjs1000-gb-grid-connection-pipeline",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "changes",
              "snapshot",
              "report"
            ],
            "type": "string",
            "description": "changes: what changed between register releases (charged per change). snapshot: the current pipeline, one row per project per register (charged per row). report: one monthly MW-by-status report (charged per report).",
            "default": "changes"
          },
          "since": {
            "title": "Changes since",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Changes mode: only changes published on or after this date (YYYY-MM-DD). Leave empty for the last 31 days, because most DNO registers update monthly. If nothing changed in those 31 days, the run returns the changes from the most recent register release that had any."
          },
          "sinceLastRun": {
            "title": "Only new since the last run",
            "type": "boolean",
            "description": "Changes mode only. Turn this on for scheduled runs. Each run returns only changes newer than the last run that had it on, so you never pay twice for the same item. The actor saves its place in a key-value store called gb-grid-connection-pipeline-cursor in your own Apify account. The first run has no saved place and uses the default window. A date in \"Changes since\" overrides the saved place for that run. A failed or aborted run does not move it.",
            "default": false
          },
          "cursorName": {
            "title": "Cursor name",
            "pattern": "^[a-zA-Z0-9!\\-_.'()]{0,256}$",
            "type": "string",
            "description": "Used with \"Only new since the last run\". The name of the record that holds the saved place. Leave it empty and each mode and set of filters gets its own. Give two tasks the same name only if they should share one place."
          },
          "changeTypes": {
            "title": "Change types",
            "type": "array",
            "description": "Changes mode: leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "new",
                "capacity_changed",
                "connection_date_moved",
                "status_changed",
                "gate_changed",
                "withdrawn"
              ],
              "enumTitles": [
                "New",
                "Capacity changed",
                "Connection date moved",
                "Status changed",
                "Gate changed",
                "Withdrawn"
              ]
            }
          },
          "sources": {
            "title": "Registers",
            "type": "array",
            "description": "Leave empty for all published registers.",
            "items": {
              "type": "string",
              "enum": [
                "neso_tec",
                "neso_interconnector",
                "neso_embedded",
                "npg_ecr",
                "ssen_ecr"
              ],
              "enumTitles": [
                "NESO TEC register (transmission)",
                "NESO interconnector register",
                "NESO embedded register",
                "National Embedded Capacity Register (all DNOs, via Northern Powergrid)",
                "SSEN Embedded Capacity Register"
              ]
            }
          },
          "technologies": {
            "title": "Technologies",
            "type": "array",
            "description": "Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "battery",
                "solar",
                "solar+battery",
                "wind_onshore",
                "wind+battery",
                "wind_offshore",
                "hydro",
                "pumped_storage",
                "gas",
                "oil",
                "bioenergy",
                "waste",
                "chp",
                "nuclear",
                "marine",
                "hydrogen",
                "interconnector",
                "reactive",
                "demand",
                "other",
                "hybrid",
                "unknown"
              ]
            }
          },
          "minMw": {
            "title": "Minimum MW",
            "minimum": 0,
            "type": "integer",
            "description": "Only projects at or above this headline capacity."
          },
          "gate": {
            "title": "Gate (TEC only)",
            "enum": [
              "1",
              "2"
            ],
            "type": "string",
            "description": "NESO connections reform Gate. Leave empty for any."
          },
          "licenceAreas": {
            "title": "Licence areas",
            "type": "array",
            "description": "DNO licence areas or transmission owners. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "UKPN-EPN",
                "UKPN-LPN",
                "UKPN-SPN",
                "NPG-NE",
                "NPG-Y",
                "ENWL",
                "SPEN-SPD",
                "SPEN-SPM",
                "SSEN-SHEPD",
                "SSEN-SEPD",
                "IDNO",
                "NGET",
                "SPT",
                "SHET",
                "OFTO"
              ]
            }
          },
          "statuses": {
            "title": "Statuses",
            "type": "array",
            "description": "Snapshot mode: leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "connected",
                "accepted",
                "under_construction",
                "consents_approved",
                "awaiting_consents",
                "scoping",
                "requested",
                "unknown"
              ]
            }
          },
          "month": {
            "title": "Report month",
            "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
            "type": "string",
            "description": "Report mode: YYYY-MM. Defaults to the current month (state as of today)."
          },
          "groupBy": {
            "title": "Report grouping",
            "enum": [
              "technology",
              "gsp",
              "lpa",
              "licence_area"
            ],
            "type": "string",
            "description": "Report mode.",
            "default": "technology"
          },
          "scope": {
            "title": "Report scope",
            "enum": [
              "all",
              "transmission",
              "distribution"
            ],
            "type": "string",
            "description": "Report mode: transmission (NESO TEC + interconnectors), distribution (DNO registers) or both.",
            "default": "all"
          },
          "maxItems": {
            "title": "Maximum items",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many dataset items (and charges). Your run's spending limit also applies.",
            "default": 5000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}