{
  "openapi": "3.0.1",
  "info": {
    "title": "France Water Data (Hub'Eau): Quality, Rivers, Groundwater",
    "description": "French water data from the official Hub'Eau open API: tap-water quality by commune, river flow and level in near real time, groundwater levels, river quality and temperature, low-flow observations and water withdrawals. Unofficial; no personal data.",
    "version": "0.1",
    "x-build-id": "rZUMarvGgfsMZ0yNM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/shadow-tools~france-water-data-hubeau/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-shadow-tools-france-water-data-hubeau",
        "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/shadow-tools~france-water-data-hubeau/runs": {
      "post": {
        "operationId": "runs-sync-shadow-tools-france-water-data-hubeau",
        "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/shadow-tools~france-water-data-hubeau/run-sync": {
      "post": {
        "operationId": "run-sync-shadow-tools-france-water-data-hubeau",
        "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": [
              "drinkingWater",
              "riverFlowRealtime",
              "groundwater",
              "riverQuality",
              "riverTemperature",
              "lowFlow",
              "withdrawals"
            ],
            "type": "string",
            "description": "Pick one. \"drinkingWater\" = use for tap-water quality: sanitary control results per commune (nitrates, chlorine, bacteria...), newest first. \"riverFlowRealtime\" = use for current river flow (m3/s) or water height (m) at hydrometric stations, latest value per station. \"groundwater\" = use for current groundwater levels at real-time piezometers. \"riverQuality\" = use for river physico-chemical analyses (oxygen, nitrates, pesticides...). \"riverTemperature\" = use for river temperature series from continuous sensors (dataset updated about quarterly). \"lowFlow\" = use for visual drought/low-flow observations of small streams (Onde network). \"withdrawals\" = use for annual volumes of water withdrawn by use (drinking water, irrigation, industry...), without owner names. Allowed values: drinkingWater, riverFlowRealtime, groundwater, riverQuality, riverTemperature, lowFlow, withdrawals. Default: drinkingWater.",
            "default": "drinkingWater"
          },
          "department": {
            "title": "Department codes",
            "maxItems": 30,
            "type": "array",
            "description": "French department codes as a list, e.g. [\"69\", \"2A\", \"971\"]. Metropolitan codes have two characters (\"01\", \"69\", \"2A\"), overseas three (\"971\"). Any of them matches (OR). Works in all modes. Empty = all of France (latest records first).",
            "items": {
              "type": "string"
            }
          },
          "commune": {
            "title": "Commune INSEE codes",
            "maxItems": 50,
            "type": "array",
            "description": "5-character INSEE commune codes as a list, e.g. [\"69123\"] for Lyon or [\"2A004\"] for Ajaccio. Any of them matches (OR). Works in all modes. Not the postal code. Empty = no commune filter.",
            "items": {
              "type": "string"
            }
          },
          "stationCode": {
            "title": "Station / site / network codes",
            "maxItems": 100,
            "type": "array",
            "description": "Codes of monitoring points as a list, e.g. [\"Y251002001\"]. Meaning depends on the mode: hydrometric station code (riverFlowRealtime, e.g. \"Y251002001\"), BSS piezometer code (groundwater, e.g. \"00035X0210/PZO1\"), river station code (riverQuality, riverTemperature, e.g. \"06057700\"), Onde station code (lowFlow, e.g. \"Y2570051\"), distribution network (UDI) code (drinkingWater, e.g. \"069000136\"), withdrawal work code (withdrawals, e.g. \"OPR0000028733\"). Empty = no filter.",
            "items": {
              "type": "string"
            }
          },
          "parameterCode": {
            "title": "Parameter codes",
            "maxItems": 30,
            "type": "array",
            "description": "Numeric Sandre parameter codes as a list, e.g. [\"1340\"] for nitrates in drinking water or [\"1311\", \"1301\"] for dissolved oxygen and water temperature in rivers. Only for drinkingWater and riverQuality. Empty = all parameters.",
            "items": {
              "type": "string"
            }
          },
          "quantity": {
            "title": "Quantity (riverFlowRealtime)",
            "enum": [
              "flow",
              "height",
              "both"
            ],
            "type": "string",
            "description": "What to read in riverFlowRealtime mode, e.g. \"flow\". Allowed values: flow (discharge, returned in l/s and m3/s; default), height (water height, mm and m), both. Ignored in other modes."
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "First day to include as YYYY-MM-DD, e.g. \"2026-06-01\". Applies to sampling/measurement/observation dates. In riverFlowRealtime and groundwater it replaces the lookback window. Not used by withdrawals (use year). Empty = no lower bound."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Last day to include as YYYY-MM-DD, e.g. \"2026-06-30\"; must not be before dateFrom. Not used by withdrawals. Empty = no upper bound."
          },
          "year": {
            "title": "Years (withdrawals)",
            "maxItems": 20,
            "type": "array",
            "description": "Years of the annual withdrawal volumes as a list, e.g. [\"2022\", \"2023\"] (integers are accepted too). Only for mode withdrawals. Empty = all years, newest first.",
            "items": {
              "type": "string"
            }
          },
          "usage": {
            "title": "Usage codes (withdrawals)",
            "maxItems": 20,
            "type": "array",
            "description": "Usage codes of the withdrawn water as a list, e.g. [\"AEP\", \"IRR\", \"IND\"] (AEP drinking water, IRR irrigation, IND industry). Only for mode withdrawals. Empty = all uses.",
            "items": {
              "type": "string"
            }
          },
          "aggregateBy": {
            "title": "Aggregate (withdrawals)",
            "enum": [
              "none",
              "commune",
              "usage"
            ],
            "type": "string",
            "description": "Only for mode withdrawals: sum the volumes instead of listing each work, e.g. \"usage\". Allowed values: none (one record per work and year; default), commune (one record per commune, year and usage), usage (one record per usage, year and department). Aggregates carry no work code."
          },
          "latestPerStation": {
            "title": "Latest value per station",
            "type": "boolean",
            "description": "true to return only the newest measurement of each station (and quantity), e.g. true; false to list every measurement of the window, newest first. Only for riverFlowRealtime and groundwater. Default: true."
          },
          "lookbackHours": {
            "title": "Lookback window (hours)",
            "minimum": 1,
            "maximum": 720,
            "type": "integer",
            "description": "How far back to look for real-time measurements, an integer between 1 and 720, e.g. 6. Only for riverFlowRealtime (default 3) and groundwater (default 72); ignored when dateFrom is set. The API keeps about one month of real-time data."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of records returned, an integer between 1 and 10000, e.g. 20. Each record is one billed event. Default: 20.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}