{
  "openapi": "3.0.1",
  "info": {
    "title": "Storm Overflow Sewage Spill Events England: EDM Data",
    "description": "Every storm overflow sewage discharge in England as clean rows: start, stop and duration from the Environment Agency's event duration monitoring data, per-site 12/24 spill counts, and live status from water company feeds.",
    "version": "0.1",
    "x-build-id": "vTTJYgKBc0tuOdokk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/thomasjacks~storm-overflow-events-england/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-thomasjacks-storm-overflow-events-england",
        "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/thomasjacks~storm-overflow-events-england/runs": {
      "post": {
        "operationId": "runs-sync-thomasjacks-storm-overflow-events-england",
        "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/thomasjacks~storm-overflow-events-england/run-sync": {
      "post": {
        "operationId": "run-sync-thomasjacks-storm-overflow-events-england",
        "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": {
          "dataset": {
            "title": "Table",
            "enum": [
              "events",
              "site_summary",
              "live"
            ],
            "type": "string",
            "description": "Events: one row per monitor activation (start, stop, duration). Site summary: one row per overflow with total hours, longest discharge and a 12/24 spill count. Live: the current status of every overflow from the water companies' near real-time feeds.",
            "default": "events"
          },
          "companies": {
            "title": "Water companies",
            "type": "array",
            "description": "Leave empty for all ten. Dŵr Cymru Welsh Water is in the events and summary tables only (its English overflows).",
            "items": {
              "type": "string",
              "enum": [
                "Anglian Water",
                "Dŵr Cymru Welsh Water",
                "Northumbrian Water",
                "Severn Trent Water",
                "South West Water",
                "Southern Water",
                "Thames Water",
                "United Utilities",
                "Wessex Water",
                "Yorkshire Water"
              ]
            },
            "default": []
          },
          "years": {
            "title": "Years (events and summary)",
            "type": "array",
            "description": "Calendar years of EA data, for example 2025, or 'latest' for the newest file (on 12 November 2026: 2026 year to August). Files exist from 2024.",
            "default": [
              "latest"
            ],
            "items": {
              "type": "string"
            }
          },
          "siteIds": {
            "title": "Overflow Unique IDs",
            "type": "array",
            "description": "The EA's Unique IDs, for example TWL00002 or SWS00066. The first three letters identify the company.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "siteNameContains": {
            "title": "Site name contains",
            "type": "string",
            "description": "For example 'Mogden' or 'CSO'.",
            "default": ""
          },
          "postcode": {
            "title": "Near a postcode",
            "type": "string",
            "description": "Only overflows within a distance of this postcode, for example LS1 4AP. Rows gain a distanceKm field.",
            "default": ""
          },
          "radiusKm": {
            "title": "Distance from the postcode (km)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Used with the postcode. Measured in a straight line to the overflow.",
            "default": 5
          },
          "constituencies": {
            "title": "Parliamentary constituencies",
            "type": "array",
            "description": "Only overflows in these Westminster constituencies (2024 boundaries), for example Hastings and Rye.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "localAuthorities": {
            "title": "Councils",
            "type": "array",
            "description": "Only overflows in these council areas (local authority districts), for example Cornwall or Leeds.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "receivingWaterContains": {
            "title": "Receiving water contains",
            "type": "string",
            "description": "The river, stream, estuary or sea the overflow discharges into, for example 'Thames' or 'Wye'.",
            "default": ""
          },
          "bathingOrShellfishWatersOnly": {
            "title": "Bathing or shellfish waters only",
            "type": "boolean",
            "description": "Keep only overflows that the annual return links to a designated bathing water or shellfish water.",
            "default": false
          },
          "dateFrom": {
            "title": "From date (events and summary)",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Keep activations that start on or after this date, as YYYY-MM-DD.",
            "default": ""
          },
          "dateTo": {
            "title": "To date (events and summary)",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Keep activations that start on or before this date, as YYYY-MM-DD.",
            "default": ""
          },
          "minDurationHours": {
            "title": "Minimum duration, hours (events)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Keep only activations at least this long."
          },
          "liveStatus": {
            "title": "Live status (live table)",
            "enum": [
              "all",
              "discharging",
              "offline",
              "not_discharging"
            ],
            "type": "string",
            "description": "Which overflows to return from the live feeds.",
            "default": "all"
          },
          "includeSiteDetails": {
            "title": "Add site details",
            "type": "boolean",
            "description": "Join site name, permit, receiving water, bathing and shellfish waters, location and the official annual return figures from the EA annual return. Adds about 15 seconds.",
            "default": true
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "newest",
              "oldest",
              "longest",
              "most_hours",
              "most_spills",
              "site"
            ],
            "type": "string",
            "description": "Events: newest, oldest or longest. Summary: most hours, most spills, longest single discharge or site ID. Live rows always list discharging overflows first."
          },
          "maxResults": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 2000000,
            "type": "integer",
            "description": "Stop after this many rows. The limit is applied after sorting.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}