{
  "openapi": "3.0.1",
  "info": {
    "title": "METAR & NWS Weather Station Observations API",
    "description": "Hourly METAR/ASOS airport weather by ICAO code or US lat/lon, up to 30 days back: temp, dewpoint, wind, ceiling, visibility, flight category, raw METAR. NOAA aviationweather.gov + Iowa State ASOS archive. Same stations Kalshi/Polymarket weather markets name. No API key.",
    "version": "0.2",
    "x-build-id": "CGfspZMK3pyza3arB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bigdavidson~metar-nws-weather-station-observations/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bigdavidson-metar-nws-weather-station-observations",
        "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/bigdavidson~metar-nws-weather-station-observations/runs": {
      "post": {
        "operationId": "runs-sync-bigdavidson-metar-nws-weather-station-observations",
        "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/bigdavidson~metar-nws-weather-station-observations/run-sync": {
      "post": {
        "operationId": "run-sync-bigdavidson-metar-nws-weather-station-observations",
        "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": {
          "stationIds": {
            "title": "Station IDs (ICAO)",
            "type": "array",
            "description": "ICAO station codes, e.g. KORD, KJFK, EGLL; 3-letter US codes (ORD, JFK) get the K prefix automatically. Kalshi city names and tickers map to the station the market settles on: NYC -> KNYC (Central Park), Chicago -> KMDW (Midway), KXHIGHCHI -> KMDW; full map in the README. \"Chicago O'Hare\" -> KORD. Case and separators don't matter. Max 50 per run (extras are skipped with a warning). Empty, with no coordinates = KORD.",
            "items": {
              "type": "string"
            }
          },
          "latLon": {
            "title": "Coordinates (US only, optional)",
            "type": "array",
            "description": "US lat/lon points to resolve to the nearest official observation station, e.g. [{\"lat\": 41.97, \"lon\": -87.9}]. [lat, lon] pairs and latitude/longitude keys also work. Resolved via the NWS station registry (api.weather.gov), which covers US points only. For other countries, put the ICAO code in Station IDs.",
            "default": []
          },
          "output": {
            "title": "Output",
            "enum": [
              "observations",
              "daily-summary"
            ],
            "type": "string",
            "description": "observations (default): one row per METAR/ASOS report. daily-summary: one row per station per station-local calendar day with high, low, precipitation and snowfall; US stations return the official NWS Daily Climate Report (source nws_cli), others max/min computed from METARs (source metar_derived, with a complete flag for partial days). Pick days with From/To date, or leave them empty to use Hours of history. Billed per summary row; notice rows are free.",
            "default": "observations"
          },
          "dateFrom": {
            "title": "From date (daily summary)",
            "type": "string",
            "description": "Only used with Output = daily-summary. First station-local calendar day to include, YYYY-MM-DD ('today' and 'yesterday' also work). Leave both dates empty to use Hours of history (the local days that overlap the last N hours). With only a From date the range runs through today; with only a To date it is that single day. At most 366 days per run."
          },
          "dateTo": {
            "title": "To date (daily summary)",
            "type": "string",
            "description": "Only used with Output = daily-summary. Last station-local calendar day to include, YYYY-MM-DD (default: today at each station). Days after a station's local today have no data yet and come back as a notice row."
          },
          "hoursBack": {
            "title": "Hours of history",
            "minimum": 1,
            "maximum": 720,
            "type": "integer",
            "description": "How many hours of observations to pull per station (1-720; 24 if empty). Up to 168h (7 days) comes from aviationweather.gov (live, includes SPECI special reports); 169-720h comes from the Iowa State Mesonet ASOS archive (routine hourly reports). With Output = daily-summary and no dates, the summary covers the station-local days that overlap the last N hours."
          },
          "fields": {
            "title": "Fields filter (optional)",
            "type": "array",
            "description": "Output fields to keep, e.g. temp_f, max_temp_24h_f, min_temp_24h_f, metar_raw; empty = all (station_id and utc_time are always kept). Observation field names are this field's suggested values. With Output = daily-summary use the summary names instead (high_f, low_f, precipitation_in, snowfall_in, complete, ...; see the README); record_type, station_id, date and source are always kept.",
            "items": {
              "type": "string",
              "enumSuggestedValues": [
                "station_id",
                "station_name",
                "lat",
                "lon",
                "utc_time",
                "temp_f",
                "dewpoint_f",
                "wind_dir",
                "wind_speed_kt",
                "ceiling_ft",
                "visibility_sm",
                "flight_category",
                "metar_raw",
                "source",
                "obs_time",
                "report_type",
                "temp_c",
                "dewpoint_c",
                "wind_gust_kt",
                "altimeter_hpa",
                "max_temp_6h_f",
                "min_temp_6h_f",
                "max_temp_24h_f",
                "min_temp_24h_f"
              ]
            },
            "default": []
          },
          "question": {
            "title": "Question in plain English (optional, Claude)",
            "type": "string",
            "description": "Optional. Claude turns a request such as \"daily highs in Chicago and NYC for the last week\" into Station IDs, Output, dates and Hours of history. Anything you fill in yourself wins (Output = observations counts as unset), so clear the prefilled Station IDs and Hours of history to let the question set them. A free notice row shows how it was read; if Claude is unavailable your inputs are used. The Claude call is free; rows it asks for are billed as usual. Your question is sent to Anthropic."
          },
          "aiSummary": {
            "title": "Plain-English summary (optional, Claude)",
            "type": "boolean",
            "description": "Optional, off by default. After the data rows are delivered, Claude writes a short summary of them (up to about 120 words, from at most 60 rows) into one free notice row (notice_code ai_summary). Advisory only: it never changes a data row, and the rows stay the source of truth. No extra charge. The sampled rows are sent to Anthropic.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}