---
name: kashrock-esports-data
description: Add esports data to a project with the KashRock API: player props, normalized odds, live match data, history and line-movement signals for 9 titles. Use when building props boards, odds screens, live dashboards, alert bots or models.
metadata:
  docs: https://www.kashrock.com/docs
  pricing: https://www.kashrock.com/pricing.md
---

KashRock is one REST API, WebSocket and MCP server for esports data. One key covers every title on the key's plan.

- Base URL: `https://kashrock.up.railway.app`
- Auth: header `x-api-key: <key>` on every request (`Authorization: Bearer <key>` also works)
- Titles: Counter-Strike 2 (`cs2`), Valorant (`valorant`), League of Legends (`lol`), Dota 2 (`dota2`), Call of Duty (`cod`), Rainbow Six (`r6`), Mobile Legends (`mlbb`), Deadlock (`deadlock`), Apex Legends (`apex`)
- Full reference for agents: https://www.kashrock.com/llms-full.txt

## Before you start

Tell the user:

```
Here is how I will add KashRock:
1. Put your KashRock key in .env as KASHROCK_API_KEY (I will not print it).
2. Make one test call to confirm the key and read your plan.
3. Build what you asked for with the calls your plan includes.
```

## Step 1: Key

- Never print, log or commit the key. Read it from `KASHROCK_API_KEY`. Make sure `.env` is in `.gitignore`.
- No key yet: the user signs in at https://www.kashrock.com/login?returnTo=%2Fconsole and copies a free Sandbox key from the console (no card). Ask them to paste it into `.env` themselves, not into the chat.
- To look around first with no key at all: `https://kashrock.up.railway.app/v6/demo/cs2-prop` returns one live prop.

## Step 2: Validate with a real call

```
curl -s -H "x-api-key: $KASHROCK_API_KEY" "https://kashrock.up.railway.app/v7/meta"
```

- `plan` in the response is the key's plan. Use it to pick tools from the table below.
- Then make one call for the feature you are building and check the response has real rows (a `kr_match_id` that starts with `kr_<sport>_`, players, prices).
- Never invent IDs. Get `kr_match_id`, team (`kr_tm_*`) and player IDs from a list call first.

## Step 3: Pick the right call

| Goal | Endpoint | MCP tool | Plan | Credits per call |
| --- | --- | --- | --- | --- |
| Player props | `GET /v7/{sport}/props` | `v7_props` | Sandbox and up | 5 |
| Matches and schedules | `GET /v7/{sport}/matches` | `v7_matches` | Sandbox and up | 2 |
| Normalized odds | `GET /v7/{sport}/lines` | `v7_lines` | Hobby and up | 10 |
| Live match data | `GET /v7/{sport}/live` | `v7_live` | Hobby and up | 10 |
| Live WebSocket | `WS /v7/live/ws` | `get_live_ws` | Builder and up | 1 to connect |
| Historical research | `GET /v7/{sport}/results, /v7/{sport}/players?include=gamelogs` | `v7_results, v7_players` | Hobby and up | 5 for results, 1 for players |
| Line movement | `GET /v7/{sport}/flow` | `v7_flow` | Hobby and up | 10 |
| Momentum signals | `GET /v7/{sport}/momentum` | `v7_momentum` | Builder and up | 1 |
| Signal alerts | `GET /v7/{sport}/signals` | `v7_signals` | Pro and up | 1 |
| Quant desk | `GET /v7/{sport}/arb, /clv, /backtest, /portfolio` | `v7_arb, v7_clv, v7_backtest, v7_portfolio` | Quant and up | 10 for arb, 5 for CLV and backtests, 1 for portfolio |

