What is the Cricket Live Scores API?
The Cricket Live Scores API provides information on various amounts of cricket data including matches, partnerships, players, scorecards, series, teams, commentary and much more.
The API gathers information from the following match’s scores: ODI, T20, Test, BBL, IPL, and World Cup.
Cricket Live Scores is a Freemium API, and the Basic plan allows for 2500 free requests a day. More pricing information can be found here.
How Can I Use the Cricket Live Scores API to Get Cricket Data?
There are a few quick steps to get you up and running using the Cricket Live Scores API:
- Sign up for a RapidAPI user account (it’s free!) to get a free API Key.
- Navigate to the API pricing page and subscribe to a pricing plan. To start, subscribe to the free tier that allows up to 2500 requests per day. If you need more than 2500 requests, you can upgrade to the Pro, Ultra, or Mega Plan to avoid overage charges.
- Return to the Cricket Live Scores API documentation and endpoints page.
- Pick one of the Cricket Live Scores API endpoints and select your preferred programming language from the dropdown. The current options are NodeJS, PHP, Python, Ruby, Objective-C, Java, C# (.NET), cURL, RapidQL.
- Fill out all required parameters (and any optional parameters you need for your project).
- Click “Test Endpoint” to test the API right in your browser, or copy the “Request Snippet” and integrate right into your website or application.
This API will require users to start by calling the Matches/Series lists to obtain all of the possible Match and Series IDs. In order to find specific details on matches/series results, users will find specific scores for matches, series, or players.
What Kind of Information Can I Get From This API?
This example response from the Matches endpoint shows 10 upcoming, completed, or ongoing matches. These IDs can be found on the first line. Below, we can see that 43650 is the match ID for Match 7 of the Men’s OCI World Cup 2019 between Afghanistan and Sri Lanka.
Calling the Series endpoint allows for specific information about when the next set of series matches will be played.
An example response from the Series endpoint shows 26 ongoing matches. These IDs can be found on the first line, for example, we can see below that “2181” corresponds to the Men’s ODI World Cup 2019.
Using the Series ID (2181 in this example), we can call the Series Team endpoint to see what teams are in the Men’s ODL World Cup 2019.
API Architecture
Here is a graphical representation of this API’s endpoints.
FAQ: Frequently Asked Questions about the Cricket Live Scores API
Will buying different pricing tiered plans have different features?
- The difference between Pro and Ultra plans is the number of requests you are allowed to make. You will have access to all of the API’s features from the Basic plan.
Can we use the cricket live scores API to get images of players?
- Yes, you can get the image URL of all players in the Players endpoint.
Does this API offer Cricket Odds or betting tips of the matches?
- Unfortunately, the API doesn’t provide the odds of the Cricket matches.
How often is the match list updated?
- Matches will have the upcoming list of games from over 2 weeks in advance.
Does this API offer live scores or offer Inning/Over summaries?
- Yes, scores are updated to the minute and summaries can be viewed in the Matches Live & Highlights summary.
Does this API offer detailed scorecard information of matches such as player of the match?
- Yes, scorecards with details of scores as well as player of the match can be viewed in this endpoint.
How to use the Cricket Live Scores API by Programming Language
RapidAPI has many SDKs available to help you access the many APIs on the RapidAPI marketplace. For the Cricket Live Scores API, we have the following available programming languages:
How to use Cricket Live Scores API in Node.js
- Install unirest npm module.
$ npm install unirest
- Pick any Cricket Live Scores API endpoint & select “NodeJS” under “Request Snippet.”
- Copy snippet & make the request.
var unirest = require('unirest'); unirest.post(API_URL) .header("X-RapidAPI-Key", API_KEY) .end(function (result) { console.log(result.status, result.headers, result.body); });
Read more about the node.js unirest SDK here.
How to use Cricket Live Scores API in PHP
Requirements:
- cURL
- PHP 5.4+
- Install unirest-php with Composer or from source.
- With Composer:
{ "require-dev": { "mashape/unirest-php": "3.*" } }
- Install from Source:
require_once '/path/to/unirest-php/src/Unirest.php';
- With Composer:
- Choose any API endpoint and select “PHP” from the drop-down to get the request snippet.
- Create a request with the selected API endpoint snippet:
$headers = array('Accept' => 'application/json'); $response = UnirestRequest::post("API_URL", array( "X-RapidAPI-Key" => "API_KEY" ) );
How to use Cricket Live Scores API in Python
- Install Unirest for Python using pip:
$ pip install unirest
- Select any Cricket Live Scores API endpoint & select “Python” from the drop-down to copy the request snippet.
- Make the request by importing unirest:
import unirest response = unirest.post(API_URL, headers={ "X-RapidAPI-Key": API_KEY, "Content-Type": "application/x-www-form-urlencoded" }, params={ "parameter": "value" } ) response.code # The HTTP status code response.headers # The HTTP headers response.body # The parsed response response.raw_body # The unparsed response
How to use Cricket Live Scores API in Ruby
Requirements: Ruby >= 2.0
- Install the unirest gem:
gem install unirest
- From the Cricket Live Scores API endpoints page, select “Ruby” from the drop-down to get the request snippet.
- Make a request by requiring unirest:
require 'unirest' response = Unirest.post API_URL, headers:{ "X-RapidAPI-Key" => API_KEY, "Content-Type" => "application/x-www-form-urlencoded" }, parameters:{ "parameter" => "value" } response.code # Status code response.headers # Response headers response.body # Parsed body response.raw_body # Unparsed body
Learn more here. Related: How to use an API with Ruby on Rails
How to use Cricket Live Scores API in Java
- Include the unirest library with or without Maven.
- Select any API endpoint and choose “Java” from the request snippet drop down to get the request snippet.
- Make a request:
HttpResponse response = Unirest.post(API_URL) .header("X-RapidAPI-Key", API_KEY) .queryString("parameter", "value") .field("parameter", "value") .asJson();
How to use Cricket Live Scores API in Objective-C
Requirements: The Unirest-Obj-C client library requires ARC (Automatic Reference Counting) to be enabled in your Xcode project.
- Download the Objective-C Unirest Library.
- Get the Objective-C request snippet from any API endpoint.
- Make the request:
#import <UNIRest.h> NSDictionary *headers = @{@"Authorization": @"", @"X-RapidAPI-Key": @API_KEY, @"Content-Type": @"application/x-www-form-urlencoded"}; UNIUrlConnection *asyncConnection = [[UNIRest post:^(UNISimpleRequest *request) { [request setUrl:@API_URL]; [request setHeaders:headers]; }] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) { NSInteger code = response.code; NSDictionary *responseHeaders = response.headers; UNIJsonNode *body = response.body; NSData *rawBody = response.rawBody; }];
How to use Cricket Live Scores API in .NET
- Download the unirest-net library and reference it in your project:
- On any Cricket Live Scores API endpoint, select “.NET” from the drop down to get the request snippet.
- Make the request:
Task<HttpResponse<MyClass>> response = Unirest.post(API_URL) .header("X-RapidAPI-Key", API_KEY) .header("Content-Type", "application/x-www-form-urlencoded") .asJson();
How to use Cricket Live Scores API in cURL
- From an endpoint, select “cURL” from the request snippet dropdown.
- Make the request:
curl --get --include 'API_URL' -H 'X-RapidAPI-Key'
Chandan says
Does This API provides the Data for IPL 2020. In the details IPL is there but i cant see any matches from IPL in the upcoming match list
Prudhvi says
Hey Chandan same here. Couldn’t find IPL fixtures. Did you find any other source?
Livecricketbd says
Hello friends please kindly information me livecricket score api how can I get use on my site I don’t know about rapid-fire cricket score api system I don’t know rapiapi demo please kindly help me any body know that ,,thanks
Nitesh Shah says
Please provide me the documentation about how to auto update API data in n number of time without refreshing whole page in PHP..
Bheem singh says
hi dear, hope you are doing good and fine.
we are using live score API , when we are checking the example response for the below end point
{{base_url}}/matches.php?upcomingLimit=10&inprogresslimit=10&completedlimit=10
then this is giving team_logo in the response but the same key is not present in the response that we are getting after clicking the same link from postman.
Please help
Shah says
Is it live or dead? Dont see any data returned by the API.