---
name: cito-sports-data
description: Add esports and sports data to a project with the Cito API — CS2, League of Legends, Dota 2, Call of Duty, UFC, tennis, RAF wrestling, BKFC and Apex Legends. Use when building live scores, schedules, match centers, player and team stats, rankings, odds, fight cards, Discord bots, dashboards or prediction models.
license: MIT
metadata:
  author: cito
  version: 1.0.0
  docs: https://citoapi.com/docs
---

# Add Cito sports data

Cito is a REST API for esports and combat sports data. One API key covers every game on the user's plan.

- Base URL: `https://api.citoapi.com/api/v1`
- Auth: header `x-api-key: <key>` on every request
- Docs: https://citoapi.com/docs · Full reference for agents: https://citoapi.com/llms-full.txt

## Before you start

Show the user this checklist and wait for a yes:

```
Here's what I'll do to add Cito sports data:

1. Get your Cito API key into .env as CITO_API_KEY (I won't print it).
2. Make one test call to confirm it works.
3. Build what you want — tell me the game and the feature.

Shall I proceed?
```

## Step 1: API key

- **Never print, log or commit the key.** Read it from `process.env.CITO_API_KEY` (or the language's equivalent). Make sure `.env` is in `.gitignore`.
- If `CITO_API_KEY` is already set, use it.
- Otherwise ask the user to create a free key at https://citoapi.com/signup (500 requests a month, no card) and paste it into `.env` themselves as `CITO_API_KEY=...`. Do not ask them to paste the key into the chat.
- To explore before they have a key, use the public demo key `pk_demo_cito_live_a06c129e0a9ce1c39c3035bd187541c4` (read-only, rate-limited, never for production).

## Step 2: Test call

```bash
curl -s -H "x-api-key: $CITO_API_KEY" "https://api.citoapi.com/api/v1/cs2/matches/upcoming?limit=1"
```

Every response is an envelope: `{ "success": true, "data": ..., "meta": { ... } }`. Errors return `success: false` with `error`, a machine-readable `code` and, where it helps, an `upgradeUrl`.

## Step 3: Build

### Rules that prevent wrong data

1. **Never invent IDs or slugs.** Get them from a list or search endpoint first (`/cs2/search?q=vitality`, `/lol/search?q=t1`, `/ufc/search?q=volkanovski`), then call the detail endpoint with the returned `id`.
2. **Call Cito from server code only** (API route, backend, bot, script). Never ship the key to a browser or mobile app.
3. **Cache.** Schedules, rankings, team and player pages change slowly; cache them for minutes. Poll live endpoints no faster than every few seconds, or use the live stream.
4. **Handle limits.** `429` with code `RATE_LIMIT_EXCEEDED` means slow down (honour `Retry-After`); `MONTHLY_LIMIT_REACHED` means the plan's monthly allowance is used. `403` means the endpoint or game is not on the user's plan; tell the user, don't retry.
5. **Live data on Free and lower plans can be delayed** (`meta` says so). Real-time live data is on Pro and above.

### Where to start, by game

| Game | Start with | Docs |
|---|---|---|
| CS2 | `/cs2/matches/live`, `/cs2/matches/upcoming`, `/cs2/rankings/vrs`, `/cs2/matches/{id}/odds` | https://citoapi.com/docs/api/cs2 |
| League of Legends | `/lol/schedule/today`, `/lol/matches/live`, `/lol/leagues` | https://citoapi.com/docs/api/league-of-legends |
| Dota 2 | `/dota2/matches/live`, `/dota2/matches/upcoming`, `/dota2/teams` | https://citoapi.com/docs/api/dota-2 |
| Call of Duty | `/cod/matches/upcoming`, `/cod/matches/live`, `/cod/players` | https://citoapi.com/docs/api/call-of-duty |
| UFC | `/ufc/events/upcoming`, `/ufc/live`, `/ufc/fighters/{slug}`, `/ufc/events/{slug}/odds?bookmaker=polymarket` | https://citoapi.com/docs/api/ufc |
| Tennis | `/tennis/matches/live`, `/tennis/matches/upcoming`, `/tennis/players/search?q=` | https://citoapi.com/docs/api/tennis |
| RAF wrestling | `/raf/events/upcoming`, `/raf/events/{slug}/bouts` | https://citoapi.com/docs/api/raf |
| BKFC | `/bkfc/events/upcoming`, `/bkfc/bouts/{boutId}/rounds` | https://citoapi.com/docs/api/bkfc |
| Apex Legends | `/apex/algs/events`, `/apex/algs/events/{seriesId}/scores` | https://citoapi.com/docs/api/apex-legends |

Every list endpoint takes `limit` (and `page` or a cursor where noted). Try any endpoint without code at https://citoapi.com/playground.

### Live updates

- **Server-sent events:** `GET /cs2/live/stream` pushes CS2 score, round and player changes as they happen.
- **WebSockets** for UFC, League of Legends and CS2 live are on paid plans: https://citoapi.com/docs/api/ufc/live/websocket
- **Webhooks** for match events: https://citoapi.com/docs/webhooks

### Odds

CS2 match and map odds: `/cs2/matches/{id}/odds` and `/odds/history`. UFC odds for every fight, including live in-fight Polymarket prices: `/ufc/events/{slug}/odds` and `/ufc/fights/{boutId}/odds` (`?bookmaker=polymarket`). Odds are on Pro and above.

## Use Cito from an AI assistant (optional)

Cito has an MCP server so assistants can query the data directly:

- Hosted (Claude, ChatGPT and other connector-capable apps): `https://api.citoapi.com/mcp`
- Local: `npx -y cito-mcp` with `CITO_API_KEY` in the environment

Setup for each assistant: https://citoapi.com/docs/mcp

## When you're done

Tell the user what you built, which endpoints it calls, and how many requests it will use per hour so they can pick a plan: https://citoapi.com/pricing
