Skip to main content

Overview

This guide walks you through finding an event, exploring its markets, and fetching historical orderbook data.
1

Search for an Event

Find events related to a topic you’re interested in.
curl "https://poly-data.xyz/events/search?q=election&limit=5"
Response:
{
  "q": "election",
  "filters": { "active": null, "closed": null, "archived": null },
  "limit": 5,
  "count": 5,
  "next": { "cursor_end_date": 1735689600000, "cursor_id": 12345 },
  "data": [
    {
      "id": 101,
      "title": "2024 Presidential Election",
      "slug": "2024-presidential-election",
      "volume": 15000000,
      "market_ids": ["5001", "5002", "5003"],
      "market_count": 3
    }
  ]
}
2

Get Markets for the Event

Fetch all markets associated with an event.
curl "https://poly-data.xyz/events/101/markets"
Response:
{
  "event_id": "101",
  "limit": 100,
  "data": [
    {
      "id": 5001,
      "event_id": 101,
      "question": "Will candidate A win?",
      "volume_24h": 250000,
      "liquidity": 500000,
      "active": true,
      "closed": false
    }
  ],
  "next": null
}
3

Get Market Details with Token IDs

Fetch a specific market to see its outcomes and token IDs.
curl "https://poly-data.xyz/markets/5001"
Response:
{
  "id": 5001,
  "event_id": 101,
  "question": "Will candidate A win?",
  "outcomes": [
    { "id": 1, "outcome_index": 0, "outcome": "Yes", "token_id": "abc123..." },
    { "id": 2, "outcome_index": 1, "outcome": "No", "token_id": "def456..." }
  ]
}
4

Fetch Historical Orderbook Data

Get orderbook snapshots for a market within a time range.
curl "https://poly-data.xyz/orderbooks?market_id=5001&from=1705900000000&to=1706000000000&limit=100"
Response:
{
  "data": [
    {
      "ts": 1705950000000,
      "asset_id": "abc123...",
      "market_id": "5001",
      "outcome_index": 0,
      "bids": [[0.55, 1000], [0.54, 2500], [0.53, 5000]],
      "asks": [[0.56, 800], [0.57, 1500], [0.58, 3000]]
    }
  ],
  "next": { "cursor_ts": 1705949000000 }
}

What’s Next?