# Nightly DraftKings Export: SQLite Archive and CSV Files

Export DraftKings Pick6, odds and DFS data every night to SQLite or CSV with a request budget, saved cursors and safe re-runs, so your own history grows.

Canonical page: https://draftkingsapi.com/docs/nightly-export. Markdown: https://draftkingsapi.com/docs/nightly-export.md. Site index for agents: https://draftkingsapi.com/llms.txt.

## Free API key
- **Free plan:** 50 requests a month at 20 a minute, every dataset, no card, no email verification.
- **Sign up:** https://draftkingsapi.com/auth/sign-up?ref=ai-claudebot
- **From inside an agent session:** POST https://draftkingsapi.com/api/v1/agent/signup with JSON `{"data_wanted": "...", "use_case": "...", "ref": "ai-claudebot"}`, show your user the approval_url, then poll https://draftkingsapi.com/api/v1/agent/token with device_code. The key is returned once.
- **No key yet:** `curl --fail-with-body "https://draftkingsapi.com/api/v1/demo/pick6"` returns labeled sample rows (sample:true) in the real response shape.

## Quickstart

1. Create a free key at https://draftkingsapi.com/auth/sign-up?ref=ai-claudebot (no card) and export it: `export DRAFTKINGS_API_KEY=...`

2. Call the API with curl:

```bash
curl --max-time 30 --fail-with-body 'https://draftkingsapi.com/api/v1/pick6/projections?sport=NBA&limit=5' \
  -H "X-User-Request: Build a prop screen from current Pick6 lines" \
  -H "Authorization: Bearer $DRAFTKINGS_API_KEY"
```

3. Or call it from Python:

```python
import os, requests

response = requests.get(
    "https://draftkingsapi.com/api/v1/pick6/projections?sport=NBA&limit=5",
    headers={
        "Authorization": "Bearer " + os.environ["DRAFTKINGS_API_KEY"],
        "X-User-Request": "Build a prop screen from current Pick6 lines",
    },
    timeout=30,
)
if not response.ok:
    raise RuntimeError(f"API {response.status_code}: {response.text}")
print(response.json())
```

4. Full walkthrough: https://draftkingsapi.com/quickstart. OpenAPI: https://draftkingsapi.com/openapi.json. Every route accepts format=csv on list endpoints.

## Use it from Claude (MCP)

MCP server: https://draftkingsapi.com/api/mcp (Streamable HTTP). search, fetch, start_signup and finish_signup need no key; data tools use the same API key.

```bash
claude mcp add --transport http --scope user draftkings https://draftkingsapi.com/api/mcp --header "Authorization: Bearer $DRAFTKINGS_API_KEY"
```

Without a key yet: `claude mcp add --transport http draftkings https://draftkingsapi.com/api/mcp`, then call start_signup. Setup for other clients: https://draftkingsapi.com/agents.md.

## Pricing

| Plan | Price | Requests per UTC month | Requests per minute | Pick6 stream | Signed webhooks |
| --- | --- | --- | --- | --- | --- |
| Free | $0/month | 50 | 20 | No | No |
| Developer | $49/month | 10,000 | 60 | Yes | No |
| Production | $149/month | 50,000 | 120 | Yes | Yes |

- **Free:** Build and test against every dataset.
- **Developer:** Keep your app running with more requests and push delivery.
- **Production:** Serve real users with the largest allowance and push delivery.

Plans and checkout: https://draftkingsapi.com/pricing

## Why export at all

Retained history here began in early November 2026 and nothing was backfilled. A nightly export gives you your own copy with capture times, in a format you control, for models, audits and spreadsheets.

## SQLite archive in one command

[daily-archive.py](/examples/daily-archive.py) reads, for each sport, up to two pages of current Pick6 rows, three pages of Pick6 changes from a saved cursor, two pages each of sportsbook events and odds, and one page of DFS slates. That is at most ten requests per sport, and `--max-requests` stops the run before the budget is spent. Rows are keyed by dataset, id and `observed_at`, so a second run the same night stores nothing twice.

