{
  "openapi": "3.1.0",
  "info": {
    "title": "METAR Settle",
    "version": "1.0.0",
    "description": "Settlement values for Polymarket daily highest/lowest temperature markets, computed exactly the way the market rules define them from Aviation Weather Center METARs. Most traders watch a weather app's daily high; these markets settle on the hourly T-group remark of routine reports only (SPECI excluded), timed by the report's own stamp in station local time, rounded half up. The paid call returns the qualifying value so far, the range it is in, and ranges that are already impossible but still priced.",
    "x-guidance": "List open Polymarket temperature markets for free at GET /v1/polymarket/weather/markets (slug, station, local date, 24h volume). For a market, call GET /v1/polymarket/weather?slug=<slug> to get its settlement value so far computed with the market's own rules, the range it falls in, ranges that are already impossible but still have a Yes price, and hours left in the station's local day. Poll every 10-20 minutes during the local afternoon for highs and early morning for lows. For a station without a market, call GET /v1/metar/extreme?station=RKSI&kind=high&unit=C. Payment is x402, USDC on Base."
  },
  "servers": [
    {
      "url": "https://metar-settle.manifester.workers.dev"
    }
  ],
  "paths": {
    "/v1/polymarket/weather": {
      "get": {
        "operationId": "polymarketWeatherSettlement",
        "summary": "Live settlement state of one Polymarket daily highest/lowest temperature market, computed exactly as its rules say from Aviation Weather Center METARs",
        "description": "Live settlement state of one Polymarket daily highest/lowest temperature market, computed exactly as its rules say from Aviation Weather Center METARs: qualifying value so far (routine reports only, T-group tenths with body fallback, report timestamp in station local time, half-up rounding), the range it falls in, ranges already impossible with their current Yes prices, every observation counted or excluded with the reason, and time left in the local day.",
        "tags": [
          "Settlement"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": true,
            "description": "Polymarket event slug, e.g. highest-temperature-in-nyc-on-december-5-2026",
            "schema": {
              "type": "string"
            },
            "example": "highest-temperature-in-nyc-on-december-5-2026"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "market": {
                    "title": "Highest temperature in NYC on December 5?",
                    "slug": "highest-temperature-in-nyc-on-december-5-2026"
                  },
                  "rules": {
                    "kind": "high",
                    "station": "KLGA",
                    "unit": "F",
                    "date": "2026-12-05",
                    "template": "metar-hourly-remark-v1",
                    "supported": true
                  },
                  "settlement": {
                    "station": "KLGA",
                    "timezone": "America/New_York",
                    "local_date": "2026-12-05",
                    "kind": "high",
                    "unit": "F",
                    "status": "in_progress",
                    "hours_left_in_local_day": 6.2,
                    "qualifying_so_far": {
                      "temp_c_exact": 18.3,
                      "rounded": 65,
                      "unit": "F",
                      "from": "T-group",
                      "observation_time_local": "2026-12-05T14:51",
                      "raw": "METAR KLGA 051951Z 22009KT 10SM FEW250 18/02 A3001 RMK AO2 SLP162 T01830017"
                    },
                    "counted_observations": 15,
                    "excluded_observations": 1
                  },
                  "current_range": "64-65°F",
                  "impossible_ranges_still_priced": [
                    {
                      "label": "62-63°F",
                      "yes_price": 0.04
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        }
      }
    },
    "/v1/metar/extreme": {
      "get": {
        "operationId": "metarDayExtreme",
        "summary": "Highest or lowest temperature of one station's local calendar day from routine METARs, with Polymarket-style rules (SPECI excluded, T-group tenths with body fallback, report timestamp in local time) and half-up rounding to whole °C or °F",
        "description": "Highest or lowest temperature of one station's local calendar day from routine METARs, with Polymarket-style rules (SPECI excluded, T-group tenths with body fallback, report timestamp in local time) and half-up rounding to whole °C or °F. Works for any supported ICAO station without a market.",
        "tags": [
          "Settlement"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "station",
            "in": "query",
            "required": true,
            "description": "ICAO code, e.g. KLGA, RKSI, EGLC",
            "schema": {
              "type": "string"
            },
            "example": "RKSI"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "Local date YYYY-MM-DD (default: today at the station)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "high or low (default high)",
            "schema": {
              "type": "string"
            },
            "example": "high"
          },
          {
            "name": "unit",
            "in": "query",
            "required": false,
            "description": "C or F (default C)",
            "schema": {
              "type": "string"
            },
            "example": "C"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "station": "KLGA",
                  "timezone": "America/New_York",
                  "local_date": "2026-12-05",
                  "kind": "high",
                  "unit": "F",
                  "status": "in_progress",
                  "hours_left_in_local_day": 6.2,
                  "qualifying_so_far": {
                    "temp_c_exact": 18.3,
                    "rounded": 65,
                    "unit": "F",
                    "from": "T-group",
                    "observation_time_local": "2026-12-05T14:51",
                    "raw": "METAR KLGA 051951Z 22009KT 10SM FEW250 18/02 A3001 RMK AO2 SLP162 T01830017"
                  },
                  "counted_observations": 15,
                  "excluded_observations": 1
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        }
      }
    }
  }
}