{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Carbon Intensity & Low-Carbon Windows",
    "description": "Half-hourly carbon intensity (gCO2/kWh) for Great Britain, its grid regions and UK outward postcodes from the NESO Carbon Intensity API: forecast, actual, index and generation mix, plus the lowest-carbon time windows for EV charging, heat pumps and other flexible loads.",
    "version": "0.1",
    "x-build-id": "OfvVN4Ml7za0w0ups"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cliqtomedia~uk-carbon-intensity/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cliqtomedia-uk-carbon-intensity",
        "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/cliqtomedia~uk-carbon-intensity/runs": {
      "post": {
        "operationId": "runs-sync-cliqtomedia-uk-carbon-intensity",
        "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/cliqtomedia~uk-carbon-intensity/run-sync": {
      "post": {
        "operationId": "run-sync-cliqtomedia-uk-carbon-intensity",
        "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": {
          "includeNational": {
            "title": "Great Britain (national)",
            "type": "boolean",
            "description": "Include the national (GB) series. Only the national series has actual (measured) intensity; regional series are forecast only.",
            "default": true
          },
          "regions": {
            "title": "Grid regions",
            "type": "array",
            "description": "Region IDs: 1–14 are the distribution network (DNO) regions, 15 England, 16 Scotland, 17 Wales. Unknown values stop the run with an error.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "12",
                "13",
                "14",
                "15",
                "16",
                "17"
              ],
              "enumTitles": [
                "1 – North Scotland",
                "2 – South Scotland",
                "3 – North West England",
                "4 – North East England",
                "5 – Yorkshire",
                "6 – North Wales & Merseyside",
                "7 – South Wales",
                "8 – West Midlands",
                "9 – East Midlands",
                "10 – East England",
                "11 – South West England",
                "12 – South England",
                "13 – London",
                "14 – South East England",
                "15 – England",
                "16 – Scotland",
                "17 – Wales"
              ]
            }
          },
          "postcodes": {
            "title": "UK postcodes (outward code)",
            "maxItems": 5,
            "type": "array",
            "description": "Up to 5 UK postcodes. Only the outward part is used (\"SW1A 1AA\" → SW1A). A postcode the source does not know is reported as not_found, not as an error.",
            "items": {
              "type": "string"
            }
          },
          "startTime": {
            "title": "Start",
            "type": "string",
            "description": "now (current half-hour), today, yesterday, tomorrow, a UK calendar day YYYY-MM-DD, or an ISO date-time (without an offset it is UTC). Times are rounded down to the half-hour.",
            "default": "now"
          },
          "endTime": {
            "title": "End",
            "type": "string",
            "description": "Empty = 24 hours after the start (or the end of the UK day when the start is a day). Also accepts +Nh (for example +48h), a UK day YYYY-MM-DD (to its end) or an ISO date-time. Maximum range 7 days; forecasts reach about 48 hours ahead."
          },
          "includeHalfHourPeriods": {
            "title": "Half-hour periods",
            "type": "boolean",
            "description": "Output one row per area and half-hour. Turn off to get only the low-carbon windows.",
            "default": true
          },
          "includeGenerationMix": {
            "title": "Generation mix",
            "type": "boolean",
            "description": "Add the fuel mix (percent of generation: wind, solar, gas, nuclear, imports and others) to each half-hour row. For the national series this is one extra source request.",
            "default": true
          },
          "findLowCarbonWindows": {
            "title": "Find low-carbon windows",
            "type": "boolean",
            "description": "Find the time windows with the lowest average forecast intensity, per area. Windows do not overlap.",
            "default": true
          },
          "windowDurationHours": {
            "title": "Window length (hours)",
            "minimum": 0.5,
            "maximum": 24,
            "type": "number",
            "description": "Length of each window, 0.5–24 hours, in steps of 0.5.",
            "default": 2
          },
          "windowCount": {
            "title": "Number of windows",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many best windows per area (1–10). Fewer are returned when the range does not have room.",
            "default": 3
          },
          "windowsFromNowOnly": {
            "title": "Windows only in the future",
            "type": "boolean",
            "description": "Search windows only from the current half-hour onward, so they can still be scheduled. Turn off to rank past windows too.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}