Use cases/Fantasy & pick'em games
[UC 03]
How fantasy and pick'em games score esports and fights with Cito
Seen in our API traffic
Fantasy and prediction games for LoL, UFC and Call of Duty run their scoring on Cito.
{
"success": true,
"data": [
{
"gameId": "lol-game-116299649498303885",
"gameNumber": 1,
"statsSettled": true,
"players": [
{
"playerName": "Canna", "teamSlug": "kc", "role": "Top",
"champion": "Jayce", "kills": 1, "deaths": 0, "assists": 6,
"cs": 301, "gold": 13179, "visionScore": 42
}
]
}
]
}Challenge
Fantasy needs three things to be exactly right: when picks lock, who played, and every stat that scores points. A missing kill or a late result is a support ticket.
Solution
Start times and line-ups from the schedule, per-player stats per game, and results as soon as a series or fight is decided, with the same IDs throughout.
What you get
- Lock picks from scheduled start times
- Score from per-player, per-game stats
- Settle as soon as results are final
- One ID per player across every endpoint
Lock on time
Use the schedule's start time to lock picks and the match ID to follow it. Times and line-ups update as leagues change them, so re-read before each lock.
Score from stats
Per-player stats come per game and per match, so you can score a best-of-five game by game. UFC bouts carry strikes, takedowns and control time for fight fantasy.
const stats = await fetch(
`https://api.citoapi.com/api/v1/lol/matches/${matchId}/player-stats`,
{ headers: { "x-api-key": process.env.CITO_API_KEY } }
).then((r) => r.json());Settle fast
A webhook fires when a series or fight is decided, so leaderboards update without a polling loop.
Endpoints used
| GET/lol/matches/{matchId}/player-stats | Kills, deaths, assists, CS, gold per player |
| GET/lol/games/{gameId}/player-stats | Per-game scoring |
| GET/ufc/events/{slug}/bouts | The card, its order and results |
| GET/ufc/bouts/{boutId}/stats | Strikes, takedowns, control time |
| GET/cod/matches/{id}/player-stats | CDL player stats per map |
Build it on a free key
500 requests a month, every game, no card.
More use cases