> For the complete documentation index, see [llms.txt](https://docs.tardis.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tardis.dev/historical-data-details/polymarket.md).

# Polymarket

Polymarket historical data is available since **2026-05-25**.

{% embed url="<https://api.tardis.dev/v1/exchanges/polymarket>" %}
See Polymarket historical data coverage: available symbols, channels, date ranges and incidents
{% endembed %}

### Downloadable **CSV** files

Historical CSV datasets for the first day of each month are **available to download without API key**. See [downloadable CSV files documentation](/downloadable-csv-files/overview.md).

Polymarket CSV exports use CLOB token IDs as per-symbol file names. The grouped daily trades file uses the `PREDICTIONS` symbol.

| data type             | symbol                                                                        | date       |                                                                                                                                                                                  |
| --------------------- | ----------------------------------------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| trades                | PREDICTIONS                                                                   | 2026-06-01 | [Download sample](https://datasets.tardis.dev/v1/polymarket/trades/2026/06/01/PREDICTIONS.csv.gz)                                                                                |
| trades                | 57661695455036831478287776153129850803351574978201924270494418960712051882696 | 2026-06-01 | [Download sample](https://datasets.tardis.dev/v1/polymarket/trades/2026/06/01/57661695455036831478287776153129850803351574978201924270494418960712051882696.csv.gz)              |
| book\_ticker          | 97903420938606091954598995247916642127489952123621529862160273048309855576367 | 2026-06-01 | [Download sample](https://datasets.tardis.dev/v1/polymarket/book_ticker/2026/06/01/97903420938606091954598995247916642127489952123621529862160273048309855576367.csv.gz)         |
| incremental\_book\_L2 | 27240772368842340548393958038359200077022257197570320676979474039971830802302 | 2026-06-01 | [Download sample](https://datasets.tardis.dev/v1/polymarket/incremental_book_L2/2026/06/01/27240772368842340548393958038359200077022257197570320676979474039971830802302.csv.gz) |
| quotes                | 27240772368842340548393958038359200077022257197570320676979474039971830802302 | 2026-06-01 | [Download sample](https://datasets.tardis.dev/v1/polymarket/quotes/2026/06/01/27240772368842340548393958038359200077022257197570320676979474039971830802302.csv.gz)              |
| book\_snapshot\_5     | 27240772368842340548393958038359200077022257197570320676979474039971830802302 | 2026-06-01 | [Download sample](https://datasets.tardis.dev/v1/polymarket/book_snapshot_5/2026/06/01/27240772368842340548393958038359200077022257197570320676979474039971830802302.csv.gz)     |
| book\_snapshot\_25    | 27240772368842340548393958038359200077022257197570320676979474039971830802302 | 2026-06-01 | [Download sample](https://datasets.tardis.dev/v1/polymarket/book_snapshot_25/2026/06/01/27240772368842340548393958038359200077022257197570320676979474039971830802302.csv.gz)    |

### API Access and data format

Historical data format is the same as provided by real-time Polymarket WebSocket APIs with addition of local timestamps. Polymarket symbols in Tardis.dev APIs are CLOB token IDs, not event slugs or market questions. In Polymarket market channel messages this identifier appears as `asset_id`.

Symbol filters apply to per-token market data such as `book`, `price_change`, `last_trade_price`, and `best_bid_ask`. Market-level channels such as `tick_size_change`, `new_market`, `market_resolved`, and `sport_result` do not require symbols.

If you'd like to work with **normalized data format** instead (same format for each exchange) see [downloadable CSV files](/downloadable-csv-files/overview.md) or official [client libs](/api/quickstart.md) that can perform data normalization client-side.

{% tabs %}
{% tab title="Python" %}

```python
# pip install tardis-dev
import asyncio
from tardis_dev import Channel, replay

symbols = [
    "27240772368842340548393958038359200077022257197570320676979474039971830802302",
    "33657678411548069412646838419011738363351964246263910293068444617014480555282",
]

async def main():
    async for local_timestamp, message in replay(
        exchange="polymarket",
        from_date="2026-06-01",
        to_date="2026-06-02",
        filters=[
            Channel(name="price_change", symbols=symbols),
            Channel(name="book", symbols=symbols),
        ],
        api_key="YOUR_API_KEY",
    ):
        # messages as provided by Polymarket real-time stream
        print(local_timestamp, message)

asyncio.run(main())
```

See [Python client docs](/python-client/quickstart.md).
{% endtab %}

{% tab title="Node.js" %}

```javascript
// npm install tardis-dev
import { replay } from 'tardis-dev';

const symbols = [
  '27240772368842340548393958038359200077022257197570320676979474039971830802302',
  '33657678411548069412646838419011738363351964246263910293068444617014480555282'
];

const messages = replay({
  exchange: 'polymarket',
  from: '2026-06-01',
  to: '2026-06-02',
  filters: [
    { channel: 'price_change', symbols },
    { channel: 'book', symbols }
  ],
  apiKey: 'YOUR_API_KEY'
});

// messages as provided by Polymarket real-time stream
for await (const { localTimestamp, message } of messages) {
  console.log(localTimestamp, message);
}
```

See [Node.js client docs](/node-client/quickstart.md).
{% endtab %}

{% tab title="cURL & HTTP API" %}

```bash
filters='[
  {"channel":"price_change","symbols":[
    "27240772368842340548393958038359200077022257197570320676979474039971830802302",
    "33657678411548069412646838419011738363351964246263910293068444617014480555282"
  ]},
  {"channel":"book","symbols":[
    "27240772368842340548393958038359200077022257197570320676979474039971830802302",
    "33657678411548069412646838419011738363351964246263910293068444617014480555282"
  ]}
]'

curl --compressed --get 'https://api.tardis.dev/v1/data-feeds/polymarket' \
  --data-urlencode 'from=2026-06-01' \
  --data-urlencode "filters=${filters}" \
  --data-urlencode 'offset=0'
```

{% embed url="<https://api.tardis.dev/v1/data-feeds/polymarket?from=2026-06-01&filters=%5B%7B%22channel%22%3A%22price_change%22%2C%22symbols%22%3A%5B%2227240772368842340548393958038359200077022257197570320676979474039971830802302%22%2C%2233657678411548069412646838419011738363351964246263910293068444617014480555282%22%5D%7D%2C%7B%22channel%22%3A%22book%22%2C%22symbols%22%3A%5B%2227240772368842340548393958038359200077022257197570320676979474039971830802302%22%2C%2233657678411548069412646838419011738363351964246263910293068444617014480555282%22%5D%7D%5D&offset=0>" %}
Example API response for Polymarket historical market data request
{% endembed %}

See [HTTP API docs](/api/http-api-reference.md).
{% endtab %}

{% tab title="cURL & tardis-machine" %}

```bash
options='{
  "exchange":"polymarket",
  "filters":[
    {"channel":"price_change","symbols":[
      "27240772368842340548393958038359200077022257197570320676979474039971830802302",
      "33657678411548069412646838419011738363351964246263910293068444617014480555282"
    ]},
    {"channel":"book","symbols":[
      "27240772368842340548393958038359200077022257197570320676979474039971830802302",
      "33657678411548069412646838419011738363351964246263910293068444617014480555282"
    ]}
  ],
  "from":"2026-06-01",
  "to":"2026-06-02"
}'

curl --get 'http://localhost:8000/replay' \
  --data-urlencode "options=${options}"
```

[Tardis-machine](/tardis-machine/quickstart.md) is a locally runnable server that exposes API allowing efficiently requesting historical market data for whole time periods in contrast to [HTTP API](/api/http-api-reference.md) that provides data only in minute by minute slices.

See [tardis-machine](/tardis-machine/quickstart.md) docs.
{% endtab %}
{% endtabs %}

### Finding Polymarket symbols

Polymarket users usually start from an event, category, tag, slug, or market question. Tardis.dev replay filters need the matching CLOB token IDs. Polymarket's Gamma API exposes those token IDs in each market's `clobTokenIds` array; the indexes match the market's `outcomes` array. Binary markets usually have two token IDs, one for each outcome.

The examples below find event markets through the Gamma API, print several candidates with their outcome-to-symbol mapping, and replay raw Tardis.dev messages for both outcome tokens of the selected market.

{% tabs %}
{% tab title="Python" %}

```python
# pip install tardis-dev
import asyncio
import json
from urllib.parse import urlencode
from urllib.request import urlopen

from tardis_dev import Channel, replay

params = urlencode({
    "tag_slug": "crypto",
    "order": "volume24hr",
    "ascending": "false",
    "limit": "20",
})

with urlopen(f"https://gamma-api.polymarket.com/events?{params}") as response:
    events = json.load(response)

candidates = []
for event in events:
    for market in event.get("markets", []):
        if market.get("enableOrderBook") and market.get("clobTokenIds"):
            outcomes = json.loads(market.get("outcomes") or "[]")
            symbols = json.loads(market["clobTokenIds"])
            candidates.append({
                "event": event["title"],
                "question": market["question"],
                "outcomes": list(zip(outcomes, symbols)),
            })

for candidate in candidates[:5]:
    print(candidate)

if not candidates:
    raise RuntimeError("No Polymarket CLOB markets matched these query parameters.")

symbols = [symbol for _, symbol in candidates[0]["outcomes"]]

async def main():
    async for local_timestamp, message in replay(
        exchange="polymarket",
        from_date="2026-06-01",
        to_date="2026-06-02",
        filters=[
            Channel(name="price_change", symbols=symbols),
            Channel(name="book", symbols=symbols),
        ],
        api_key="YOUR_API_KEY",
    ):
        print(local_timestamp, message)

asyncio.run(main())
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
// npm install tardis-dev
import { replay } from 'tardis-dev';

const params = new URLSearchParams({
  tag_slug: 'crypto',
  order: 'volume24hr',
  ascending: 'false',
  limit: '20'
});

const gammaUrl = `https://gamma-api.polymarket.com/events?${params}`;
const events = await fetch(gammaUrl).then((response) => response.json());
const candidates = events
  .flatMap((event) =>
    (event.markets ?? []).map((market) => ({
      event: event.title,
      market
    }))
  )
  .filter(({ market }) => market.enableOrderBook && market.clobTokenIds)
  .slice(0, 5)
  .map(({ event, market }) => {
    const outcomes = JSON.parse(market.outcomes ?? '[]');
    const symbols = JSON.parse(market.clobTokenIds);

    return {
      event,
      question: market.question,
      outcomes: outcomes.map((outcome, index) => ({ outcome, symbol: symbols[index] }))
    };
  });

console.dir(candidates, { depth: null });

if (candidates.length === 0) {
  throw new Error('No Polymarket CLOB markets matched these query parameters.');
}

const symbols = candidates[0].outcomes.map(({ symbol }) => symbol);
const messages = replay({
  exchange: 'polymarket',
  from: '2026-06-01',
  to: '2026-06-02',
  filters: [
    { channel: 'price_change', symbols },
    { channel: 'book', symbols }
  ],
  apiKey: 'YOUR_API_KEY'
});

for await (const { localTimestamp, message } of messages) {
  console.log(localTimestamp, message);
}
```

{% endtab %}
{% endtabs %}

### Captured real-time channels

{% embed url="<https://docs.polymarket.com/market-data/websocket/market-channel>" %}
See Polymarket market WebSocket API docs providing documentation for captured CLOB market channel message format
{% endembed %}

{% hint style="info" %}
Click any channel below to see [HTTP API](/api/http-api-reference.md#data-feeds-exchange) response with historical data recorded for it.
{% endhint %}

* [book](https://api.tardis.dev/v1/data-feeds/polymarket?from=2026-06-01\&filters=%5B%7B%22channel%22%3A%22book%22%2C%22symbols%22%3A%5B%2227240772368842340548393958038359200077022257197570320676979474039971830802302%22%2C%2233657678411548069412646838419011738363351964246263910293068444617014480555282%22%5D%7D%5D\&offset=0) Full order book snapshots on subscription and after trades that affect the book. Initial subscription data can include several book objects in one message.
* [price\_change](https://api.tardis.dev/v1/data-feeds/polymarket?from=2026-06-01\&filters=%5B%7B%22channel%22%3A%22price_change%22%2C%22symbols%22%3A%5B%2227240772368842340548393958038359200077022257197570320676979474039971830802302%22%2C%2233657678411548069412646838419011738363351964246263910293068444617014480555282%22%5D%7D%5D\&offset=0) Price level updates from new or cancelled orders. A single message can include updates for multiple outcome tokens in `price_changes[]`.
* [last\_trade\_price](https://api.tardis.dev/v1/data-feeds/polymarket?from=2026-06-01\&filters=%5B%7B%22channel%22%3A%22last_trade_price%22%2C%22symbols%22%3A%5B%2257661695455036831478287776153129850803351574978201924270494418960712051882696%22%5D%7D%5D\&offset=0) Trade execution updates
* [best\_bid\_ask](https://api.tardis.dev/v1/data-feeds/polymarket?from=2026-06-01\&filters=%5B%7B%22channel%22%3A%22best_bid_ask%22%2C%22symbols%22%3A%5B%2297903420938606091954598995247916642127489952123621529862160273048309855576367%22%2C%2225478893375766865676296946735029591994839079976867058408152132323725402792931%22%5D%7D%5D\&offset=0) Best bid and ask price updates
* [tick\_size\_change](https://api.tardis.dev/v1/data-feeds/polymarket?from=2026-06-01\&filters=%5B%7B%22channel%22%3A%22tick_size_change%22%7D%5D\&offset=1) Minimum tick size changes. This is a market-level event; symbol filters do not narrow results.
* [new\_market](https://api.tardis.dev/v1/data-feeds/polymarket?from=2026-06-01\&filters=%5B%7B%22channel%22%3A%22new_market%22%7D%5D\&offset=10) New market creation events with market metadata. This is a market-level event; symbol filters do not narrow results.
* [market\_resolved](https://api.tardis.dev/v1/data-feeds/polymarket?from=2026-06-01\&filters=%5B%7B%22channel%22%3A%22market_resolved%22%7D%5D\&offset=0) Market resolution events with winning outcome metadata. This is a market-level event; symbol filters do not narrow results.
* [sport\_result](https://api.tardis.dev/v1/data-feeds/polymarket?from=2026-06-01\&filters=%5B%7B%22channel%22%3A%22sport_result%22%7D%5D\&offset=0) Live sports scores, periods, and game status updates. This channel is collected from Polymarket's separate Sports WebSocket and is not symbol-filtered.

### Market data collection details

[Market data collection infrastructure](/faq/general.md#what-is-your-infrastructure-setup) for Polymarket is located in GCP europe-west2 (London, Europe).

Polymarket's exchange infrastructure is located in AWS eu-west-2 (London, Europe).

CLOB market data is captured via Cloudflare-proxied WebSocket connections to `wss://ws-subscriptions-clob.polymarket.com/ws/market`. Sports results are captured from Polymarket's separate Sports WebSocket at `wss://sports-api.polymarket.com/ws`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tardis.dev/historical-data-details/polymarket.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