- **Player props**: Every player prop from DFS apps and sportsbooks, grouped by player and market, with fair odds. Limits: Apex Legends has no props. Each book reports its own age in seconds (age_s), so you can see how fresh it is.
- **Matches and schedules**: Upcoming, live and finished matches with stable KashRock match and team IDs. Limits: Never invent a match ID. Take kr_match_id from this list, then pass it to other calls. Sandbox sees discovery only. Hobby adds 90 days of history, Builder and up the full archive.
- **Normalized odds**: Team moneylines, spreads and totals from sportsbooks and prediction markets, mapped to one schema with a consensus fair price. Limits: Not every book prices every title. Call v7_meta with include=boards to see which books have lines for a title right now. Apex Legends has no lines.
- **Live match data**: In-game state for matches in progress: score, kills, deaths, assists, events, and title-specific state like CS2 rounds or LoL gold. Each game says if live stats are flowing (has_live_stats) and why not when they are not. Limits: Live stats exist only for matches a live source covers. A higher plan adds speed and capacity, never coverage for a match that has none. Hobby is 15 seconds behind. Builder, Pro and Quant are real time.
- **Live WebSocket**: Push updates for live matches instead of polling. Limits: Connect from your app, not through MCP: get_live_ws returns the URL, auth and subscribe messages. Use ?ticket= from POST /v7/ws-ticket when a client cannot set headers. Builder: 2 connections, 5 matches. Pro: 10 and 25, plus the whole board. Quant: 20 and 50.
- **Historical research**: Finished matches, per-map player gamelogs, graded prop results, and stored odds tapes. Limits: Gamelog rows per call are capped by plan: 500 on Hobby, 2,000 on Builder, 5,000 on Pro, 10,000 on Quant. Sandbox has no history. Hobby reads the last 90 days. Builder and up read the full archive and the stored odds tapes.
- **Line movement**: Steam, shifts and volume moves on the odds board, as plays you can act on. Limits: Built from the same lines board, so it covers the books and titles that board covers.
- **Momentum signals**: First-mover plays: one book moved first, and other books still offer the old, better price. Limits: Looks back 5 to 360 minutes (60 by default). A quiet market returns no plays, and that is a real answer.
- **Signal alerts**: Mispricing, steam and arbitrage alerts, to poll or receive as push. Limits: Upcoming matches by default. Matches already started need Quant (include_started).
- **Quant desk**: Cross-book arbitrage, closing line value, backtests, portfolio tracking, webhooks and one-match overviews. Limits: CLV and the match overview need a match ID. Backtests cover the last 30 days unless you pass dates.

## Step 4: Build rules

1. Call KashRock from server code only (API route, backend, bot, script). Never ship the key to a browser or mobile app.
2. Cache schedules, players and teams for minutes. Poll live data no faster than you need, or use the WebSocket on Builder and up.
3. A credit is the unit of quota. Each call spends the credits shown above.
4. Errors:
   - **401** (error.code = "invalid_key"): The key is missing, wrong, or turned off. Send it as the x-api-key header (Authorization: Bearer also works). Copy it again from the console.
   - **403** (error.code = "plan_required"): This endpoint is not in your plan. required_plan names the plan that has it. Do not retry. Tell the user which plan unlocks it; upgrade.url opens checkout with that plan picked.
   - **402** (limit_type = "daily", "monthly" or "live_lines"): Your credits for the day or month are spent. Wait for resets_at, add a credit pack (credits_url), or move up a plan. Retrying will not help.
   - **429** (limit_type = "rpm", "concurrency" or "heavy_capacity"): Too many requests at once. You still have credits. Wait the Retry-After seconds, then retry. Cache slow-changing data and poll live data no faster than you need.
   - **200, empty** (An empty matches, live or plays list): Nothing matches right now: no live match, or a quiet market. Show an empty state. It is a real answer, not an error, and no plan changes it.
   - **200, no stats** (has_live_stats = false with a reason): The match is live but no live source is covering it right now. Show the match without stats. Upgrading does not add coverage for a match.
   - **200, delayed** (A data_delay block on live data): Your plan reads live data with a delay (15 seconds on Hobby). Expected on Hobby. Builder and up are real time.

## MCP

