{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Water Quality & Sewage Data – Rivers, Beaches (EA)",
    "description": "Official Environment Agency water quality lab results for England: rivers, lakes, canals, bathing beaches, estuaries and water-company sewage works effluent. Ammonia, nitrate, phosphate, BOD, E. coli, pH and 1000s more, back to 2000. No API key.",
    "version": "0.1",
    "x-build-id": "iVV5yqel2hDvj6NZf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/denjino~uk-water-quality-archive/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-denjino-uk-water-quality-archive",
        "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/denjino~uk-water-quality-archive/runs": {
      "post": {
        "operationId": "runs-sync-denjino-uk-water-quality-archive",
        "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/denjino~uk-water-quality-archive/run-sync": {
      "post": {
        "operationId": "run-sync-denjino-uk-water-quality-archive",
        "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 return",
            "enum": [
              "observations",
              "samplingPoints"
            ],
            "type": "string",
            "description": "Water quality lab results, or only the sampling point directory (to find IDs).",
            "default": "observations"
          },
          "determinands": {
            "title": "Determinands (what was measured)",
            "type": "array",
            "description": "Optional. Exact names or 4-digit EA codes, e.g. 'Ammoniacal Nitrogen as N' (0111), 'Nitrate as N' (0117), 'Orthophosphate, reactive as P' (0180), 'BOD : 5 Day ATU' (0085), 'pH' (0061), 'Temperature of Water' (0076), 'Oxygen, Dissolved, % Saturation' (9901), 'Escherichia coli : Confirmed : MPN' (0939), 'Enterococci: Intestinal: Confirmed: MF' (3723). Leave empty for every determinand.",
            "items": {
              "type": "string"
            }
          },
          "search": {
            "title": "Sampling point name contains",
            "type": "string",
            "description": "Optional text in the sampling point name, e.g. 'THAMES', 'CHERWELL', 'STW' or a town."
          },
          "samplingPointIds": {
            "title": "Sampling point IDs",
            "type": "array",
            "description": "Optional EA sampling point notations like 'TH-PCHR0016' or 'AN-CORBY' (max 100). With a single ID there is no 1-year limit on the date range.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Water types",
            "type": "array",
            "description": "Optional. Leave empty for all public water types listed. Private discharges and private wells are never included.",
            "items": {
              "type": "string",
              "enum": [
                "rivers",
                "lakes",
                "canalsDrains",
                "bathingWaters",
                "coastalEstuary",
                "sewageWaterCompany",
                "waterTreatmentWorks"
              ],
              "enumTitles": [
                "Rivers",
                "Lakes, ponds & reservoirs",
                "Canals & land drains",
                "Bathing waters (beaches & inland)",
                "Coastal & estuary waters",
                "Water-company sewage works (final effluent, storm overflows, inlets)",
                "Water-company treatment works effluent"
              ]
            }
          },
          "region": {
            "title": "EA region",
            "enum": [
              "AN",
              "MD",
              "NE",
              "NW",
              "SO",
              "SW",
              "TH"
            ],
            "type": "string",
            "description": "Optional Environment Agency region."
          },
          "latitude": {
            "title": "Near latitude",
            "type": "number",
            "description": "Optional. With longitude, only sampling points within the radius."
          },
          "longitude": {
            "title": "Near longitude",
            "type": "number",
            "description": "Optional longitude for the near-a-point search."
          },
          "radiusKm": {
            "title": "Radius (km)",
            "minimum": 0.1,
            "maximum": 100,
            "type": "number",
            "description": "Search radius around the point.",
            "default": 5
          },
          "startDate": {
            "title": "Start date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "YYYY-MM-DD. Default: 1 year before the end date. Longer ranges are split into yearly requests automatically (newest first)."
          },
          "endDate": {
            "title": "End date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "YYYY-MM-DD. Default: today."
          },
          "complianceOnly": {
            "title": "Compliance samples only",
            "type": "boolean",
            "description": "Only samples taken for permit or directive compliance.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum rows to return (0 = no limit). Controls cost.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}