Fantasy
Fantasy cricket API for points, credits and playing XI
A fantasy cricket points API has to answer three questions before the toss and one after every ball: who can be picked, what role and credit they have, whether they are in the XI, and how many points they have now. CricLive exposes those as separate fantasy routes, not as a guess on top of the scorecard.
What a contest app should call
Do not compute fantasy points by scraping runs and wickets yourself unless you publish your own scoring rules. The API already returns role, credit, XI status, and points for a match id.
GET /api/v1/fantasy/matches— upcoming and live matches you can open a contest on.GET /api/v1/fantasy/players/{match_id}— squad with WK, BAT, AR, BOWL and credits.GET /api/v1/fantasy/playing-xi/{match_id}— confirmed XI when it is announced.GET /api/v1/fantasy/player-points/{match_id}— points after the match starts.GET /api/v1/fantasy/live-score/{match_id}— points that move during the innings.GET /api/v1/fantasy/points-engine— the rules those points follow.
Live scores for a public ticker still come from the cricket API and the live line API. Fantasy routes assume you already have a Bearer token. A free key is enough to read the points engine and a sample match while you build. Higher poll rates belong on a paid plan — see current pricing.
Player list before the toss
Build the team-selection screen from the players endpoint. Each player needs an id, name, team, role, and credit. Lock the submit button until your own rules are satisfied: 11 players, credit cap, and at least one wicketkeeper.
curl -H "Authorization: Bearer YOUR_API_TOKEN" \ https://cricketliveapi.com/api/v1/fantasy/players/92411
{
"status": "success",
"data": {
"match_id": 92411,
"players": [
{
"player_id": 1413,
"name": "V Kohli",
"role": "BAT",
"team": "IND",
"credits": 10.0
},
{
"player_id": 1322,
"name": "J Bumrah",
"role": "BOWL",
"team": "IND",
"credits": 9.5
}
]
}
}
Roles are WK, BAT, AR, and BOWL. Store the player id. Points and XI updates refer to that id, not to the display name.
Playing XI and points
When the XI is announced, refresh /playing-xi/{match_id} and mark anyone missing as not playing. Do not zero their points until the points endpoint says so — a late XI change is a status change, not a scoring event.
{
"status": "success",
"data": {
"match_id": 92411,
"players": [
{"player_id": 1413, "name": "V Kohli", "points": 94.5, "role": "BAT"},
{"player_id": 1322, "name": "J Bumrah", "points": 112.0, "role": "BOWL"}
]
}
}
Poll /live-score/{match_id} during the match and /player-points/{match_id} when you need the table that ranks a contest. Read /points-engine once and cache it. That document is the contract you show users when they ask why a catch was worth the points it was worth.
The logged-in reference with parameters and sample calls is the fantasy docs.
Failures
{
"status": "error",
"message": "Match not found."
}
- 401 — token missing or revoked. Fantasy routes use the same Bearer token as the cricket routes.
- 404 — match id is wrong, or fantasy data is not published for that match yet.
- 429 — quota exceeded. Serve the last points snapshot and check pricing before shortening the poll interval.
Never replace a points table with an empty array on an error. Keep the previous data.players list and show a delayed badge.
A contest loop that will not double-charge the quota
- Load matches once a minute until the user picks one.
- Load players once per match page. Cache for several minutes before the toss.
- Load playing XI every minute in the hour before the start, then stop once eleven names are confirmed.
- Load live score every few seconds only while that match is on screen.
- Stop polling when the match status is a result.
Leaderboards for your own contests are yours. /leaderboard/{contest_id} is available when you store contests against these player ids. The API does not invent your entry fee or your prize break-up.
Questions
Is this the same key as the live cricket API?
Yes. One token from the dashboard. Fantasy paths live under /api/v1/fantasy. Score paths live under /api/v1/cricket.
Can I show a live score line and fantasy points together?
Yes. Use the cricket live line API for the score strip and this page’s points route for the player table. They are different payloads.
Where are the scoring rules written down?
GET /api/v1/fantasy/points-engine returns the rules. Link that response, or a page you render from it, next to every points table.
Try this API
Create a key, call /api/v1/fantasy/matches, then request players for one match id. Confirm the body has status: success and a data.players array before you render credits.