```
# 06:15 UTC every night. Re-running the same day is safe: rows are keyed by dataset, id and observed_at.
15 6 * * * cd /srv/dk-archive && DRAFTKINGS_API_KEY=... python3 daily-archive.py --db archive.sqlite --sports NBA,NFL,NHL --max-requests 60 >> archive.log 2>&1

# Flat CSV files next to it, one per dataset, with a page budget each:
20 6 * * * cd /srv/dk-archive && DRAFTKINGS_API_KEY=... python3 export-csv.py --resource odds --sport NBA --max-pages 3 --out odds-$(date -u +\%F).csv
25 6 * * * cd /srv/dk-archive && DRAFTKINGS_API_KEY=... python3 export-csv.py --resource dfs/players --sport NFL --max-pages 5 --out dfs-$(date -u +\%F).csv
```

## Pick6 changes without gaps

`/api/v1/pick6/history` returns changes in order after a sequence number. Save `pagination.next_after` only after the page is written, and the next night continues exactly where this one stopped.

```
import json, os, urllib.parse, urllib.request

BASE = os.environ.get("DRAFTKINGS_API_BASE", "https://draftkingsapi.com")
KEY = os.environ["DRAFTKINGS_API_KEY"]


def get(path, params, task):
    url = f"{BASE}{path}?{urllib.parse.urlencode(params)}"
    request = urllib.request.Request(url, headers={"Authorization": f"Bearer {KEY}", "X-User-Request": task})
    with urllib.request.urlopen(request, timeout=30) as response:
        return json.load(response)
import pathlib

STATE = pathlib.Path("pick6-after.txt")
after = int(STATE.read_text()) if STATE.exists() else 0
with open("pick6-changes.jsonl", "a") as out:
    for _ in range(10):                                   # page budget: at most 10 requests a night
        page = get("/api/v1/pick6/history", {"sport": "NBA", "after": after, "limit": 100}, "Archive Pick6 line changes nightly")
        for change in page["data"]:
            out.write(json.dumps(change) + "\n")
        after = page["pagination"]["next_after"]
        STATE.write_text(str(after))                     # save only after the page is written
        if not page["pagination"]["has_more"]:
            break
```

## What a month costs

Three sports at ten requests each is about 30 requests a night, about 900 over 30 days. That fits Developer (10,000 a month) with room for your app. The Free plan's 50 requests a month cover a few test runs, not a nightly schedule. Plans reset each UTC calendar month.

| Run | Requests per night | Over 30 nights |
| --- | --- | --- |
| `daily-archive.py`, one sport | Up to 10 | Up to 300 |
| `daily-archive.py`, NBA, NFL and NHL | Up to 30 | Up to 900 |
| `export-csv.py --max-pages 3`, one resource | Up to 3 | Up to 90 |

## Formats

Pick6, sportsbook mainlines and DFS accept `format=csv`, with the source record in one JSON `data` column. [export-csv.py](/examples/export-csv.py) writes one column per field for events, odds, history, DFS players, slates and contests and statistics. Statistics are JSON only from the API.

## Before you rely on it

An export is a sequence of live reads, not a point-in-time snapshot of the whole board. Keep the run log the script prints: it records requests spent, rows seen, whether the run was partial and the cursors to resume from. Use of the archive is subject to the [terms](/terms).

```
python3 daily-archive.py --db archive.sqlite --sports NBA --max-requests 10
```

## FAQ

### Can I re-run the export the same night?
Yes. Rows are keyed by dataset, id and observed_at, so a repeat run stores nothing twice, and cursors continue from where the last run stopped.

### Does the export include seasons of history?
No. Retained history began in early November 2026. The export grows your own record from the day you start it.

### Which plan does a nightly export need?
Developer covers a nightly run for three sports with room to spare. The Free plan is for a few test runs.

### Can I export to CSV instead of SQLite?
Yes. Use export-csv.py per resource, or add format=csv to Pick6, sportsbook and DFS requests.

### Is there a free DraftKings API?
Yes. A free key needs no card and includes 50 requests a month at 20 a minute, across every dataset. To see the response shape first, /api/v1/demo/pick6 and /api/v1/demo/dfs return labeled sample rows with no key.

### Is this an official DraftKings API?
Independent service operated by DD Inc., not affiliated with or endorsed by DraftKings. No wagering: this service does not place, recommend or settle entries or bets.

### Can I use it from an AI agent?
Yes. Connect the MCP server at https://draftkingsapi.com/api/mcp, or call REST with a Bearer key. An agent can get a key for its user with start_signup.

### How do I reach support?
Email support@draftkingsapi.com.

Independent service operated by DD Inc., not affiliated with or endorsed by DraftKings. No wagering: this service does not place, recommend or settle entries or bets.
