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

# Quickstart

> Get from zero to downloading prediction market data in a few steps

Get prediction market data in three steps: get an API key, list available exports, then download the files you need.

## 1. Get an API key

Polymarket data is available self-serve — sign up at **predictiondata.dev** to get an API key. For Kalshi data, contact **[calder@predictiondata.dev](mailto:calder@predictiondata.dev)**. You’ll need the key for **downloading** (and for all Kalshi calls). Listing Polymarket exports does **not** require a key.

## 2. List available exports

Which step you use depends on the exchange.

### Polymarket

**No API key needed** to list. List exports by **event slug** (easiest — one call for all markets in an event):

```bash theme={null}
curl "https://api.predictiondata.dev/v1/exports/polymarket/events/super-bowl-champion-2026-731"
```

You get back a JSON object with `exports.books`, `exports.trades`, and `exports.onchain`, each containing file metadata (e.g. `asset_id`, `date`, `filename`). See [Finding Available Files](/datasets/polymarket/available-files) for market slug and asset ID options.

### Kalshi

List exports by **ticker** (e.g. "New England to win the Super Bowl" → ticker `KXSB-26-NE`):

```bash theme={null}
curl -H "x-auth-token: YOUR_API_KEY" \
  "https://api.predictiondata.dev/v2/exports/kalshi/tickers/KXSB-26-NE"
```

The response is an array of export objects with `path`, `day`, `exportType`, `fileFormat`, `fileSizeBytes`, and other metadata.

## 3. Download a file

### Polymarket

You can download by **asset ID** or by **market slug + outcome**. Use the date from the list response.

**By asset ID:**

```bash theme={null}
curl -G "https://datasets.predictiondata.dev/polymarket/books/ASSET_ID/DATE.csv.gz" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  --output books.csv.gz
```

**By market slug + outcome** (YES/NO) — add `slug=true`:

```bash theme={null}
curl -G "https://datasets.predictiondata.dev/polymarket/books/MARKET_SLUG/YES/DATE.csv.gz" \
  --data-urlencode "slug=true" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  --output books.csv.gz
```

See [Finding Available Files](/datasets/polymarket/available-files#using-the-results) for more details.

### Kalshi

Use the **path** from the list response. The download endpoint redirects to a signed URL (valid 5 minutes). Follow the redirect with `-L` so curl fetches the actual file.

```bash theme={null}
# path from list response: /kalshi/KXSB-26-NE/top-of-book/2026-02-03.csv.gz
curl -L -H "x-auth-token: YOUR_API_KEY" \
  "https://api.predictiondata.dev/v2/datasets/kalshi/KXSB-26-NE/top-of-book/2026-02-03.csv.gz" \
  --output data.csv.gz
```

## Next steps

* **Something wrong?** [Common problems](/common-problems) — 404s, auth errors, date format, slug vs asset ID, and more.
* **Polymarket:** [Datasets overview](/datasets/overview), [Order Books](/datasets/polymarket/order-books), [Trades](/datasets/polymarket/trades), [Onchain Fills](/datasets/polymarket/onchain-fills)
* **Kalshi:** [Finding Available Files](/datasets/kalshi/available-files)