- Hosted (Claude, ChatGPT, Cursor and other MCP clients): `https://mcp.kashrock.com/mcp` over Streamable HTTP, with header `x-api-key: <key>`.
- Claude Code: `claude mcp add --transport http kashrock https://mcp.kashrock.com/mcp --header "x-api-key: $KASHROCK_API_KEY"`
- Local: `uvx kashrock-mcp` (needs uv), with `KASHROCK_API_KEY` set.
- Call `v7_meta` first. Tools follow the same plan rules as the REST API.
- Setup for each client: https://www.kashrock.com/agents

## Recipes

### CS2 live dashboard

A page that lists live CS2 matches and shows each one’s scoreboard as it plays. Needs Hobby or above. Hobby works with a 15 second delay. Builder makes it real time and adds the WebSocket so you can stop polling.

1. `v7_meta`: Confirm the key works and read your plan.
2. `GET /v7/cs2/matches?status=live`: List live matches and take each kr_match_id.
3. `GET /v7/cs2/live?game={kr_match_id}&include=boxscore`: Read the scoreboard: score, kills, deaths, assists, round state.
4. `WS /v7/live/ws (Builder and up)`: Subscribe to the same match for push updates instead of polling.

Check: Each match in the list has status "live" and a kr_match_id that starts with kr_cs2_. An empty list means no CS2 match is live right now. That is not an error, and no plan changes it. On Hobby the response carries a data_delay block. That is the 15 second delay, not stale data.

### Dota 2 live tracker

A tracker that follows one Dota 2 match: score, kills and tower events as they happen. Needs Hobby or above. Hobby is 15 seconds behind. Builder and up are real time.

1. `GET /v7/dota2/matches?status=live`: Pick a live match and take its kr_match_id.
2. `GET /v7/dota2/live?game={kr_match_id}&include=boxscore`: Read the scoreboard for that match.
3. `GET /v7/dota2/live?game={kr_match_id}&include=events`: Read in-game events: kills and towers, with team side and time.

Check: The kr_match_id you pass came from the matches list. Never build one by hand. Check has_live_stats on each game. When it is false, reason says why (for example feed_stale). Show the match without stats; do not retry in a loop.

### Odds movement alerts

A bot that posts when a line moves hard or one book is slow to follow. Needs Hobby or above. Hobby polls line moves (flow). Builder adds first-mover plays (momentum). Pro adds signal alerts. Quant adds webhooks so alerts come to you.

1. `v7_meta`: Read your plan so the bot picks the right tool.
2. `GET /v7/cs2/flow (Hobby and up)`: Steam, shifts and volume moves on the lines board.
3. `GET /v7/cs2/momentum?window_minutes=60 (Builder and up)`: One book moved first; the others still show the old price.
4. `GET /v7/cs2/signals (Pro and up)`: Mispricing, steam and arbitrage alerts in one feed.

Check: A quiet market returns an empty list. Alert only on what comes back. A 403 with code plan_required names the plan you need in required_plan. Do not retry it.

## Plans

| Plan | Price | Credits | Rate limit | Live data | History | WebSocket |
| --- | --- | --- | --- | --- | --- | --- |
| Sandbox | $0/mo | 1,500 credits a day | 10 req/min | No live data | None | None |
| Hobby | $29.99/mo | 1.5M credits a month | 30 req/min | 15s delay | Last 90 days | None |
| Builder | $99/mo | 5M credits a month | 100 req/min | Real time | Full archive | 2 connections, 5 matches |
| Pro | $199/mo | 10M credits a month | 250 req/min | Real time | Full archive | 10 connections, 25 matches, whole board |
| Quant | $299/mo or $2,990/yr | 20M credits a month | 500 req/min | Real time | Full archive | 20 connections, 50 matches, whole board |

## When you are done

Tell the user what you built, which calls it makes, and about how many credits it spends per hour, so they can pick a plan: https://www.kashrock.com/pricing
