{
  "openapi": "3.0.1",
  "info": {
    "title": "NWS weather alerts + forecasts by state/point (api.weather.gov)",
    "description": "Active U.S. National Weather Service alerts (warnings, watches, advisories) as one row each - event, severity, urgency, areas, states, onset/expiry, full text - filtered by state and severity; or the 7-day / hourly NWS forecast for up to 20 lat/lon points. Public api.weather.gov, no key.",
    "version": "0.1",
    "x-build-id": "oZp1edsEhwAudY8Bx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/retrainmap~nws-weather-alerts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-retrainmap-nws-weather-alerts",
        "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/retrainmap~nws-weather-alerts/runs": {
      "post": {
        "operationId": "runs-sync-retrainmap-nws-weather-alerts",
        "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/retrainmap~nws-weather-alerts/run-sync": {
      "post": {
        "operationId": "run-sync-retrainmap-nws-weather-alerts",
        "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": [
              "alerts",
              "forecast"
            ],
            "type": "string",
            "description": "`alerts`: one row per active alert (status=actual). `forecast`: one row per forecast period for each point.",
            "default": "alerts"
          },
          "states": {
            "title": "States / areas (alerts)",
            "uniqueItems": true,
            "type": "array",
            "description": "Two-letter state or territory codes (TX, FL, PR, ...) or NWS marine area codes (AM, AN, GM, LC, LE, LH, LM, LO, LS, PH, PK, PM, PS, PZ, SL). Leave empty for every active alert in the country.",
            "items": {
              "type": "string"
            }
          },
          "severity": {
            "title": "Severity (alerts)",
            "uniqueItems": true,
            "type": "array",
            "description": "Optional. Keep only alerts with these severities.",
            "items": {
              "type": "string",
              "enum": [
                "Extreme",
                "Severe",
                "Moderate",
                "Minor",
                "Unknown"
              ],
              "enumTitles": [
                "Extreme",
                "Severe",
                "Moderate",
                "Minor",
                "Unknown"
              ]
            }
          },
          "urgency": {
            "title": "Urgency (alerts)",
            "uniqueItems": true,
            "type": "array",
            "description": "Optional. Keep only alerts with these urgencies.",
            "items": {
              "type": "string",
              "enum": [
                "Immediate",
                "Expected",
                "Future",
                "Past",
                "Unknown"
              ],
              "enumTitles": [
                "Immediate",
                "Expected",
                "Future",
                "Past",
                "Unknown"
              ]
            }
          },
          "certainty": {
            "title": "Certainty (alerts)",
            "uniqueItems": true,
            "type": "array",
            "description": "Optional. Keep only alerts with these certainties.",
            "items": {
              "type": "string",
              "enum": [
                "Observed",
                "Likely",
                "Possible",
                "Unlikely",
                "Unknown"
              ],
              "enumTitles": [
                "Observed",
                "Likely",
                "Possible",
                "Unlikely",
                "Unknown"
              ]
            }
          },
          "events": {
            "title": "Event names (alerts)",
            "uniqueItems": true,
            "type": "array",
            "description": "Optional. Exact NWS event names, e.g. \"Tornado Warning\", \"Flood Watch\", \"Heat Advisory\" (passed to the API's event filter).",
            "items": {
              "type": "string"
            }
          },
          "points": {
            "title": "Points \"lat,lon\" (forecast)",
            "uniqueItems": true,
            "type": "array",
            "description": "Up to 20 entries such as \"40.7128,-74.0060\" (U.S. locations only; two requests per point).",
            "items": {
              "type": "string"
            }
          },
          "forecast_type": {
            "title": "Forecast type (forecast)",
            "enum": [
              "daily",
              "hourly"
            ],
            "type": "string",
            "description": "`daily` = the standard 7-day forecast in 14 half-day periods; `hourly` = 156 hourly periods per point.",
            "default": "daily"
          },
          "max_records": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many rows have been written.",
            "default": 300
          },
          "request_interval_ms": {
            "title": "Minimum interval between requests (ms)",
            "minimum": 250,
            "maximum": 10000,
            "type": "integer",
            "description": "Politeness delay towards api.weather.gov (floor 250 ms). Alerts mode makes one request; forecast mode two per point.",
            "default": 500
          },
          "contact_email": {
            "title": "Contact e-mail (User-Agent and From: header)",
            "type": "string",
            "description": "The NWS API requires a User-Agent that names the application and a contact. Sent in the User-Agent and in the standard From: request header (RFC 9110 s10.1.2).",
            "default": "info@steelyardclinical.com"
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}