Guides

How to Get Live Cricket Scores on Your Website or Application

Feb. 28, 2025

Quick Implementation Guide:
  • Step 1: Sign up for CricketAPI and create a free project
  • Step 2: Fetch tournament fixture details using the IPL 2025 tournament key
  • Step 3: Use the IPL 2025 match keys from the fixtures to access match details
  • Step 4: Receive live match updates via the Match API (The Match API supports both pull and push mechanisms if enabled)
  • Step 5: Build and test your live score displays

Why Live Scores Matter for Your Business

Cricket, particularly the IPL, drives exceptional engagement. In 2023, the league recorded 505 million TV viewers, with digital platforms seeing significant growth—JioCinema reported 1.4 billion views over the opening weekend of IPL 2023 alone. By integrating live scores, you're tapping into this massive audience and keeping them engaged on your platform. ROI impact: Websites with live sports scores typically see 35-40% longer session times and 25% higher return visitor rates during major tournaments like the IPL.

Who Can Benefit from Live Scores?

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.

The Step-by-Step Process to Implement Live Cricket Scores

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:

Step 1: Sign Up for API Access

First things first, you need to get access to our API:
  • Head over to the Roanuz Console
  • Sign up and select a plan that fits your needs
  • Get your project key and access token

Step 2: Fetch Tournament Fixtures Using the IPL 2025 Tournament Key

For example, to get all the matches for IPL 2025, use the specific tournament key:
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:
  • Match Keys: Use these unique identifiers to later fetch live match data.
  • Match Details: Information such as teams, dates, times, and venues.
Pro tip: Store these fixtures in your database to minimize API calls. You only need to fetch this data once at the start of the tournament or once per day.

Step 3: Access Match API to Get Live Data

Once you have the fixtures, you'll get match keys for each game. Use these keys with the Match API to access live data during games:
# 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 Details: Complete information like Teams, Match number, Tournament details
  • Match Status: Live status (Pre, InPlay, Innings Break, Complete)
  • Toss: Which team won the toss and what they elected to do and Playing XI
  • Venue: Stadium details, location, and country
  • Weather: Temperature, conditions (sunny, cloudy, etc.)
  • Match Format: ODI, T20, Test (with overs per innings)
  • Start & End Time: Scheduled times in local and UTC
  • Umpires & Officials: On-field, TV, and reserve umpires plus match referee
  • Current Score: Runs, wickets, overs, and more
  • Players at Crease: Current batsmen with their live scores
  • Current Bowler: Active bowler with their spell details
  • Full Squads: Complete playing XI for both teams
  • Squad Lists: Including reserves and substitutes
  • Run Rate & Key Stats: Current, required, and projected rates plus individual performance metrics
For complete schema details, visit the CricketAPI Match API Documentation.

Match API Refresh Rates: Keeping Your Scores Up to Date

To ensure real-time accuracy, the Match API updates at different intervals based on match status. Here’s our recommendation to how frequently you can refresh the data:
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)
Why this matters: For live matches, especially high-profile tournaments like the IPL, you need near-instant updates to keep users engaged. By leveraging push-based updates or polling at optimized intervals, you’ll ensure seamless user experience while maintaining API efficiency.

Step 4: Build Your Live Score Components

Now that you have the data, it's time to build your live score features! Here's where we transform the raw data into compelling displays.

The Perfect Live Score Experience: What You Can Build

Using the Match API data, you can create three essential components:

1. Live Score Display

When the first innings is complete and the second innings is underway, your live score display should reflect both scores. For example, once CSK’s innings is finished with a final score of 106/1 in 20.0 overs, and the second innings is in progress, you might display:
Innings 1 (CSK): 106/1 (20.0 Overs) – Completed

Innings 2 (Opponent): 10/0 (2.0 Overs) - Ongoing
How to Build It:
  • First Innings Data: Retrieve the completed score for the first innings from the tournament data. In the API response, this is provided under the innings key (e.g., a_1) with fields such as:
    • score_str: e.g., "106/1 in 20.0"
    • Other details (wickets, overs, etc.) that confirm the innings status.
  • Second Innings Live Data: Once the match progresses into the second innings (e.g., key b_1), the live API will now reference the current score for that innings. For the live display, extract:
    • Runs, wickets, and overs from the live object (e.g., from match_data.data.play.live.score)

