# Use the DraftKings API with Windsurf

Add the server https://draftkingsapi.com/api/mcp to ~/.codeium/windsurf/mcp_config.json with an Authorization: Bearer header carrying your DraftKings API key, restart Windsurf, and ask it to call get_coverage. search and fetch work with no key; every data tool needs one and spends the same credits as its REST call.

Canonical page: https://draftkingsapi.com/use-with-windsurf. Markdown: https://draftkingsapi.com/use-with-windsurf.md. Site index for agents: https://draftkingsapi.com/llms.txt.

## Free API key
- **Free plan:** 100 credits a month at 20 requests 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 | Credits per UTC month | Requests per minute | Pick6 stream | Signed webhooks |
| --- | --- | --- | --- | --- | --- |
| Free | $0/month | 100 | 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 credits and push delivery.
- **Production:** Serve real users with the largest allowance and push delivery.

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

## Configure Windsurf

Windsurf's Cascade reads `~/.codeium/windsurf/mcp_config.json`. Remote servers use `serverUrl`, and `${env:...}` is expanded from the environment.

```
export DRAFTKINGS_API_KEY=dk_your_key_here  # a shell profile or secret manager, never the repo
```

```
{
  "mcpServers": {
    "draftkings": {
      "serverUrl": "https://draftkingsapi.com/api/mcp",
      "headers": {
        "Authorization": "Bearer ${env:DRAFTKINGS_API_KEY}"
      }
    }
  }
}
```

```
Cascade > MCP servers: refresh, then draftkings lists its tools.
```

## Run the first task

Give the agent a small task that forces real rows. It costs about two credits.

```
Use the draftkings MCP tools. Call get_coverage, then get_dfs_slates with sport NFL and limit 5. Report the slates you actually got with observed_at. Then call get_dfs_changes with after latest and tell me the cursor to save. Never invent rows. A DFS salary is not odds.
```

Turn on only the tools your project needs; Cascade caps the number of tools across servers.

## Tools the server exposes

The endpoint is Streamable HTTP in its stateless JSON form, over POST. `search` and `fetch` read public documentation and need no key. Every other tool calls the same handler as its REST endpoint, so a Bearer key is required and each call counts against your plan.

| Tool | Key needed | Use it for |
| --- | --- | --- |
| `search`, `fetch` | No | Guides, questions, data reports and integration pages |
| `get_coverage` | Yes | Call this first: measured stored coverage and collector context |
| `get_pick6_projections`, `get_pick6_history` | Yes | Pick6 rows and recorded changes |
| `get_sportsbook_events`, `get_sportsbook_odds`, `get_sportsbook_history` | Yes | Mainlines and retained history |
| `get_dfs_sports`, `get_dfs_contests`, `get_dfs_slates`, `get_dfs_players` | Yes | DFS catalog, contests, slates and salaries |
| `get_context_games`, `get_context_player_stats`, `get_context_team_stats` | Yes | Scores and box scores for captured events |
| `get_stats_games`, `get_stats_player_games`, `get_stats_team_games` | Yes | Independent statistics. `sport` and `season` are required |

As of 2026-11-03, ESPN-attributed DraftKings moneylines, spreads and totals are available across eight leagues. Native coverage as of 2026-11-06 adds NFL moneylines, spreads and totals across 27 U.S. states; NHL game lines across the same 27 states; college basketball and college football game lines across 26 states, excluding Oregon, and NFL rushing yards O/U and NHL points, assists, anytime goalscorers and first-period shots across 27 U.S. states; NHL Shots on Goal in New York and New Jersey; NHL saves and power-play points scoped to New York, with availability reported per market, live over a paid WebSocket while a scope is healthy. Read snapshots and streamed changes through the sportsbook endpoints. Availability varies by state and market; check each scope at /api/v1/sportsbook/scopes. Pick6 rows carry standings multipliers such as 1.5x. A standings multiplier is not decimal odds, a probability or an established entry payout.

## REST alternative

Everything the data tools do is a plain HTTP call, and MCP is optional. Use REST when a client cannot send a header, or when a scheduled job needs no assistant in the loop.

```
curl --fail-with-body "https://draftkingsapi.com/api/v1/pick6/projections?sport=NHL&stat=Shots%20on%20Goal&limit=5" \
  -H "X-User-Request: Build a prop screen from current Pick6 lines" -H "Authorization: Bearer $DRAFTKINGS_API_KEY"
```

The public contract is at [/api/openapi](/api/openapi). See the [Python guide](/guides/curl-python) and the [JavaScript guide](/guides/javascript-node) for retries and pagination.

## Evaluate before you build on Windsurf

Check the data before you promise a feature. A connected client shows that the transport works, not that the coverage fits your project.

- Read [the measured coverage report](/data/coverage-report) and [status](/status) for the sports and stats you need.
- Read [league coverage](/guides/league-coverage), because filter labels differ by dataset.
- Read [odds vs Pick6 multipliers vs DFS salaries](/guides/odds-vs-pick6-vs-dfs) so the assistant does not mix up what the numbers mean.
- Read [freshness](/guides/freshness), then ask the assistant to report `observed_at` and `stale` for each row it uses.
- Compare other providers on [the comparison hub](/compare) if you need full-book sportsbook props or multi-book feeds.

Free includes 100 credits/month at 20 requests/minute; Developer is $49/month with 10,000 credits/month at 60 requests/minute; Production is $149/month with 50,000 credits/month at 120 requests/minute. Limits are shared across keys.

```
curl --fail-with-body "https://draftkingsapi.com/api/v1/dfs/slates?sport=NFL&limit=5" \
  -H "X-User-Request: Build a DFS lineup tool from current salaries" -H "Authorization: Bearer $DRAFTKINGS_API_KEY"
```

## FAQ

### Which MCP URL does Windsurf use?
https://draftkingsapi.com/api/mcp. It is Streamable HTTP in its stateless JSON form, over POST; a GET answers 405, which is expected.

### Can Windsurf use the server without a key?
Yes, for search and fetch, which read public documentation. Leave out the Authorization header. Data tools need a free key.

### Do tool calls count against my plan?
Data tool calls cost the same credits as the REST call they make. get_coverage is free, and a get_dfs_changes page with nothing new costs 0.

### Where should the key live?
In an environment variable, an editor secret or a user-level settings file, never in a committed project file. Create a key named for this client so you can revoke it alone.

### Is there a free DraftKings API?
Yes. A free key needs no card and includes 100 credits a month at 20 requests a minute, across every dataset. 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 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.
