{
  "openapi": "3.0.1",
  "info": {
    "title": "Flood Warnings & River Levels Monitor: UK, France, Germany, US",
    "description": "River level and flood warning watchlist for your sites. Nearest gauges in England, France, Germany and the US with latest water level, trend, high-water status, NWS flood category and Environment Agency flood warnings. Monitor mode returns only changes.",
    "version": "0.1",
    "x-build-id": "avPiynn6iMJkJ2ddb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/maliksaid~flood-warnings-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-maliksaid-flood-warnings-monitor",
        "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/maliksaid~flood-warnings-monitor/runs": {
      "post": {
        "operationId": "runs-sync-maliksaid-flood-warnings-monitor",
        "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/maliksaid~flood-warnings-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-maliksaid-flood-warnings-monitor",
        "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": {
          "sites": {
            "title": "Sites to watch",
            "type": "array",
            "description": "Your assets: a list of places, each with name, latitude, longitude and an optional radiusKm. For each site the Actor returns the nearest river gauges within the radius, one row per site and gauge. England sites also get active Environment Agency flood alerts and warnings. Up to 100 sites per run.",
            "default": [
              {
                "name": "York riverside warehouse",
                "latitude": 53.959,
                "longitude": -1.0815,
                "radiusKm": 25
              },
              {
                "name": "Paris office",
                "latitude": 48.8566,
                "longitude": 2.3522,
                "radiusKm": 25
              },
              {
                "name": "Cologne depot",
                "latitude": 50.9375,
                "longitude": 6.9603,
                "radiusKm": 25
              },
              {
                "name": "Sacramento plant",
                "latitude": 38.5816,
                "longitude": -121.4944,
                "radiusKm": 25
              }
            ]
          },
          "defaultRadiusKm": {
            "title": "Default radius (km)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Search radius used for a site that has no radiusKm. Gauges and warnings further away are ignored.",
            "default": 25
          },
          "gaugesPerSite": {
            "title": "Gauges per site",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many of the nearest reporting gauges to return for each site. Each gauge is one row.",
            "default": 3
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Which national services to read. A site is checked only against the countries its radius touches. Leave empty for all four.",
            "items": {
              "type": "string",
              "enum": [
                "england",
                "france",
                "germany",
                "us"
              ],
              "enumTitles": [
                "England (Environment Agency)",
                "France (Hub'Eau hydrometrie)",
                "Germany (PEGELONLINE federal waterways)",
                "United States (NOAA National Water Prediction Service)"
              ]
            },
            "default": [
              "england",
              "france",
              "germany",
              "us"
            ]
          },
          "includeEndedWarnings": {
            "title": "Include ended England warnings",
            "type": "boolean",
            "description": "Also list England warnings that the Environment Agency still lists as 'Warning no longer in force'. Off returns only flood alerts, flood warnings and severe flood warnings in force.",
            "default": false
          },
          "monitorMode": {
            "title": "Monitor mode (only changes)",
            "type": "boolean",
            "description": "Return a site and gauge row only when its alert state changed since the last monitor-mode run with the same state key. The alert state is the level status, the US flood categories and the set of England warnings with their severity. The first run returns every row. Schedule the Actor with this on to get change-only alerts.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor state key",
            "type": "string",
            "description": "Name of the memory that monitor mode uses. Use a different key for each separate watch list.",
            "default": "default"
          },
          "maxItems": {
            "title": "Maximum items",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after saving this many rows. The default keeps test runs short and cheap. Set 0 for no limit.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}