2. Recent Ball Commentary

Display ball-by-ball updates for the most recent overs:
LAST OVER: . 6 . 1 . 4 . 6 .

LAST BALL: Bumrah to Kohli: SIX! Straight down the ground!
How to build it:
  • Extract data from:
    • match_data.data.play.live.recent_overs – Contains ball keys
    • match_data.data.play.related_balls – Contains detailed ball information
  • Implementation steps:
    1. Get the ball keys from recent_overs
    2. For each key, find the corresponding ball details in related_balls
    3. Extract the runs scored and commentary from comment under related_balls attribute for each ball
    4. Display them in a readable format

3. Comprehensive Scorecard

Show detailed batting and bowling statistics:
BATTING

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:
  • Extract data from:
    • Current innings: match_data.data.play.innings.a_1 (or the current innings code)
    • Player details: match_data.data.players
  • Implementation steps:
    1. Identify the current innings (e.g., 'a_1' for team A's first innings)
    2. Get the batting order from that innings
    3. For each player key in the batting order, fetch their details from the players object
    4. Similarly, build the bowling card by getting bowling details

Understanding the Data Flow

To effectively implement these features, you need to understand how the Match API data is structured:
  1. Match Object Structure: The top-level object contains basic match information
    • Teams, venue, tournament, format, etc.
  2. Play Section: Contains all the live action data
    • play.innings: Contains details for each team's innings
    • play.live: Contains the current live state
  3. Live Section: The heart of real-time updates
    • live.score: Current score details
    • live.striker_key & live.non_striker_key: Current batsmen
    • live.bowler_key: Current bowler
    • live.recent_overs: Recent balls information
The key to building effective live score displays is understanding that all components are interconnected:
  • Player keys in striker_key link to detailed player information in the players object
  • Ball keys in recent_overs link to detailed ball information in related_balls
  • Innings keys like a_1 link to detailed innings information in play.innings
Here's a simplified view of a match data response so you can visualize the structure:
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", ...]

Implementation Checklist

Before you launch, make sure you've completed these steps:
  • [ ] Sign up for CricketAPI and select the appropriate plan.
  • [ ] Retrieve tournament fixtures API to get the match keys.
  • [ ] Set up match data retrieval using the match key with error handling.
  • [ ] Create live score display components.
  • [ ] Build ball-by-ball commentary sections.
  • [ ] Develop detailed scorecard views.
  • [ ] Implement an appropriate caching strategy.
  • [ ] Test all match states and edge cases.
  • [ ] Set up monitoring for API ServiceLevel Indicators.

Opera's 50 Million Success Story

Need proof this approach works? Opera teamed up with CricketAPI and brought live scores to their Opera Mini users. The result? A jaw-dropping 50 million fans got hooked, checking scores and playing match prediction games right in the app. 👉 Get the full scoop on Opera's success here

Frequently Asked Questions

  • How much does it cost?
    • Plans are usage-based. For test cases and sandbox enviornments, use the Essential plan (₹14,135/month annual or ₹17,669/month monthly).
    • For tournaments, Business (₹27,999/month annual or ₹34,999/month monthly) or Business + (₹47,999/month annual or ₹59,999/month monthly) is recommended.
    • Enterprise plans are custom. More details: CricketAPI Console.
  • Can I use the API in different programming languages? Yes. CricketAPI supports multiple languages including: Python, Java, CURL, .NET, NodeJS, PHP, Ruby, and Go.
  • What if I get stuck? The CricketAPI Documentation is loaded with help, or just email support@roanuz.com. They're pros at sorting things out.

Time to Level Up!

Adding live scores with CricketAPI is your shot at making your platform the place for IPL 2025 fans. Whether you're running a fantasy game, a news site, or an app, this is how you stand out and keep users coming back. So, what's next? Jump over to CricketAPI Console and sign up today. If you hit a bump, don't sweat it—just drop a line to support@roanuz.com. We're here to cheer you on. Let's make IPL 2025 your platform's big win!