Score line
Cricket live line API for a running score
A live cricket line API is not the full scorecard. It is the single strip users stare at: teams, score, overs, current run rate, required rate, and the last ball. CricLive builds that strip from the live match list and the live scorecard, so you do not scrape a website to keep a ticker updated.
What belongs on the line
Live-line sites in India show one row per match. Each row needs a stable match id plus the fields that change every ball. Pull those fields and ignore the rest until the user taps the match.
- Teams and format — “India vs Australia”, T20, ODI, or Test.
- Score and overs — wickets and overs in one string, for example 187/3 (18.4).
- Rates — current run rate, and required run rate when a target exists.
- Last ball — the short commentary line for the most recent delivery.
- Status — live, innings break, stumps, or result.
The parent product is the cricket API. A ticker can start on the free cricket API if you cache the line. Pricing for higher polling volume is on pricing.
Two calls, not twenty
First, list live matches and render one row per id. Second, when you need overs, rates, and the striker, request the live scorecard for that id. Do not request graphs, news, or the full ball log just to paint the strip.
GET /api/v1/cricket/matches/live Authorization: Bearer YOUR_API_TOKEN GET /api/v1/cricket/live-scorecard/92411 Authorization: Bearer YOUR_API_TOKEN
Map the JSON into a line object in your own code. That keeps the HTML template stable if a nested key moves.
{
"status": "success",
"data": {
"match_id": 92411,
"teams": "India vs Australia",
"score": "187/3",
"overs": "18.4",
"run_rate": "10.02",
"required_rate": "11.40",
"last_ball": "SIX",
"status": "live"
}
}
On a target chase, show required rate only when the field is present. In the first innings, hide it. On a rain delay, keep the last score and replace the last-ball text with the status string.
Refresh without looking broken
Users notice a line that jumps backward or blanks out between polls. Keep the previous payload and swap only when the new call returns status: success.
- Poll the live list every 3–5 seconds from your server, not from each browser.
- Poll the live scorecard only for matches expanded on screen.
- If HTTP status is 429, serve the cached line and add a “delayed” label.
- If the new score has fewer overs than the cached score, ignore that payload. It is a stale response.
function shouldReplace(prev, next) {
if (!next || next.status !== "success") return false;
if (!prev) return true;
const oldOvers = parseFloat(prev.data.overs || "0");
const newOvers = parseFloat(next.data.overs || "0");
return newOvers + 0.01 >= oldOvers;
}
Error body
A live line should never render the word “undefined”. If the call fails, keep the last good line.
{
"status": "error",
"message": "Match not found."
}
401 means the token is missing. 404 means that match id has no live scorecard yet — common in the minute before the first ball. 429 means you are polling too often for the plan. Check current Cricket API pricing before raising the poll rate.
Where this is different from a full API
A match center still needs the scorecard, squads, and commentary from the cricket data API. A fantasy room needs points from the fantasy cricket API. The live line is the cheap, fast surface those products can share. Signed-in reference for every parameter is in the API docs.
Questions
Can one response power a whole live-line website?
Use the live match list for the index of rows. Fetch /live-scorecard/{matchId} per open match for rate and last ball. That is two endpoint families, not one giant document.
Does the line include ball-by-ball history?
The line includes the latest delivery. The full history is /commentary/{matchId}. Load that on a detail page.
Is there a separate live cricket line API hostname?
No. Same host, same token, same status / data envelope as the rest of the cricket API.
Try this API
Request /api/v1/cricket/matches/live, pick a match id, then request /api/v1/cricket/live-scorecard/{matchId}. Render score, overs, and last ball from data.