# DraftKings API SDKs: Python, JavaScript and MCP

Install the Python client with pip install draftkingsapi, the JavaScript and TypeScript client with npm install draftkingsapi, or run the MCP server for AI agents with npx -y draftkingsapi-mcp. All three are open source at github.com/draftkingsapi, have no runtime dependencies, and work without a key for the delayed public board. A free key (2,000 requests a day, no card) unlocks the full API.

Canonical page: https://draftkingsapi.com/sdks. Markdown: https://draftkingsapi.com/sdks.md. Site index for agents: https://draftkingsapi.com/llms.txt.

## Free API key
- **Free plan:** 2,000 requests a day at 20 requests a minute, the live board and 24 hours of line history, 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 | Allowance | Requests per minute | Pick6 stream | Signed webhooks |
| --- | --- | --- | --- | --- | --- |
| Free | $0/month | 2,000 requests a day | 20 | No | No |
| Developer | $49/month | 10,000 credits a month, plus 2,000 requests a day of current-board reads | 60 | Yes | No |
| Production | $149/month | 50,000 credits a month, plus 2,000 requests a day of current-board reads | 120 | Yes | Yes |
| Scale | $499/month | 250,000 credits a month, plus 2,000 requests a day of current-board reads | 180 | Yes | Yes |

- **Free:** Build and test on the live board: 2,000 requests a day, with the last 24 hours of line history.
- **Developer:** Keep your app running with more credits and push delivery.
- **Production:** Serve real users with a large allowance and push delivery.
- **Scale:** Run high-volume products and backfills with the largest allowance and push delivery.

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

## Packages

Each package wraps the same REST API, so anything it does you can also do with plain HTTP and a Bearer header. The SDKs add typed methods, pagination with a page budget, and errors that carry the API's own message.

| Package | Install | Runtime | Links |
| --- | --- | --- | --- |
| Python SDK | `pip install draftkingsapi` | Python 3.8+, standard library only | [PyPI: draftkingsapi](https://pypi.org/project/draftkingsapi/), [source](https://github.com/draftkingsapi/draftkingsapi-python) |
| JavaScript / TypeScript SDK | `npm install draftkingsapi` | Node 18+, Deno, Bun, browsers (server-side keys only). ESM, types included | [npm: draftkingsapi](https://www.npmjs.com/package/draftkingsapi), [source](https://github.com/draftkingsapi/draftkingsapi-js) |
| MCP server (stdio) | `npx -y draftkingsapi-mcp` | Node 18+, any MCP client that runs local stdio servers | [npm: draftkingsapi-mcp](https://www.npmjs.com/package/draftkingsapi-mcp), [source](https://github.com/draftkingsapi/draftkingsapi-mcp) |

```
pip install draftkingsapi   # Python 3.8+, standard library only
npm install draftkingsapi   # Node 18+, Deno, Bun; TypeScript types included
npx -y draftkingsapi-mcp   # local stdio MCP server for Claude, Cursor and other agents
```

## Python

`Client()` reads `DRAFTKINGS_API_KEY` from the environment. The `public_*` methods need no key and cost no credits; every other method is a keyed REST call and spends the same credits. Source and full method list: [draftkingsapi-python](https://github.com/draftkingsapi/draftkingsapi-python).

```
pip install draftkingsapi
```

```
from draftkingsapi import Client

dk = Client()  # reads DRAFTKINGS_API_KEY if set; keyless calls never send it

# No key: the delayed, capped public board
board = dk.public_board(league="nba", limit=3)
for prop in board["props"]:
    print(prop["player"], prop["stat"], prop["line"], prop["more_multiplier"])

# With a free key
lines = dk.pick6_projections(sport="NBA", limit=100)
odds = dk.odds(sport="NFL", market="moneyline")
salaries = dk.dfs_players(sport="NFL", format="csv")  # CSV text
```

```
for row in dk.paginate(dk.odds, sport="NBA", max_pages=5):
    ...
```

## JavaScript and TypeScript

Uses the global `fetch`, so it runs on Node 18+, Deno and Bun with no dependencies. Keep keyed calls on a server. Source and method list: [draftkingsapi-js](https://github.com/draftkingsapi/draftkingsapi-js).

```
npm install draftkingsapi
```

```
import { Client } from "draftkingsapi";

const dk = new Client(); // reads DRAFTKINGS_API_KEY if set; keyless calls never send it

// No key: the delayed, capped public board
const board = await dk.publicBoard({ league: "nfl", limit: 3 });
for (const p of board.props) console.log(p.player, p.stat, p.line);

// With a free key
const lines = await dk.pick6Projections({ sport: "NBA", limit: 100 });
const odds = await dk.odds({ sport: "NFL", market: "moneyline" });
```

## MCP server for AI agents

`draftkingsapi-mcp` is a local stdio MCP server. Keyless tools (public board, sportsbook, line moves, status) work with no key; keyed tools read `DRAFTKINGS_API_KEY`. Prefer no install? The hosted server at https://draftkingsapi.com/api/mcp speaks Streamable HTTP with the same key: see [any MCP client](/use-with-mcp). Source: [draftkingsapi-mcp](https://github.com/draftkingsapi/draftkingsapi-mcp). Listed in the official MCP Registry as [com.draftkingsapi/server](https://registry.modelcontextprotocol.io/v0/servers?search=com.draftkingsapi/server).

```
{
  "mcpServers": {
    "draftkingsapi": {
      "command": "npx",
      "args": [
        "-y",
        "draftkingsapi-mcp"
      ],
      "env": {
        "DRAFTKINGS_API_KEY": "dk_your_key"
      }
    }
  }
}
```

```
claude mcp add draftkingsapi -e DRAFTKINGS_API_KEY=dk_your_key -- npx -y draftkingsapi-mcp
# keyless tools only:
claude mcp add draftkingsapi -- npx -y draftkingsapi-mcp
```

## Without an SDK

The SDKs are optional. Every endpoint is plain HTTPS with JSON, so cURL, Python's `urllib` and Node's `fetch` work as shown in the [quickstart](/quickstart), and the [OpenAPI document](/api/openapi) generates clients in any other language.

```
pip install draftkingsapi
python3 -c "from draftkingsapi import Client; print(Client().public_board(league='nba', limit=3))"
```

## FAQ

### Is there a Python package for the DraftKings API?
Yes. pip install draftkingsapi, then from draftkingsapi import Client. It uses only the Python standard library.

### Is there an npm package?
Yes. npm install draftkingsapi for the JavaScript and TypeScript client, and npx -y draftkingsapi-mcp for the MCP server.

### Do I need a key to try the SDKs?
No. The public board, sportsbook and line-move methods work without a key and cost no credits. A free key (2,000 requests a day, no card) unlocks every endpoint.

### Are these official DraftKings packages?
No. They are the official clients of draftkingsapi.com, an independent API that is not affiliated with or endorsed by DraftKings.

### Is there a free DraftKings API?
Yes. A free key needs no card and includes 2,000 requests a day at 20 requests a minute, on the live board and the last 24 hours of line history. A call costs credits for the rows it returns (/api/v1/credit-costs). 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 Stunning Couches LLC, 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 Stunning Couches LLC, not affiliated with or endorsed by DraftKings. No wagering: this service does not place, recommend or settle entries or bets.
