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

# Quickstart

> Get started with the Predexon Data API in under 5 minutes

<Note>
  **Which quickstart should I use?** New here? Start with [Get Started in 5 minutes](/start-here/get-started) for the unified onboarding. This page is the Data-API-focused quickstart. For trading, see [Trading API Quickstart](/trading-api/quickstart).
</Note>

## 1. Get Your API Key

Sign up for free at [dashboard.predexon.com](https://dashboard.predexon.com) - no credit card required.

## 2. Make Your First Request

<Steps>
  <Step title="Set up your environment">
    All API requests go to `https://api.predexon.com` with your API key in the `x-api-key` header.

    <CodeGroup>
      ```bash cURL theme={null}
      export PREDEXON_API_KEY="your_api_key"
      ```

      ```python Python theme={null}
      import requests

      BASE_URL = "https://api.predexon.com"
      API_KEY = "your_api_key"
      HEADERS = {"x-api-key": API_KEY}
      ```

      ```typescript TypeScript theme={null}
      const BASE_URL = "https://api.predexon.com";
      const HEADERS = { "x-api-key": "your_api_key" };
      ```
    </CodeGroup>
  </Step>

  <Step title="Fetch top markets">
    Get the highest-volume open markets on Polymarket:

    <CodeGroup>
      ```bash cURL theme={null}
      curl -H "x-api-key: $PREDEXON_API_KEY" \
        "https://api.predexon.com/v2/polymarket/markets?status=open&sort=volume&limit=5"
      ```

      ```python Python theme={null}
      response = requests.get(
          f"{BASE_URL}/v2/polymarket/markets",
          headers=HEADERS,
          params={"status": "open", "sort": "volume", "limit": 5}
      )

      for market in response.json()["markets"]:
          print(f"{market['title']}: ${market['total_volume_usd']:,.0f} volume")
      ```

      ```typescript TypeScript theme={null}
      const response = await fetch(
        `${BASE_URL}/v2/polymarket/markets?status=open&sort=volume&limit=5`,
        { headers: HEADERS }
      );

      const { markets } = await response.json();
      markets.forEach(m =>
        console.log(`${m.title}: $${m.total_volume_usd.toLocaleString()} volume`)
      );
      ```
    </CodeGroup>
  </Step>

  <Step title="Explore the response">
    ```json theme={null}
    {
      "markets": [
        {
          "condition_id": "0x1234...",
          "market_slug": "will-donald-trump-win-the-2024-us-presidential-election",
          "title": "Will Trump win the 2024 election?",
          "status": "open",
          "outcomes": [
            {"label": "Yes", "token_id": "123...", "price": 0.62},
            {"label": "No", "token_id": "456...", "price": 0.38}
          ],
          "total_volume_usd": 1500000000,
          "liquidity_usd": 25000000
        }
      ],
      "pagination": { "limit": 5, "offset": 0, "total": 1234, "has_more": true }
    }
    ```
  </Step>
</Steps>

***

## 3. Try More Endpoints

<Tabs>
  <Tab title="Price History">
    Fetch OHLCV candlestick data for charting:

    ```python theme={null}
    response = requests.get(
        f"{BASE_URL}/v2/polymarket/candlesticks/{condition_id}",
        headers=HEADERS,
        params={"interval": 60, "start_time": 1704067200, "end_time": 1704153600}
    )
    ```
  </Tab>

  <Tab title="Wallet Positions">
    Get all open positions for a wallet:

    ```python theme={null}
    response = requests.get(
        f"{BASE_URL}/v2/polymarket/wallet/positions/{wallet_address}",
        headers=HEADERS,
        params={"sort_by": "value", "limit": 50}
    )
    ```
  </Tab>

  <Tab title="Cross-Platform Matches">
    Find equivalent markets on Kalshi:

    ```python theme={null}
    response = requests.get(
        f"{BASE_URL}/v2/matching-markets",
        headers=HEADERS,
        params={"polymarket_market_slug": "will-trump-win-2024"}
    )
    ```
  </Tab>

  <Tab title="WebSocket">
    Stream live trades in real time:

    ```javascript theme={null}
    const ws = new WebSocket('wss://wss.predexon.com/v1/YOUR_API_KEY');

    ws.onopen = () => ws.send(JSON.stringify({
      action: 'subscribe',
      platform: 'polymarket',
      version: 1,
      type: 'orders',
      filters: { users: ['0x1234...'] }
    }));

    ws.onmessage = (e) => console.log(JSON.parse(e.data));
    ```
  </Tab>
</Tabs>

***

## Plans & Rate Limits

<Tip>
  **Most data is free.** Core market data, trades, orderbooks, and pricing endpoints are free and unlimited on all plans.
</Tip>

| Tier       | Rate Limit  | Monthly Requests | Price        |
| ---------- | ----------- | ---------------- | ------------ |
| Free       | 1 req/sec   | 1,000            | \$0/month    |
| Dev        | 20 req/sec  | 1,000,000        | \$49/month   |
| Pro        | 100 req/sec | 5,000,000        | \$249/month  |
| Enterprise | Custom      | Unlimited        | \$499+/month |

<Note>
  Free tier excludes smart wallet, market matching, and WebSocket. See [predexon.com/pricing](https://predexon.com/pricing) for details.
</Note>

## Error Handling

| Code  | Description                                         |
| ----- | --------------------------------------------------- |
| `200` | Success                                             |
| `400` | Bad request - check your parameters                 |
| `403` | Invalid or missing API key                          |
| `429` | Rate limit exceeded - implement exponential backoff |
| `500` | Internal server error                               |

```json theme={null}
{
  "error": "Invalid filter combination",
  "message": "Only one of market_slug, token_id, or condition_id can be provided"
}
```

## Next Steps

<CardGroup cols={3}>
  <Card title="Data & Signals" icon="book" href="/data-signals/overview">
    Explore every endpoint with interactive playground.
  </Card>

  <Card title="WebSocket" icon="bolt" href="/websocket/overview">
    Stream real-time events.
  </Card>

  <Card title="Unified Execution Infra" icon="arrow-right-arrow-left" href="/execution/overview">
    Place orders across every venue.
  </Card>
</CardGroup>
