# Use Underdog data with Grok.

> Use Underdog data in Grok Build, the xAI remote MCP tool or a pasted chat sample. Review setup steps, supported paths and known limits. Underdog API (https://underdogapi.com) is an independent Underdog Fantasy pick'em data API: Higher/Lower lines with separate payout multipliers per side, line history, changes and graded results as JSON, CSV, MCP and streams.

Canonical page: https://underdogapi.com/use-with-grok

## Free offer

**Free API key, no card: 100 credits a month** on the live board, every league, separate Higher/Lower prices, and the last 24 hours of line history. Sign up: https://underdogapi.com/sign-up?ref=ai-claudebot

## Quickstart

1. Get a free key at https://underdogapi.com/sign-up?ref=ai-claudebot (no card), or let your agent request one: `POST https://underdogapi.com/api/v1/agent/signup` with `data_wanted` and `use_case`, then show your user the returned approval_url.
2. Export it: `export UNDERDOG_API_KEY=ud_...`
3. First call with curl:

```bash
curl --fail-with-body 'https://underdogapi.com/api/v1/projections?league=NBA&view=compact&limit=5' \
  -H "Authorization: Bearer $UNDERDOG_API_KEY" \
  -H 'X-User-Request: NBA dashboard integration check'
```

4. Same call in Python:

```python
import os, requests

r = requests.get(
    "https://underdogapi.com/api/v1/projections",
    params={"league": "NBA", "view": "compact", "limit": 5},
    headers={"Authorization": f"Bearer {os.environ['UNDERDOG_API_KEY']}"},
)
r.raise_for_status()
for line in r.json()["data"]:
    print(line["player"]["name"], line["market"]["stat"], line["line"])
```

## Use it from Claude (MCP)

Claude Code, one command:

```bash
claude mcp add --transport http underdog https://underdogapi.com/api/mcp --header "Authorization: Bearer $UNDERDOG_API_KEY"
```

Or add this server to your Claude MCP configuration (the key stays in the environment):

```json
{
  "mcpServers": {
    "underdog": {
      "type": "http",
      "url": "https://underdogapi.com/api/mcp",
      "headers": {
        "Authorization": "Bearer ${UNDERDOG_API_KEY}"
      }
    }
  }
}
```

Guide: https://underdogapi.com/use-with-claude

## Pricing

| Plan | Price | Credits / month | Notes |
| --- | --- | --- | --- |
| Free | $0 | 100 | No card. Live feed 5 minutes behind; last 24 hours of line history |
| Developer | $49/month | 10,000 | For models that need full training pages and loaded game-log seasons. Live feed, no added plan delay |
| Production | $149/month | 50,000 | For apps with real users and push delivery. Everything in Developer, signed webhooks for every change |
| Scale | $499/month | 250,000 | For apps whose traffic has outgrown Production. Everything in Production, 15 live-feed connections at once |

Full pricing: https://underdogapi.com/pricing

## On this page

Grok integration



Pick the route by where you use Grok. Steps follow xAI's documentation as of 5 November 2026. We have not run the two MCP routes end to end, so check the first read below before you rely on them.

Short answer: Point Grok at https://underdogapi.com/api/mcp: add [mcp_servers.underdog] to ~/.grok/config.toml with an Authorization header, or pass it as a remote mcp tool with headers in the xAI Responses API.

## Grok Build

1. [Create a free account](https://underdogapi.com/sign-up), copy a key from [API keys](https://underdogapi.com/dashboard/keys) and set `UNDERDOG_API_KEY` in your environment.
2. Add the table below to `~/.grok/config.toml`, or `.grok/config.toml` for one project. Grok expands the variable when it loads the file, so the key stays out of it.
3. Run `grok mcp doctor underdog` to check the connection.
4. Ask for a small read: `get_coverage`, then `get_projections` for one league. Grok shows them as `underdog__get_coverage` and `underdog__get_projections`.

~/.grok/config.toml

```
[mcp_servers.underdog]
url = "https://underdogapi.com/api/mcp"
headers = { "Authorization" = "Bearer ${UNDERDOG_API_KEY}" }
```

## The xAI API

For an app you are building on Grok. xAI's servers call our MCP endpoint during the request.

1. Set `XAI_API_KEY` and `UNDERDOG_API_KEY` on your server, never in browser code.
2. Send the request below. `allowed_tools` keeps the model to the tools this task needs. Use a current model name from xAI's list.
3. On a new account the first data call asks for `complete_setup`, which needs what you want the data for. Finish it once with your own words.
4. Confirm the answer quotes real rows with `observed_at`. If a tool reports a missing key, the header did not arrive. Call `GET /api/v1/projections` from your server and pass the rows to Grok instead.

xAI Responses API

```
curl https://api.x.ai/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -d '{
  "model": "grok-4.7",
  "input": [{"role": "user", "content": "Call get_coverage, then get_projections with league NBA, view compact and limit 5. Send user_request describing this task. Report the rows and observed_at. If the board is empty or delayed, say so."}],
  "tools": [{
    "type": "mcp",
    "server_url": "https://underdogapi.com/api/mcp",
    "server_label": "underdog",
    "allowed_tools": ["complete_setup", "get_coverage", "get_projections"],
    "headers": {"Authorization": "Bearer '"$UNDERDOG_API_KEY"'"}
  }]
}'
```

## Grok chat

Paste a board. It works anywhere you can paste text, and the chat never holds your key.

1. Copy a board as short text with the request below. It copies to your clipboard on a Mac. Elsewhere, drop `| pbcopy` and copy the output.
2. Paste it into Grok after the prompt below, then ask your question.

Copy the board

```
curl -s "https://underdogapi.com/api/v1/export?league=NBA&stat=Points&format=text" \
  -H "Authorization: Bearer $UNDERDOG_API_KEY" \
  -H "X-User-Request: Export NBA points board for chat analysis" | pbcopy
```

Prompt

```
Below is an Underdog board exported from underdogapi.com. Use only these rows for lines. Quote the read time from the header when you state a line, and tell me if it is more than an hour old. Side availability is independent of its multiplier; check selections[].available. This is information for analysis, not betting advice.

[paste the board here]

My question:
```

A pasted board is a snapshot. Copy it again when you need newer lines.

## Questions

Can the Grok chat app connect to this MCP server?

We could not confirm that it accepts a custom MCP server with an API key, so this guide does not describe one. Paste the board instead. Never paste your API key into a chat.

Why does the xAI API example use headers rather than authorization?

Our server accepts only the exact header Authorization: Bearer followed by your key. xAI documents authorization as a token set in that header, without saying whether it adds the Bearer prefix. The headers field leaves no doubt about what is requested.

What does the xAI API route cost?

Two separate bills: xAI charges for the model and its tool use, and each data call uses credits on your plan here.

Is this an official Underdog integration?

No. This is an independent API and is not affiliated with Underdog.

A step no longer matches what you see? Tell us and we will fix this page.

[Compare **Which Underdog data API to use**](https://underdogapi.com/underdog-api-alternatives) [Integration **Use Claude Code**](https://underdogapi.com/use-with-claude) [Reference **API endpoints and schemas**](https://underdogapi.com/docs) [Pricing **Plans and credits**](https://underdogapi.com/pricing)

## References

- [xAI: MCP servers in Grok Build](https://docs.x.ai/build/features/mcp-servers)
- [xAI: Remote MCP tools](https://docs.x.ai/developers/tools/remote-mcp)
- [Underdog API: machine-readable contract](https://underdogapi.com/openapi.json)

## FAQ

### Is there a free Underdog API?

Yes. The Free plan is a real API key on the live board, not a sample: 100 credits a month, every league, separate Higher/Lower prices and the last 24 hours of line history. No card is needed.

### Is this the official Underdog Fantasy API?

No. Underdog API is an independent data service. It is not affiliated with, endorsed by or sponsored by Underdog Fantasy or Underdog Sports.

### What data does it return?

Underdog Higher/Lower lines with separate payout multipliers and availability for each side, stable market ids through line moves, alternate rungs, recorded line history, changes, graded results and coverage/status endpoints.

### How do I use it from Claude or another AI agent?

Connect the MCP server at https://underdogapi.com/api/mcp with a bearer key, or call the REST API. Agents can request a key for their user with POST /api/v1/agent/signup.

### How much does it cost after the free tier?

Developer is $49/month for 10,000 credits, Production $149/month for 50,000, Scale $499/month for 250,000. Errors and unchanged 304 responses cost zero credits.

### How fresh is the data?

Each row carries its observation time. Check /api/v1/status and /api/v1/coverage before relying on a sport or window; missing collection is reported as unavailable, never filled in.

### Does it place entries or give picks?

No. It is data only: no entries, account operations, guaranteed outcomes or betting advice.

---
Independent data service, not affiliated with Underdog Fantasy or Underdog Sports. Docs: https://underdogapi.com/docs · OpenAPI: https://underdogapi.com/openapi.json · llms.txt: https://underdogapi.com/llms.txt
