# Polymarket Weather Markets API — Daily Temperature Odds (`bigdavidson/polymarket-weather-markets`) Actor

Live odds for every Polymarket daily high and low temperature market in 51 cities, bracket by bracket: bid/ask, implied probability, volume, the exact settlement station (ICAO), unit and results, plus the running METAR high/low at that station. No login, no API key. From $1 per 1,000 brackets.

- **URL**: https://apify.com/bigdavidson/polymarket-weather-markets.md
- **Developed by:** [Jack Sheward](https://apify.com/bigdavidson) (community)
- **Categories:** Developer tools, AI, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 market records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Polymarket Weather Markets API — Daily Temperature Odds

Get every **Polymarket daily temperature market** ("Highest temperature in NYC on September 24?", "Lowest temperature in London on …") as clean, flat JSON — **bracket by bracket**: live bid/ask from the order book, implied probability (raw and normalized), volume, liquidity, results — plus what nobody else gives you:

- **The exact settlement source for every city**: station (ICAO), agency, unit, precision, hourly-only and fallback rules. Parsed from each market's own rules text, for all 51 cities.
- **A live METAR running high/low at that exact station**, and a per-bracket status: `dead`, `leading`, `alive`, `final_proxy_win` or `final_proxy_loss`.
- **Settled history by date range**, with the winning bracket's bounds.

It uses Polymarket's public market-data API and aviationweather.gov directly. No login, no API key, no browser. The default run takes a few seconds and costs about $0.08.

#### Things most people get wrong about these markets (all checked on 2026-09-24)

- **Polymarket now settles 48 of 51 cities on NOAA station data, not Wunderground.** The source is the `weather.gov/wrh/timeseries` page, using hourly data. Wunderground is only the fallback if NOAA has no data by 11:59 PM ET the next day. Only Jinan and Taipei still settle on Wunderground.

- **Hong Kong settles on the Hong Kong Observatory's 0.1 °C reading, and the labels truncate.** 32.9 °C falls in "32°C". This matched 62 of 62 settled HK events. The `bracket_high_exclusive` field encodes it.

- **Kalshi and Polymarket use different stations in the same city:**

  | City | Polymarket | Kalshi |
  |---|---|---|
  | NYC | LaGuardia (KLGA) | Central Park (KNYC) |
  | Chicago | O'Hare (KORD) | Midway (KMDW) |
  | Denver | Buckley (KBKF) | DEN (KDEN) |
  | Dallas | Love Field (KDAL) | DFW (KDFW) |

- **The METAR running extreme landed in the winning bracket 194/194 times** (Sep 22–23, 48 stations, °C and °F). It is still a proxy, not the official value.

- **Polymarket's displayed prices are not probabilities.** On an empty or one-sided book the displayed price is roughly the midpoint. In NYC's Sep 26 low market, "72°F or higher" had no bid at all and an ask of 0.46, yet displayed 0.275. On Sep 24, 535 open brackets with no bid and no trade displayed 0.10 or more, and the displayed prices of the 254 live events summed to anywhere from 0.82 to 4.71. This actor never reports such a midpoint as a probability. `implied_probability` is `null` for those brackets, and `event_favorite_bracket` and `implied_probability_normalized` use real quotes only.

### What you get

One dataset with three kinds of rows. `record_type` is always the first field.

| `record_type` | One row per | Charged event |
|---|---|---|
| `market` | temperature bracket (≈11 per city-day-metric) | `market-record` |
| `station_observation` | settlement station × local day (METAR running high/low) | `station-observation` |
| `notice` | explanation (unknown city, no events, stopped at limit…) | **free** |

#### Key `market` fields

| Field | Example | Notes |
|---|---|---|
| `city`, `metric`, `event_date` | `NYC`, `high`, `2026-09-24` | `event_date` is the station-local calendar day. `city` is stable across history (e.g. January's "Seoul" events are output as `Seoul (Incheon)`, like today's); `city_key` is the short key |
| `bracket_label` | `68-69°F` | Polymarket's label |
| `bracket_kind` | `range` | `range`, `exact`, `or_below`, `or_above` |
| `bracket_low`, `bracket_high` | `68`, `69` | inclusive bounds as labelled; `null` = open end |
| `bracket_high_exclusive` | `70` | **the bracket wins iff `bracket_low ≤ official value < bracket_high_exclusive`** |
| `unit`, `settlement_precision` | `F`, `1` | `C`/`F`; `0.1` only for Hong Kong (HKO) |
| `yes_bid`, `yes_ask`, `bid_size`, `ask_size` | `0.99`, `0.992`, `10`, `208.39` | best levels from the live CLOB book (USD per share) |
| `mid`, `spread`, `last_trade_price` | `0.991`, `0.002`, `0.98` | missing bid counts as 0, missing ask as 1. `last_trade_price` is the last **YES-side** trade (`null` if the YES token never traded) |
| `implied_probability` | `0.991` | mid if spread ≤ 0.10. On a wider book: the last YES trade clamped into \[bid, ask], else the best bid (the only firm price). `null` when there is no bid and no YES trade on a wide or empty book, so an empty-book midpoint is never reported. Always within \[bid, ask] |
| `implied_probability_normalized` | `0.980703` | implied ÷ `event_implied_sum`, only when that sum is 0.8–1.25 (a rescale of at most 25%). `null` on thin events (most of the probability unpriced) and on stale ones |
| `price_flag` | `ok` | `ok`, `wide_spread`, `no_bid`, `no_book`, `resolved` |
| `price_source` | `clob_orderbook` | or `gamma_cached` (catalog price, up to 5 min old) |
| `status`, `result` | `open`, `null` | `open` / `closed_awaiting_resolution` / `resolved`; `yes`/`no` when resolved |
| `winning_bracket_label`, `settled_value_low`, `settled_value_high_exclusive` | `70-71°F`, `70`, `72` | settled events: the winner's label and bounds, repeated on every row. Polymarket publishes no temperature, only the winner. |
| `obs_extreme`, `obs_extreme_time`, `obs_count` | `68`, `2026-09-24T19:51:00Z`, `21` | METAR running max (high) / min (low) so far, in settlement units |
| `proxy_bracket_status` | `leading` | `dead` / `leading` / `alive`, then `final_proxy_win` / `final_proxy_loss` once the local day is over |
| `station_id`, `station_icao`, `station_name` | `KLGA`, `KLGA`, `LaGuardia Airport Station` | `HKO` has no ICAO code |
| `settlement_agency`, `settlement_source_url` | `NOAA`, `https://www.weather.gov/wrh/timeseries?site=klga` | `NOAA`, `Wunderground` or `Hong Kong Observatory` |
| `settles_on_hourly_obs_only`, `fallback_source` | `true`, `Wunderground` | from the rules text |
| `volume_usd`, `volume_24h_usd`, `liquidity_usd` | `9388.96`, `5953.49`, `440.58` | per bracket; `event_*` versions per event |
| `event_price_sum`, `event_implied_sum` | `1.0045`, `1.0105` | per event: sum of Polymarket's displayed `yes_price` / sum of `implied_probability`. A large gap usually means the displayed prices include midpoints of empty or one-sided books |
| `event_favorite_bracket` | `68-69°F` | the bracket with the highest `implied_probability`, if it is unique and at least 0.10; else `null` (thin book or a tie) |
| `taker_fee_rate`, `tick_size`, `min_order_size` | `0.05`, `0.001`, `5` | |
| ids and links | `event_id`, `market_id`, `condition_id`, `yes_token_id`, `no_token_id`, `event_url`, `market_url` | ready for Polymarket's CLOB API |

### Input

Every field is optional. An **empty input runs NYC live markets (high and low), with the order book and METAR proxy**. That is about 66 bracket rows in a few seconds, for about $0.08.

| Field | Type | Default | What it does |
|---|---|---|---|
| `cities` | list of strings | `["NYC"]` | Names (`London`, `Seoul`, `Hong Kong`), aliases (`New York`, `LA`, `SF`, `HK`, `KL`, `CDMX`, `TLV`), station ids (`KLGA`, `EGLC`) or series slugs. Case, accents and extra spaces are ignored, as are suffixes like "Chicago, IL". `"all"` selects every city. |
| `metric` | `both` | `high` | `low` | `both` | Daily highest or lowest temperature markets |
| `mode` | `live` | `settled` | `both` | `live` | `live` = open markets, usually today plus 1–2 days. `settled` = closed markets with results. |
| `lookbackDays` | integer 1–120 | `7` | Settled/both mode only, when no dates are given |
| `dateFrom` / `dateTo` | string | — | Event-date filter: `2026-09-25`, `today`, `tomorrow`, `yesterday`, `-3d` |
| `includeObservation` | boolean | `true` | Adds the METAR proxy fields and one `station_observation` row per station-day |
| `liveOrderBook` | boolean | `true` | Takes prices from the live CLOB book. Off = catalog prices, up to 5 min old. |
| `maxRecords` | integer | `5000` | Cap on charged market rows (1–100,000; `0` = no cap) |

Unknown cities never fail a run. They are skipped, and you get one **free** `notice` row listing every valid city. Values that pass the input schema but cannot be used, such as a `dateFrom` of "next week" or a `lookbackDays` of 500, fall back to defaults or are clamped, with a warning. Dates are kept within 2020–2100. In settled mode `dateTo` never goes past tomorrow, and a window longer than 120 days keeps its latest 120 days.

#### Example inputs

```json
{ "cities": ["all"] }
```

```json
{ "cities": ["London", "Tokyo", "Chicago"], "metric": "high" }
```

```json
{ "cities": ["NYC"], "mode": "settled", "dateFrom": "2026-09-01", "dateTo": "2026-09-23" }
```

### Output example (real run, 2026-09-24 21:04 UTC)

This is the NYC high on Sep 24, at 5 PM ET. The METAR running max at LaGuardia had reached 68 °F, so every bracket below 68 is `dead`. `68-69°F` is `leading`, and the book agrees: bid 0.99, ask 0.992, so it is also `event_favorite_bracket`. The event's implied values sum to 1.0105, inside the 0.8–1.25 band, so they are normalized (0.991 becomes 0.980703).

```json
{
  "record_type": "market", "platform": "polymarket",
  "city": "NYC", "city_key": "nyc", "metric": "high", "event_date": "2026-09-24",
  "bracket_label": "68-69°F", "bracket_kind": "range",
  "bracket_low": 68.0, "bracket_high": 69.0, "bracket_high_exclusive": 70.0, "unit": "F",
  "status": "open", "accepting_orders": true,
  "yes_bid": 0.99, "yes_ask": 0.992, "bid_size": 10.0, "ask_size": 208.39,
  "mid": 0.991, "spread": 0.002, "last_trade_price": 0.98, "yes_price": 0.985,
  "implied_probability": 0.991, "implied_probability_normalized": 0.980703,
  "price_flag": "ok", "price_source": "clob_orderbook", "price_as_of": "2026-09-24T21:04:01Z",
  "result": null, "winning_bracket_label": null, "settled_value_low": null, "settled_value_high_exclusive": null,
  "obs_extreme": 68, "obs_extreme_time": "2026-09-24T19:51:00Z", "obs_count": 21,
  "obs_last_time": "2026-09-24T20:51:00Z", "proxy_bracket_status": "leading",
  "proxy_note": "METAR proxy from aviationweather.gov, not the official settlement value",
  "local_day_over": false, "timezone": "America/New_York",
  "station_id": "KLGA", "station_icao": "KLGA", "station_name": "LaGuardia Airport Station",
  "settlement_agency": "NOAA", "settlement_source_url": "https://www.weather.gov/wrh/timeseries?site=klga",
  "settlement_precision": 1, "settles_on_hourly_obs_only": true, "fallback_source": "Wunderground",
  "volume_usd": 9388.96, "volume_24h_usd": 5953.49, "liquidity_usd": 440.58,
  "event_volume_usd": 50281.73, "event_volume_24h_usd": 36726.56, "event_liquidity_usd": 67370.16,
  "event_open_interest_usd": 20866.33, "event_price_sum": 1.0045, "event_implied_sum": 1.0105,
  "event_favorite_bracket": "68-69°F",
  "tick_size": 0.001, "min_order_size": 5.0, "taker_fee_rate": 0.05, "bracket_index": 6,
  "end_date": "2026-09-24T12:00:00Z", "closed_time": null, "uma_resolution_status": null,
  "event_id": "1062921", "event_slug": "highest-temperature-in-nyc-on-september-24-2026",
  "event_title": "Highest temperature in NYC on September 24?",
  "market_id": "4834071", "market_slug": "highest-temperature-in-nyc-on-september-24-2026-68-69f",
  "question": "Will the highest temperature in New York City be between 68-69°F on September 24?",
  "condition_id": "0x7f415d40308196b3249e80e624753e1c64813c0810a5f1a2d1385f2f527d979b",
  "yes_token_id": "44328198862325790762178720785097949971157428241633354692885220915372009707360",
  "no_token_id": "64933037534463726121263305277451737728012588069625629357647321937985468868801",
  "neg_risk_market_id": "0x9ff4391a0a8fd7bd1d96480f1091f7882b3a9cffe1571323640268511a621900",
  "series_slug": "nyc-daily-weather",
  "event_url": "https://polymarket.com/event/highest-temperature-in-nyc-on-september-24-2026",
  "market_url": "https://polymarket.com/event/highest-temperature-in-nyc-on-september-24-2026/highest-temperature-in-nyc-on-september-24-2026-68-69f",
  "scraped_at": "2026-09-24T21:04:04Z"
}
```

The matching station row from the same run:

```json
{
  "record_type": "station_observation", "station_id": "KLGA", "station_icao": "KLGA",
  "city": "NYC", "event_date": "2026-09-24", "timezone": "America/New_York", "unit": "F",
  "running_high": 68, "running_low": 54, "running_high_c": 20.0, "running_low_c": 12.2,
  "running_high_time": "2026-09-24T19:51:00Z", "running_low_time": "2026-09-24T07:43:00Z",
  "obs_count": 21, "first_obs_time": "2026-09-24T04:51:00Z", "last_obs_time": "2026-09-24T20:51:00Z",
  "local_day_over": false,
  "last_raw_metar": "METAR KLGA 242051Z 04013G27KT 10SM FEW040 SCT170 BKN250 20/06 A3029 RMK AO2 PK WND 06027/2048 SLP257 T02000061 56024",
  "source": "aviationweather.gov METAR",
  "proxy_note": "METAR proxy from aviationweather.gov, not the official settlement value",
  "scraped_at": "2026-09-24T21:04:04Z"
}
```

A thin market from the same run shows why `implied_probability` is sometimes `null`. This is the NYC low on Sep 26, two days out:

| `bracket_label` | `yes_bid` | `yes_ask` | `yes_price` (Polymarket's display) | `implied_probability` |
|---|---|---|---|---|
| `53°F or below` | `null` | 0.45 | 0.245 | `null` (no bid, no trade) |
| `58-59°F` | 0.27 | 0.40 | 0.315 | 0.36 (last YES trade) |
| `60-61°F` | 0.21 | 0.25 | 0.23 | 0.23 (mid) |
| `62-63°F` | 0.05 | 0.21 | 0.16 | 0.05 (bid: wide book, no trade) |
| `72°F or higher` | `null` | 0.46 | 0.275 | `null` (no bid, no trade) |

Polymarket's displayed prices for that event sum to 1.715 (`event_price_sum`). The implied values sum to 1.05 (`event_implied_sum`). The favourite is `58-59°F`, not one of the two unbid tails.

### Pricing

Pay per event. You pay only for rows you actually receive.

| Event | Price | When |
|---|---|---|
| `actor-start` | $0.005 | once per run, only when at least one charged row is returned. If your maximum cost per run cannot cover the start plus one row, nothing is charged. |
| `market-record` | $0.001 | per bracket row |
| `station-observation` | $0.002 | per station-day METAR running high/low row |
| notice rows | free | unknown city, no events, limits reached, partial results |

Typical bills, measured on 2026-09-24:

| Run | Rows | Cost |
|---|---|---|
| Default (NYC, live, high and low, with proxy) | 66 brackets + 1 station row | ≈ $0.073 |
| All cities, live, with proxy | ≈ 2,800–3,200 brackets + ≈ 50–56 station rows | ≈ $2.90–3.32 |
| All cities, settled, last 7 days | ≈ 8,200 brackets (raise `maxRecords`) | ≈ $8.20 |
| One city, settled, last 7 days | 154 brackets | ≈ $0.16 |

Use `maxRecords` and the run's maximum cost setting to cap spend. When a limit is hit, the run stops cleanly with what it has, plus a free notice. Bracket rows are bought first, so a tight budget never pays for a station row whose brackets it could not deliver.

### How settlement works (FAQ)

**What exactly decides the winning bracket?**
The official value is the day's highest (or lowest) reading at the station named in each market's rules. For 48 cities that is NOAA's `weather.gov/wrh/timeseries?site=<ICAO>` page, and US °F cities use the "Show Hourly Data" readings only. If NOAA has no data by 11:59 PM ET the next day, the Weather Underground daily observations table is used. With no data at all, the market resolves to the lowest bracket. Every row carries `settlement_agency`, `settlement_source_url`, `settles_on_hourly_obs_only` and `fallback_source`, parsed from that market's own rules. Nothing is hard-coded per city.

**Why is Hong Kong different?**
Hong Kong settles on the Hong Kong Observatory's "Absolute Daily Max/Min" at 0.1 °C, and whole-degree labels truncate, so 32.9 °C is "32°C". Use `bracket_low ≤ value < bracket_high_exclusive` and it works for every city. HKO has no METAR station, so Hong Kong rows have no proxy.

**How good is the METAR proxy?**
It takes the max (or min) of every METAR and SPECI report at the settlement station in the station-local calendar day, from aviationweather.gov. US °F values are converted as `floor(°C × 1.8 + 32 + 0.5)`, the value NOAA displays. On 194 settled events on Sep 22–23 it fell in the winning bracket 194 times. Using every report is deliberate. NOAA's page for US °F cities lists hourly readings only, but on the 184 settled events of Sep 22–24 still inside the 72-hour window, all reports matched the winner 184 times and routine hourly METARs alone 183 times. The miss was Panama City's Sep 23 high, where a SPECI reading of 33 °C won. It is still a proxy: NOAA revisions or missing reports can differ. Every row says `METAR proxy … not the official settlement value`. The proxy is computed only for unresolved markets whose local day has started, within aviationweather.gov's 72-hour window. It is not available for Hong Kong (no ICAO) or Jinan (no METAR feed).

**What does `dead` mean?**
For a **high** market the running max can only go up, so any bracket entirely below it can no longer win. For a **low** market the running min can only go down, so any bracket entirely above it is dead. `leading` means the bracket contains the running extreme right now. Once the local day is over, rows show `final_proxy_win` or `final_proxy_loss` until Polymarket resolves them, usually within hours.

**How fresh are prices?**
With `liveOrderBook` on (the default), bid/ask/sizes come from Polymarket's live CLOB order book at run time (`price_source = clob_orderbook`), and `last_trade_price` from the CLOB's last YES-side trade. (The order book's own "last trade" field is the market's last fill on *either* outcome, so a NO fill at 0.99 would show up as 0.99; it is not used.) The catalog's own prices can be up to 5 minutes old (Cloudflare cache) and are used only as a fallback (`gamma_cached`).

**How far back does history go?**
Polymarket's daily temperature markets go back to at least January 2026. The daily-temperature tag was applied inconsistently before March 2026. Named cities are fetched through their series and are not affected; all-city runs before March get a free `partial_history` notice. Some early events have 7 brackets instead of 11.

**Which cities?**
All 51 cities as of September 2026: NYC, Chicago, Denver, Dallas, Atlanta, Miami, Austin, Houston, Seattle, Los Angeles, San Francisco, Toronto, Mexico City, Panama City, Sao Paulo, Buenos Aires, London, Paris, Amsterdam, Munich, Milan, Madrid, Warsaw, Helsinki, Moscow, Ankara, Istanbul, Tel Aviv, Jeddah, Karachi, Lucknow, Cape Town, Singapore, Kuala Lumpur, Manila, Beijing, Shanghai, Qingdao, Jinan, Zhengzhou, Wuhan, Chengdu, Chongqing, Guangzhou, Shenzhen, Hong Kong, Taipei, Seoul (Incheon), Busan, Tokyo, Wellington. The list is read live, so new cities work without an update.

**Is this official?**
No. This is an **unofficial tool, not affiliated with or endorsed by Polymarket**. It reads Polymarket's documented public market-data API (no scraping of polymarket.com, no personal or wallet data). You are responsible for complying with Polymarket's Terms of Use, which restrict use of Polymarket data by capital-markets firms and market-data distributors without Polymarket's written consent. Weather data comes from aviationweather.gov (US public domain). Nothing here is investment advice.

### For AI agents (Apify MCP server)

This actor is built to be called by agents.

- **Inputs are forgiving.** City names in any case, accent or spacing, aliases, station ids, unknown cities, a `"city"` key instead of `"cities"` and `"date": "tomorrow"` all work. Unknown values become warnings or a free `notice` row, never a failed run. The platform checks field types and allowed values before the run starts, so `cities` must be a list and `metric` / `mode` must use the listed lower-case values.
- **Rows are flat, typed and self-describing.** There are no nested objects and no long rules text. `record_type` tells rows apart, and `proxy_note` explains every empty proxy field. A `null` price field means "no real quote", never zero.
- **Incomplete data is flagged in the dataset.** If Polymarket's API fails partway, you still get the rows fetched so far plus a free `partial_results` notice. A run that could fetch nothing ends with a free `upstream_unavailable` (or `upstream_format_changed`) notice instead of an empty dataset.
- **Small by default.** Ask for one or two cities; `"all"` returns about 3,000 rows.
- Useful questions it answers: *"Which NYC high brackets are already dead today?"* (`proxy_bracket_status = dead`), *"What's the market-implied distribution for London's low tomorrow?"* (`implied_probability_normalized`; `null` when the book is too thin to say, so check `event_implied_sum`), *"Which bracket won Tokyo's high on Sep 20?"* (`mode: settled`, `winning_bracket_label`).

### Related actors

- [Kalshi Weather Markets Data — KXHIGH & KXLOW](https://apify.com/bigdavidson/kalshi-weather-markets) covers the same kind of daily temperature markets on Kalshi, with official settled temperatures. Watch the station differences above.
- [METAR & NWS Weather Station Observations API](https://apify.com/bigdavidson/metar-nws-weather-station-observations) gives raw and decoded METAR history for any station, including deep US history.

# Actor input Schema

## `cities` (type: `array`):

City names as Polymarket titles them (NYC, London, Seoul, Hong Kong, Tokyo, ...), common aliases (New York, LA, SF, HK, KL, CDMX), settlement station ids (KLGA, EGLC) or series slugs. Case, accents and extra spaces are ignored. Use "all" for every city (51 as of Sep 2026, about 2,800-3,200 live brackets, about $2.90-3.30 per run). Unknown names are skipped with a free notice row listing valid cities. Default: NYC.

## `metric` (type: `string`):

high = 'Highest temperature in <city> on <date>?' markets, low = 'Lowest temperature ...' markets, both = both.

## `mode` (type: `string`):

live = markets still open (usually today plus 1-2 days ahead) with the live order book. settled = closed markets with the winning bracket, for the lookback window or dateFrom/dateTo (about 1,100 brackets per day for all cities). both = live then settled.

## `lookbackDays` (type: `integer`):

Settled/both mode only, when dateFrom/dateTo are empty: how many days back from today to pull closed markets. 1-120 (out-of-range values are clamped). Cost hint: all cities = about 1,100 brackets (~$1.10) per day; one city = about 22 brackets per day.

## `dateFrom` (type: `string`):

Earliest event date (station-local calendar day). YYYY-MM-DD, today, tomorrow, yesterday or +/-Nd (e.g. -3d). Filters live and settled rows.

## `dateTo` (type: `string`):

Latest event date, same formats as dateFrom. Set dateFrom = dateTo for a single day.

## `includeObservation` (type: `boolean`):

For unresolved markets whose local day has started, fetch METAR observations at the exact settlement station and add the running high/low plus a per-bracket status (dead / leading / alive / final\_proxy\_win / final\_proxy\_loss). Also adds one station\_observation row per station-day ($0.002 each). Proxy only, not the official value. Not available for Hong Kong (HKO) or Jinan.

## `liveOrderBook` (type: `boolean`):

Read best bid/ask, sizes and last trade from Polymarket's live CLOB order book (a few extra fast requests). Off = Gamma catalog prices, which can be up to 5 minutes old.

## `maxRecords` (type: `integer`):

Upper limit on charged market rows per run (1-100000, default 5000; 0 = no cap, i.e. 100000). Free notice rows do not count. Use it to cap cost: $0.001 per row.

## Actor input object example

```json
{
  "cities": [
    "NYC"
  ],
  "metric": "both",
  "mode": "live",
  "lookbackDays": 7,
  "includeObservation": true,
  "liveOrderBook": true,
  "maxRecords": 5000
}
```

# Actor output Schema

## `results` (type: `string`):

Every dataset row (market brackets, station observations and free notices).

## `overview` (type: `string`):

No description

## `settled` (type: `string`):

No description

## `stations` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "cities": [
        "NYC"
    ],
    "metric": "both",
    "mode": "live",
    "lookbackDays": 7,
    "maxRecords": 5000
};

// Run the Actor and wait for it to finish
const run = await client.actor("bigdavidson/polymarket-weather-markets").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "cities": ["NYC"],
    "metric": "both",
    "mode": "live",
    "lookbackDays": 7,
    "maxRecords": 5000,
}

# Run the Actor and wait for it to finish
run = client.actor("bigdavidson/polymarket-weather-markets").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "cities": [
    "NYC"
  ],
  "metric": "both",
  "mode": "live",
  "lookbackDays": 7,
  "maxRecords": 5000
}' |
apify call bigdavidson/polymarket-weather-markets --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bigdavidson/polymarket-weather-markets"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Ub1TYdFW9CPC7jICf/builds/UWZYLxmUT9ePJTFhL/openapi.json
