Skip to main content

Overview

This guide walks you through finding an event, exploring its markets, and fetching historical orderbook data — all using the REST API.
1

Search for an Event

Find events related to a topic you’re interested in.
curl "http://api.poly-data.xyz/events/search?q=bundesliga&limit=3"
Response:
{
  "q": "bundesliga",
  "filters": { "active": null, "closed": null, "archived": null },
  "limit": 3,
  "count": 3,
  "next": {
    "cursor_end_date": 1736517000000,
    "cursor_id": 127500
  },
  "data": [
    {
      "id": 126261,
      "title": "Eintracht Frankfurt vs. BV Borussia 09 Dortmund",
      "slug": "eintracht-frankfurt-vs-bv-borussia-09-dortmund",
      "volume": 1459190.209213,
      "active": true,
      "start_date": "2026-01-09T19:30:00.000Z",
      "end_date": "2026-01-09T19:30:00.000Z",
      "market_ids": ["1034460", "1034462", "1034464"],
      "market_count": 3
    }
  ]
}
The search endpoint uses PostgreSQL full-text search, so queries like "bundesliga", "bitcoin", or "election" work well.
2

Get Markets for the Event

Fetch all markets associated with an event using one of the market_ids from the search result, or list them directly.
curl "http://api.poly-data.xyz/events/126261/markets"
Response:
{
  "event_id": "126261",
  "limit": 100,
  "data": [
    {
      "id": 1034460,
      "event_id": 126261,
      "question": "Will Eintracht Frankfurt win on 2026-01-09?",
      "volume_24h": "225160.59",
      "liquidity": "438058.03",
      "active": true,
      "closed": false
    },
    {
      "id": 1034462,
      "event_id": 126261,
      "question": "Draw?",
      "volume_24h": "180000.00",
      "liquidity": "300000.00",
      "active": true,
      "closed": false
    }
  ],
  "next": null
}
3

Get Market Details with Token IDs

Fetch a specific market to see its outcomes and the token IDs you’ll need for orderbook queries.
curl "http://api.poly-data.xyz/markets/1034460"
Response:
{
  "id": "1034460",
  "event_id": "126261",
  "question": "Will Eintracht Frankfurt win on 2026-01-09?",
  "active": true,
  "accepting_orders": true,
  "volume_24h": "225160.59007300003",
  "volume_total": "231175.940446",
  "liquidity": "438058.02695",
  "outcomes": [
    {
      "id": 12771,
      "outcome_index": 0,
      "outcome": "Yes",
      "token_id": "113230976933674601135419276232321769865636781054804255103253100668166812267778"
    },
    {
      "id": 12772,
      "outcome_index": 1,
      "outcome": "No",
      "token_id": "114877335229422177970817804142795745566078153600519625559547182926779275233294"
    }
  ]
}
4

Fetch Historical Orderbook Data

Get orderbook snapshots for the market. Use the market ID directly with the convenience endpoint.
curl "http://api.poly-data.xyz/orderbooks/1034460?limit=5"
Response:
{
  "market_id": "1034460",
  "filters": { "outcome": null, "from": null, "to": null },
  "limit": 5,
  "count": 5,
  "next": { "cursor_ts": 1767990000000 },
  "data": [
    {
      "ts": 1768006613042,
      "asset_id": "113230976933674...",
      "market_id": "1034460",
      "outcome_index": 0,
      "bids": [[0.55, 1000], [0.54, 2500], [0.53, 5000]],
      "asks": [[0.56, 800], [0.57, 1500], [0.58, 3000]]
    }
  ]
}
Use cursor_ts from the next object to paginate through all available snapshots.

What’s Next?

API Reference

Explore the complete API documentation.

Orderbooks Deep Dive

Learn about orderbook data structure, filtering, and pagination patterns.