{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Economic Calendar: ONS Release Dates for CPI, GDP & Jobs",
    "description": "Scheduled and past UK statistics releases from the official ONS calendar: title, exact UTC release moment, London date and time, reference period, confirmed or provisional status, cancellations, summary and links. Filter by keyword, status and date window.",
    "version": "0.1",
    "x-build-id": "ehmWPCaqlhvzAhz1n"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yadroo~ons-release-calendar/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yadroo-ons-release-calendar",
        "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/yadroo~ons-release-calendar/runs": {
      "post": {
        "operationId": "runs-sync-yadroo-ons-release-calendar",
        "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/yadroo~ons-release-calendar/run-sync": {
      "post": {
        "operationId": "run-sync-yadroo-ons-release-calendar",
        "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": "What to fetch",
            "enum": [
              "calendar",
              "nextRelease"
            ],
            "type": "string",
            "description": "`calendar` lists releases in the selected window, newest or soonest first. `nextRelease` answers \"when is the next one\" for each entry of `topics`: one row per topic, the earliest release still ahead that matches it. Date filters are ignored in `nextRelease`.",
            "default": "calendar"
          },
          "query": {
            "title": "Keyword or time series ID",
            "type": "string",
            "description": "Free-text search over release titles and summaries, e.g. \"consumer price inflation\", \"gross domestic product\", \"public sector finances\", or a time series ID such as \"D7G7\". Empty = every release in the window. Used in `calendar` mode."
          },
          "topics": {
            "title": "Topics (Next release mode)",
            "type": "array",
            "description": "One keyword per topic; each returns one row — the next release still ahead that matches it. A topic that has nothing scheduled returns a row with `found: false` instead of disappearing. Used in `nextRelease` mode.",
            "items": {
              "type": "string"
            }
          },
          "releaseStatus": {
            "title": "Release status",
            "enum": [
              "upcoming",
              "published",
              "cancelled",
              "all"
            ],
            "type": "string",
            "description": "Which part of the calendar to read. `all` reads the three lists and merges them; every row says which one it came from in `status`.",
            "default": "upcoming"
          },
          "confirmation": {
            "title": "Confirmed or provisional",
            "enum": [
              "any",
              "confirmed",
              "provisional"
            ],
            "type": "string",
            "description": "ONS confirms a date about four weeks ahead; entries further out carry a provisional date (a month, sometimes a day) that can still move. `confirmed` keeps only finalised entries — the ones safe to trade or publish against; `provisional` keeps the rest, useful for planning the year ahead.",
            "default": "any"
          },
          "dateFrom": {
            "title": "From date (UK, inclusive)",
            "type": "string",
            "description": "Earliest release date, YYYY-MM-DD. Set `dateFrom` and `dateTo` to read a fixed window, e.g. past releases of one bulletin. Leave both empty to use `withinDays`."
          },
          "dateTo": {
            "title": "To date (UK, inclusive)",
            "type": "string",
            "description": "Latest release date, YYYY-MM-DD. Provisional entries reach roughly two years ahead; a window beyond that simply returns fewer rows and the run says so."
          },
          "withinDays": {
            "title": "Window in days",
            "minimum": 1,
            "maximum": 1095,
            "type": "integer",
            "description": "Used only when `dateFrom` and `dateTo` are both empty: the next N days for `upcoming`, the last N days for `published`, and N days either side of today for `cancelled` and `all` (ONS keeps a cancelled entry on the calendar long after the date it was due). 30 for a monthly planning run, 730 to see every provisional date ONS has pencilled in.",
            "default": 90
          },
          "censusOnly": {
            "title": "Census releases only",
            "type": "boolean",
            "description": "Keep only releases ONS tags as census output. Off by default; the calendar holds a few of them at a time.",
            "default": false
          },
          "sortOrder": {
            "title": "Sort",
            "enum": [
              "soonest",
              "latest",
              "relevance"
            ],
            "type": "string",
            "description": "`relevance` only makes sense together with a keyword. `nextRelease` always sorts its own matches by release moment.",
            "default": "soonest"
          },
          "includeDetails": {
            "title": "Add details from each release page",
            "type": "boolean",
            "description": "Fetch each release's own page data for the next-release text, the accredited-official-statistics flag, the ONS enquiries contact, cancellation and date-change notices and the linked datasets, bulletins and API datasets. One extra request per row, so keep `maxItems` small when this is on.",
            "default": false
          },
          "onlyNew": {
            "title": "Only entries not seen before",
            "type": "boolean",
            "description": "Remember release page plus release moment in this actor's key-value store and output only entries missing from the previous run. A rescheduled or postponed release counts as new, so a scheduled task emits exactly the calendar changes. The first run outputs everything it finds.",
            "default": false
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop after this many rows. The whole upcoming list is about 400 entries; a month of it is about 60.",
            "default": 30
          },
          "fields": {
            "title": "Output fields",
            "type": "array",
            "description": "Keep only these output fields, in this order, e.g. [\"releaseTitle\", \"releaseDateUtc\", \"isProvisional\"]. Empty = all fields of the mode.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}