{
  "openapi": "3.0.1",
  "info": {
    "title": "England Flood Monitoring - River Levels & Warnings (EA)",
    "description": "Live England flood data from the Environment Agency (OGL): current warnings and alerts, 5,500 gauging stations and latest level/flow/rainfall readings. Search by station, river, town or radius.",
    "version": "0.0",
    "x-build-id": "812hk7S1KjTJ5XlYd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~uk-flood-monitoring/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-uk-flood-monitoring",
        "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/j0401~uk-flood-monitoring/runs": {
      "post": {
        "operationId": "runs-sync-j0401-uk-flood-monitoring",
        "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/j0401~uk-flood-monitoring/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-uk-flood-monitoring",
        "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": "Mode",
            "enum": [
              "",
              "summary",
              "floods",
              "stations",
              "readings",
              "aggregate"
            ],
            "type": "string",
            "description": "summary = current counts; floods = active warnings and alerts; stations = gauging station lookup; readings = latest measurements joined to stations; aggregate = station rollup. Leave blank to auto-route: no filters -> summary, flood filters -> floods, other filters -> stations."
          },
          "station": {
            "title": "Station ID",
            "type": "string",
            "description": "Exact station notation, e.g. \"1029TH\"."
          },
          "town": {
            "title": "Town",
            "type": "string",
            "description": "Station town (word match, case-insensitive), e.g. \"Oxford\"."
          },
          "river": {
            "title": "River",
            "type": "string",
            "description": "River name (word match), e.g. \"Thames\", \"Ouse\"."
          },
          "catchment": {
            "title": "Catchment",
            "type": "string",
            "description": "Catchment name (word match), e.g. \"Cotswolds\"."
          },
          "parameter": {
            "title": "Parameter",
            "enum": [
              "",
              "level",
              "flow",
              "rainfall",
              "temperature",
              "wind"
            ],
            "type": "string",
            "description": "Measurement type. For stations this matches any of its measures; for readings it is the exact parameter."
          },
          "status": {
            "title": "Station status",
            "enum": [
              "",
              "active",
              "suspended",
              "closed",
              "ukcmf"
            ],
            "type": "string",
            "description": "Station status where the API publishes one. The source also carries 'ukcmf'."
          },
          "county": {
            "title": "County (floods)",
            "type": "string",
            "description": "Flood area county (word match), e.g. \"North Yorkshire\". Switches the run to mode=floods."
          },
          "eaArea": {
            "title": "EA area (floods)",
            "type": "string",
            "description": "Environment Agency area on the warning, e.g. \"Yorkshire\". Switches the run to mode=floods."
          },
          "keyword": {
            "title": "Keyword (floods)",
            "type": "string",
            "description": "Substring of the flood warning message."
          },
          "minSeverity": {
            "title": "Minimum severity",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "EA scale: 1 = severe flood warning, 2 = flood warning, 3 = flood alert, 4 = warning no longer in force. Returns everything at least as severe as the value (1 = only severe; 3 = severe + warnings + alerts)."
          },
          "latitude": {
            "title": "Latitude",
            "type": "number",
            "description": "Latitude for a radius search around a point."
          },
          "longitude": {
            "title": "Longitude",
            "type": "number",
            "description": "Longitude for a radius search around a point."
          },
          "radiusKm": {
            "title": "Radius (km)",
            "minimum": 1,
            "maximum": 200,
            "type": "number",
            "description": "Radius for the latitude/longitude search; defaults to 25 km.",
            "default": 25
          },
          "groupBy": {
            "title": "Aggregate by",
            "enum": [
              "",
              "river",
              "town",
              "catchment",
              "parameter",
              "status"
            ],
            "type": "string",
            "description": "Only used with mode=aggregate: river (default), town, catchment, parameter or status. The parameter groups use the display names (\"Water Level\", \"Rainfall\")."
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap the number of records pushed (0 = the default 50, maximum 5000). Aggregate mode returns the full rollup; maxResults is not applied.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}