> Documentation index: https://pmdata.dev/llms.txt. Full docs in one file: https://pmdata.dev/llms-full.txt

# Polymarket

Source: https://pmdata.dev/docs/historical-data-details/polymarket

> Polymarket historical data coverage, downloads, and collection details.

UpDown markets are available since **2026-02-01**.
All Polymarket markets are available since **2026-05-01**.

## Available data

| Data type | Contents | Sample |
| --- | --- | --- |
| `l2` | Incremental L2 order book data from the Polymarket WebSocket. | |
| `trades` | Trades from the Polymarket WebSocket. | |
| `onchain_fills` | On-chain trades from Polygon. | |

See [Data Schemas](https://pmdata.dev/docs/schemas/overview) for column definitions, and the [markets catalog](https://pmdata.dev/docs/schemas/markets-catalog) for which markets and dates are available.

## API access and data format

Send your API key in the `api_key` request header. Get a free key at [pmdata.dev/app](https://pmdata.dev/app).

New data is **published daily**: each UTC day's data is available by **04:00 UTC** the next day.

WebSocket files include the source timestamp and a PMData receive timestamp, both stored at microsecond precision.

### Market API

Download one market's Parquet file for one data type and UTC date:

`https://api.pmdata.dev/v1/polymarket/{data_type}/{YYYY}/{MM}/{DD}/{market_slug}.parquet`

```python

market_slug = "will-jd-vance-win-the-2028-us-presidential-election"
date = "2026/08/08"  # UTC date, YYYY/MM/DD
data_type = "l2"  # l2, trades, onchain_fills

url = (
    f"https://api.pmdata.dev/v1/polymarket/{data_type}/"
    f"{date}/{market_slug}.parquet"
)
# no_l2_url = f"{url}?outcome=No"

df = pd.read_parquet(
    url,
    storage_options={
        "api_key": "<YOUR_API_KEY>",
        "User-Agent": "Mozilla/5.0",
    },
)
print(df.head())
```

Find a market's `market_slug` and the dates PMData has recorded in the [markets catalog](https://pmdata.dev/docs/schemas/markets-catalog).

For `l2`, add `?outcome=No` to download the No-token order book. The default is Yes.

### Day ZIP API (**-75% cost**)

Download one UpDown asset/timeframe series for one UTC day as a ZIP of Parquet files:

`asset`: `btc`, `eth`, `sol`, `xrp`, `bnb`, `hype`, `doge`.

`https://api.pmdata.dev/v1/polymarket/{data_type}/{YYYY}/{MM}/{DD}/{asset}-{5m|15m|1h}.zip`

For `l2`, add `?outcome=No` to download the No-token order books. The default is Yes.

Use `l2`, `trades`, or `onchain_fills` as the data type. For example:

```python

series = "btc-5m"  # btc-15m, btc-1h, eth-5m, ...
data_type = "l2"  # trades, onchain_fills
date = "2026/08/08"

url = f"https://api.pmdata.dev/v1/polymarket/{data_type}/{date}/{series}.zip"
# no_l2_url = f"{url}?outcome=No"

response = requests.get(url, headers={"api_key": "<YOUR_API_KEY>"})
response.raise_for_status()
with open(f"{series}.zip", "wb") as f:
    f.write(response.content)
```

| Timeframe | Day ZIP API | Market API | Day ZIP API saving |
| --- | --- | --- | --- |
| 5m | 72 quota / day | 288 quota / day | 75% |
| 15m | 24 quota / day | 96 quota / day | 75% |
| 1h | 6 quota / day | 24 quota / day | 75% |

## Captured real-time channels

PMData's downloadable files currently include these events from Polymarket's market WebSocket:

- `book` — Complete order book snapshots sent on subscription and after trades that change the book. An initial subscription message can contain book objects for multiple outcome tokens. Stored in `l2`.
- `price_change` — Price-level updates caused by new or cancelled orders. One message can contain updates for multiple outcome tokens in `price_changes[]`. Stored in `l2`.
- `last_trade_price` — Trade execution updates. Stored in `trades`.
- `tick_size_change` — Changes to a market's minimum tick size. This is a market-level event. Stored in `l2`.
- `market_resolved` — Market resolution events containing the winning outcome. This is a market-level event. Stored in `l2`.

## Market data collection details

PMData's market data collection infrastructure for Polymarket is located in AWS `eu-west-2` (London, Availability Zone 2).

Polymarket's exchange infrastructure is located in AWS `eu-west-2` (London, Europe). CLOB market data is captured through WebSocket connections to **`wss://ws-subscriptions-clob.polymarket.com/ws/market`**.
