> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poly-data.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get your first API response in under 2 minutes

## Overview

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

<Steps>
  <Step title="Search for an Event">
    Find events related to a topic you're interested in.

    ```bash theme={null}
    curl "http://api.poly-data.xyz/events/search?q=bundesliga&limit=3"
    ```

    Response:

    ```json theme={null}
    {
      "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
        }
      ]
    }
    ```

    <Note>
      The search endpoint uses PostgreSQL full-text search, so queries like `"bundesliga"`, `"bitcoin"`, or `"election"` work well.
    </Note>
  </Step>

  <Step title="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.

    ```bash theme={null}
    curl "http://api.poly-data.xyz/events/126261/markets"
    ```

    Response:

    ```json theme={null}
    {
      "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
    }
    ```
  </Step>

  <Step title="Get Market Details with Token IDs">
    Fetch a specific market to see its outcomes and the token IDs you'll need for orderbook queries.

    ```bash theme={null}
    curl "http://api.poly-data.xyz/markets/1034460"
    ```

    Response:

    ```json theme={null}
    {
      "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"
        }
      ]
    }
    ```
  </Step>

  <Step title="Fetch Historical Orderbook Data">
    Get orderbook snapshots for the market. Use the market ID directly with the convenience endpoint.

    ```bash theme={null}
    curl "http://api.poly-data.xyz/orderbooks/1034460?limit=5"
    ```

    Response:

    ```json theme={null}
    {
      "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.
  </Step>
</Steps>

## What's Next?

<Columns cols={2}>
  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    Explore the complete API documentation.
  </Card>

  <Card title="Orderbooks Deep Dive" icon="chart-bar" href="/api-reference/orderbooks">
    Learn about orderbook data structure, filtering, and pagination patterns.
  </Card>
</Columns>
