Guides
How to Get Live Cricket Scores on Your Website or Application
Feb. 28, 2025

Guides
Feb. 28, 2025
Who Can Use It? | Why It Works? |
---|---|
Sports News Websites | Provides real-time updates to keep audiences informed and drive web traffic and ad revenue. |
Mobile Sports Apps | Delivers push notifications and live match updates, ensuring users stay engaged on the go. |
Prediction & Gambling Sites | Offers dynamic, real-time odds and live betting opportunities based on current match data. |
Streaming Platforms | Enhances live commentary and viewing experiences with up-to-date scores. |
Fantasy Sports Platforms | Updates player statistics in real time, which is critical for gameplay and user strategy. |
Step 1: Sign up for CricketAPI
↓
Step 2: Retrieve Tournament Fixtures using the IPL 2025 tournament key
↓
Step 3: Fetch live match data with the Match API (use match key)
↓
Step 4: Build your live score displays
Let's break down each step in detail:
a-rz--cricket--bcci--iplt20--2025-3utN
This key grants you access to all the Fixtures for the tournament. By using the Tournament Fixtures API with this key, you can retrieve a JSON object containing details for every match scheduled in the tournament—including match keys (unique identifiers), teams playing, match dates and times, and venues. These match keys will be used in the next step to fetch live match data.
Here's a sample Python code snippet to demonstrate how to do this:
import requests
project_key = 'YOUR_PROJ_KEY'
token = 'YOUR_ACCESS_TOKEN'
tournament_key = "a-rz--cricket--bcci--iplt20--2025-3utN"
url = "https://api.sports.roanuz.com/v5/cricket/<span class="highlight highlight-object">/tournament/{}</span>/fixtures/".format(project_key, tournament_key)
headers = {
'rs-token': token
}
response = requests.get(url, headers=headers)
print(response.json())
This will return a JSON object containing all matches in the tournament, including:
# Python example with error handling
try:
match_key = "match_key_from_fixtures" # e.g., iplt20_2025_match_01
url = "https://api.sports.roanuz.com/v5/cricket/<span class="highlight highlight-object">/match/{}</span>/".format(project_key, match_key)
headers = {
'rs-token': token
}
response = requests.get(url, headers=headers)
response.raise_for_status() # Check for HTTP errors
match_data = response.json()
except requests.exceptions.RequestException as e:
print(f"API request failed: <span class="highlight highlight-object">e</span>")
match_data = None # Handle gracefully in your application
Important: The Match API provides an incredible wealth of information beyond just the score. Here's a summary of all the data included:
Match Status | Refresh Rate |
---|---|
Match starts in 2-5 days | Refresh daily at 4 PM |
Match starts within 1 day | Refresh every 3 hours |
Match starts today | Refresh every 1 hour |
Live Match (MG100 format) | Refresh every 5 seconds (or via Push notifications) |
Live Match (MG101 format) | Refresh every 15 minutes (or via Push notifications) |
Innings 1 (CSK): 106/1 (20.0 Overs) – Completed
Innings 2 (Opponent): 10/0 (2.0 Overs) - Ongoing
How to Build It:
a_1
) with fields such as:
score_str
: e.g., "106/1 in 20.0"b_1
), the live API will now reference the current score for that innings. For the live display, extract:
LAST OVER: . 6 . 1 . 4 . 6 .
LAST BALL: Bumrah to Kohli: SIX! Straight down the ground!
How to build it:
recent_overs
related_balls
comment
under related_balls
attribute for each ballBATTING
Player Status Runs Balls 4s 6s SR
Dwayne Smith Not out 29 19 3 2 152.63
Chris Gayle Not out 38 17 3 4 223.53
BOWLING
Player O M R W Econ
Ryan Sidebottom 2.0 0 17 0 8.5
Chris Tremlett 2.0 0 25 0 12.5
How to build it:
players
objectplay.innings
: Contains details for each team's inningsplay.live
: Contains the current live statelive.score
: Current score detailslive.striker_key
& live.non_striker_key
: Current batsmenlive.bowler_key
: Current bowlerlive.recent_overs
: Recent balls informationstriker_key
link to detailed player information in the players
objectrecent_overs
link to detailed ball information in related_balls
a_1
link to detailed innings information in play.innings
match_data
├── key: "rsaban_2022_test_02"
├── name: "South Africa vs Bangladesh"
├── teams
│ ├── a: {key: "rsa", name: "South Africa", ...}
│ └── b: {key: "ban", name: "Bangladesh", ...}
└── play
├── innings
│ └── a_1: {
│ score_str: "106/1 in 27.2",
│ batting_order: ["d_elgar", "s_erwee", "ke_petersen"],
│ ...
│ }
└── live
├── innings: "a_1"
├── batting_team: "a"
├── striker_key: "ke_petersen"
├── non_striker_key: "d_elgar"
├── score: {runs: 106, wickets: 1, ...}
└── recent_overs: ["ball_key1", "ball_key2", ...]
₹ - India
$ - International
€ - Europe
© Copyright Roanuz Softwares Private Limited. All rights reserved