{
  "openapi": "3.0.1",
  "info": {
    "title": "Rhine & German River Water Levels (PEGELONLINE)",
    "description": "Water levels of German federal waterways from PEGELONLINE (WSV): Rhine, Elbe, Danube, Moselle and 740 gauges. Current reading with trend, low/high water state and discharge, or 30-day history. Threshold alerts for low or high water.",
    "version": "0.1",
    "x-build-id": "44mUDEoaVXw8Nb7jz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/adamplaenitz~pegelonline-water-levels/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-adamplaenitz-pegelonline-water-levels",
        "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/adamplaenitz~pegelonline-water-levels/runs": {
      "post": {
        "operationId": "runs-sync-adamplaenitz-pegelonline-water-levels",
        "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/adamplaenitz~pegelonline-water-levels/run-sync": {
      "post": {
        "operationId": "run-sync-adamplaenitz-pegelonline-water-levels",
        "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": {
          "stations": {
            "title": "Stations",
            "type": "array",
            "description": "Gauging stations by name (e.g. KÖLN or KOELN, KAUB, MAXAU, DRESDEN, PASSAU DONAU), station number (e.g. 2730010) or UUID as listed on pegelonline.wsv.de. A name without suffix also finds stations starting with it (DUISBURG → DUISBURG-RUHRORT).",
            "items": {
              "type": "string"
            }
          },
          "waters": {
            "title": "Waters",
            "type": "array",
            "description": "All stations on these waters, e.g. RHEIN, ELBE, DONAU, MOSEL, MAIN, NECKAR, WESER, ODER, SAALE, EMS, MLK (Mittellandkanal), NORDSEE, OSTSEE.",
            "items": {
              "type": "string"
            }
          },
          "allStations": {
            "title": "All stations",
            "type": "boolean",
            "description": "Use all about 740 PEGELONLINE stations that measure the water level (combine with alert thresholds to get only stations above/below a level).",
            "default": false
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "current",
              "history"
            ],
            "type": "string",
            "description": "current = latest reading per station with trend and state relative to mean low/high water. history = all raw measurements of the last N days (one item per measurement).",
            "default": "current"
          },
          "historyDays": {
            "title": "History days",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "History mode: number of days back (1–30; PEGELONLINE keeps raw data for about 30 days). 1 day ≈ 96 measurements per station (15-minute steps).",
            "default": 1
          },
          "includeTrend": {
            "title": "Include trend",
            "type": "boolean",
            "description": "Current mode: compute trend (rising/falling/steady) and the change over the last hour and 24 hours from the last 25 hours of data (one extra request per station).",
            "default": true
          },
          "alertAboveCm": {
            "title": "Alert: at or above (cm)",
            "type": "integer",
            "description": "Output only stations (current mode) or measurements (history mode) with a water level at or above this value in cm (gauge reading). Combined with 'at or below' as OR."
          },
          "alertBelowCm": {
            "title": "Alert: at or below (cm)",
            "type": "integer",
            "description": "Output only stations/measurements with a water level at or below this value in cm, e.g. low water for shipping."
          },
          "onlyStates": {
            "title": "Only states (MNW/MHW)",
            "type": "array",
            "description": "Current mode: keep only stations whose current level has one of these states relative to mean low water (MNW) and mean high water (MHW): low = below MNW, high = above MHW. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "low",
                "normal",
                "high",
                "unknown",
                "commented",
                "out-dated"
              ],
              "enumTitles": [
                "Low (below MNW)",
                "Normal",
                "High (above MHW)",
                "Unknown (no MNW/MHW)",
                "Commented",
                "Out-dated"
              ]
            }
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 5000000,
            "type": "integer",
            "description": "Upper limit of charged items per run (station readings or measurements).",
            "default": 100000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}