This section explains the basic working of Cricket Data API - it is not language specific. This can guide you in implementing the API for your favourite programming language. We also have quite a few Code Samples in different languages, - furthermore if you'd like to contribute please do reach out to us on contact@cricketdata.org! The Fantasy APIs may be found here.
Index
Generic Information
Generic API provide you supportive information.A number of generic API are made available for your use - country, flags, banners and more. Any images / rich content provided is supported by our Global CDN so you can be assured of great performance no matter where you are based.
Important information to remember at all times: Every API response contains a generic 'info' object that tells you the result of your interaction with our systems. JSON keys tagged 'optional' may not exist in some scenarios, so please check for the presence of the key before reading it's value.
apikey | Guid Your subscription's API key. You may use different API keys based on your choice of subscription. This is in a Guid format like 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'. | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
status | String success / failure based on the API result | ||||||||||||||
data | Important An array / object containing the main data of the API. Sometimes the response data may have a large number of rows, and it's not possible to send all of them in a single query. One query is limited to 25 rows. | ||||||||||||||
info | An object explaining the result of the API
|
(data may be truncated for ease of reading)
{
"apikey": "[your api key]",
"status": "success",
"info": {
"hitsToday": 10,
"hitsLimit": 500,
"credits": 0,
"server": 18,
"offsetRows": 0,
"totalRows": 249,
"queryTime": 10
}
}
Countries with Flags
List of countries and flagsA comprehensive list of all countries with their corresponding flags (served from a CDN in Vector SVG format). Now you can always show flags of the countries that compete in the matches you choose to cover!
status | String success / failure based on the API result | ||||||||
---|---|---|---|---|---|---|---|---|---|
data | An array / object containing the main data of the API
|
Output{
"apikey": "[your api key]",
"offset": 0
}
(data may be truncated for ease of reading)
{
"apikey": "[your api key]",
"data": [
{
"id": "zw",
"name": "Zimbabwe",
"genericFlag": "https://cdorg.b-cdn.net/flags/generic/ZW.svg"
},
{
"id": "zm",
"name": "Zambia",
"genericFlag": "https://cdorg.b-cdn.net/flags/generic/ZM.svg"
},
{
"id": "za",
"name": "South Africa",
"genericFlag": "https://cdorg.b-cdn.net/flags/generic/ZA.svg"
}
],
"status": "success",
"info": {
"hitsToday": 10,
"hitsLimit": 500,
"credits": 0,
"server": 18,
"offsetRows": 0,
"totalRows": 249,
"queryTime": 10
}
}
Code Playground
List APIs
These APIs give you a List of itemsThe common thing to keep in mind is that the 'data' field of the JSON response holds the array of data, and the method for parsing for all List type API is quite similar.
Cricket Series List
List of Series covered in Cricket DataA Descending-Order (latest first) list of all series that we cover. Keep in mind that in some cases series or some matches in the series may only get partial coverage.
status | String success / failure based on the API result | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | An array / object containing the main data of the API
|
Output{
"apikey": "[your api key]",
"offset": 0
}
(data may be truncated for ease of reading)
{
"apikey": "[your api key]",
"data": [
{
"id": "47b54677-34de-4378-9019-154e82b9cc1a",
"name": "Indian Premier League 2022",
"startDate": "Mar 26",
"endDate": "May 29",
"odi": 0,
"t20": 70,
"test": 0,
"squads": 10,
"matches": 70
},
{
"id": "ff5aa3f3-7164-4766-be90-3b64783257a0",
"name": "Australia Domestic One-Day Cup 2021-22",
"startDate": "Sep 22",
"endDate": "Mar 11",
"odi": 19,
"t20": 0,
"test": 0,
"squads": 0
}
],
"status": "success",
"info": {
"hitsToday": 1,
"hitsLimit": 500,
"credits": 0,
"server": 18,
"offsetRows": 0,
"totalRows": 42,
"queryTime": 10
}
}
Code Playground
Cricket Series Search
Series Search function for Cricket APIList of all series that match the name specified. This is matches on Name and ShortName. Keep in mind that in some cases series or some matches in the series may only get partial coverage.
status | String success / failure based on the API result | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | An array / object containing the main data of the API
|
Output{
"apikey": "[your api key]",
"offset": 0,
"search": "IPL"
}
(data may be truncated for ease of reading)
{
"apikey": "[your api key]",
"data": [
{
"id": "47b54677-34de-4378-9019-154e82b9cc1a",
"name": "Indian Premier League 2022",
"startDate": "Mar 26",
"endDate": "May 29",
"odi": 0,
"t20": 70,
"test": 0,
"squads": 10,
"matches": 70
}
],
"status": "success",
"info": {
"hitsToday": 1,
"hitsLimit": 500,
"credits": 0,
"server": 18,
"offsetRows": 0,
"totalRows": 42,
"queryTime": 10
}
}
Code Playground
All Matches List
A large list of all matches coveredThis API does give you a full list of matches; but keep in mind that using the Series Info API may be easier if you wish to cover just a few series.
status | String success / failure based on the API result | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | An array / object containing the main data of the API
|
Output{
"apikey": "[your api key]",
"offset": 0
}
(data may be truncated for ease of reading)
{
"apikey": "[your api key]",
"data": [
{
"id": "2d448290-d882-4e67-9a4a-f62dfea9a51a",
"name": "Western Australia vs New South Wales, Final",
"status": "Western Australia won by 18 runs",
"matchType": "odi",
"venue": "Junction Oval, Melbourne",
"date": "2022-03-10",
"dateTimeGMT": "2022-03-10T23:30:00",
"teams": [
"Western Australia",
"New South Wales"
],
"score": [
{
"r": 207,
"w": 10,
"o": 46.3,
"inning": "Western Australia Inning 1"
},
{
"r": 225,
"w": 9,
"o": 50,
"inning": "New South Wales Inning 1"
}
],
"series_id": "ff5aa3f3-7164-4766-be90-3b64783257a0",
"fantasyEnabled": false
}
],
"status": "success",
"info": {
"hitsToday": 3,
"hitsLimit": 500,
"credits": 0,
"server": 18,
"offsetRows": 0,
"totalRows": 913,
"queryTime": 14.5072
}
}
Code Playground
Current Matches List
Current matches with a TossWinner but no MatchWinnerThis API does give you a full list of CURRENT matches; but keep in mind that using the Series Info API may be easier if you wish to cover just a few series.
status | String success / failure based on the API result | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | An array / object containing the main data of the API
|
Output{
"apikey": "[your api key]",
"offset": 0
}
(data may be truncated for ease of reading)
{
"apikey": "[your api key]",
"data": [
{
"id": "2d448290-d882-4e67-9a4a-f62dfea9a51a",
"name": "Western Australia vs New South Wales, Final",
"status": "Western Australia won by 18 runs",
"matchType": "odi",
"venue": "Junction Oval, Melbourne",
"date": "2022-03-10",
"dateTimeGMT": "2022-03-10T23:30:00",
"teams": [
"Western Australia",
"New South Wales"
],
"score": [
{
"r": 207,
"w": 10,
"o": 46.3,
"inning": "Western Australia Inning 1"
},
{
"r": 225,
"w": 9,
"o": 50,
"inning": "New South Wales Inning 1"
}
],
"series_id": "ff5aa3f3-7164-4766-be90-3b64783257a0",
"fantasyEnabled": false
}
],
"status": "success",
"info": {
"hitsToday": 3,
"hitsLimit": 500,
"credits": 0,
"server": 18,
"offsetRows": 0,
"totalRows": 913,
"queryTime": 14.5072
}
}
Code Playground
Series Squad List
Coming soonThe Series squad list API gives you a list of Squads in the given Series. This is yet under development, so please bear with us. Coming soon!
All Players List
A large list of all players in the systemThis API gives you a full list of players with their Country of origin. Based on this you can then query the Player Info API and get more details for each player.
status | String success / failure based on the API result | ||||||
---|---|---|---|---|---|---|---|
data | An array / object containing the main data of the API
|
Output{
"apikey": "[your api key]",
"offset": 0
}
(data may be truncated for ease of reading)
{
"apikey": "[your api key]",
"data": [
{
"id": "16592242-ef26-45d9-bf23-fc090e90fbbe",
"name": "Anderson Phillip",
"country": "West Indies"
},
{
"id": "9f2abfee-a09f-47c8-a1e5-8eb03fa7b85a",
"name": "Veerasammy Permaul",
"country": "West Indies"
}
],
"status": "success",
"info": {
"hitsToday": 7,
"hitsLimit": 500,
"credits": 0,
"server": 18,
"offsetRows": 0,
"totalRows": 1992,
"queryTime": 10.099
}
}
Code Playground
Search All Players
Searches through our entire players database in the systemThis API gives you a full list of players with their Country of origin. Based on this you can then query the Player Info API and get more details for each player.
status | String success / failure based on the API result | ||||||
---|---|---|---|---|---|---|---|
data | An array / object containing the main data of the API
|
Output{
"apikey": "[your api key]",
"offset": 0
}
(data may be truncated for ease of reading)
{
"apikey": "[your api key]",
"data": [
{
"id": "16592242-ef26-45d9-bf23-fc090e90fbbe",
"name": "Anderson Phillip",
"country": "West Indies"
},
{
"id": "9f2abfee-a09f-47c8-a1e5-8eb03fa7b85a",
"name": "Veerasammy Permaul",
"country": "West Indies"
}
],
"status": "success",
"info": {
"hitsToday": 7,
"hitsLimit": 500,
"credits": 0,
"server": 18,
"offsetRows": 0,
"totalRows": 1992,
"queryTime": 10.099
}
}
Code Playground
Cricket Info APIs
These APIs give you Details of each item shown in the List APIDetails about series, matches, players, etc can be acquired through this API. Keep in mind that this API does NOT have pagination, so if there's a long list or a large API response you will need to handle it accordingly.
Series Info
Detailed info about the SeriesBased on the Series ID provided, this API will give you information about the Series. Beware that the Match List given here is the COMPLETE list, so it will be very HEAVY when the Series has a large number of matches! You should ideally pull this API max 2-3 times a Day or on Manual intervention from your end if required.
status | String success / failure based on the API result | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | An array / object containing the main data of the API
|
Output{
"apikey": "[your api key]",
"offset": 0,
"id": "47b54677-34de-4378-9019-154e82b9cc1a"
}
(data may be truncated for ease of reading)
{
"apikey": "[your api key]",
"data": {
"info": {
"id": "47b54677-34de-4378-9019-154e82b9cc1a",
"name": "Indian Premier League 2022",
"startdate": "Mar 26",
"enddate": "May 29",
"odi": 0,
"t20": 70,
"test": 0,
"squads": 10,
"matches": 70
},
"matchList": [
{
"id": "341e6690-ece0-4dce-83fc-91effbb28eb3",
"name": "Chennai Super Kings vs Kolkata Knight Riders, 1st Match",
"matchType": "t20",
"status": "Match not started",
"venue": "Wankhede Stadium, Mumbai",
"date": "2022-03-26",
"dateTimeGMT": "2022-03-26T14:00:00",
"teams": [
"Chennai Super Kings",
"Kolkata Knight Riders"
],
"fantasyEnabled": false
}
]
},
"status": "success",
"info": {
"hitsToday": 12,
"hitsLimit": 500,
"credits": 0,
"server": 11,
"queryTime": 10
}
}
Code Playground
Match Info
Detailed info about the MatchProvides the details of this cricket match. If you require scorecard / ball by ball or other more detailed information, please use the corresponding Fantasy Squad / Fantasy Scorecard / Fantasy Ball-by-Ball API.
status | String success / failure based on the API result | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | An array / object containing this Matches detail
|
Output{
"apikey": "[your api key]",
"offset": 0,
"id": "820cfd88-3b56-4a6e-9dd8-1203051140da"
}
(data may be truncated for ease of reading)
{
"apikey": "[your api key]",
"data": {
"id": "2d448290-d882-4e67-9a4a-f62dfea9a51a",
"name": "Western Australia vs New South Wales, Final",
"matchType": "odi",
"status": "Western Australia won by 18 runs",
"venue": "Junction Oval, Melbourne",
"date": "2022-03-10",
"dateTimeGMT": "2022-03-10T23:30:00",
"teams": [
"Western Australia",
"New South Wales"
],
"score": [
{
"r": 207,
"w": 10,
"o": 46.3,
"inning": "Western Australia Inning 1"
},
{
"r": 225,
"w": 9,
"o": 50,
"inning": "New South Wales Inning 1"
}
],
"tossWinner": "Western Australia",
"tossChoice": "bat",
"matchWinner": "Western Australia",
"series_id": "ff5aa3f3-7164-4766-be90-3b64783257a0",
"fantasyEnabled": false
},
"status": "success",
"info": {
"hitsToday": 21,
"hitsLimit": 500,
"credits": 0,
"server": 11,
"queryTime": 15.7629
}
}
Code Playground
Player Info
Detailed info about the PlayerBasic details about the player are provided in this API. In future we will include a player photograph (coming soon).
status | String success / failure based on the API result | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | An array / object containing this Player detail
|
Output{
"apikey": "[your api key]",
"offset": 0,
"id": "16592242-ef26-45d9-bf23-fc090e90fbbe"
}
(data may be truncated for ease of reading)
{
"apikey": "[your api key]",
"data": {
"id": "16592242-ef26-45d9-bf23-fc090e90fbbe",
"name": "Anderson Phillip",
"dateOfBirth": "1996-08-22T00:00:00",
"role": "Bowler",
"battingStyle": "Right Handed Bat",
"bowlingStyle": "Right-arm fast-medium",
"placeOfBirth": "--",
"country": "West Indies"
},
"status": "success",
"info": {
"hitsToday": 41,
"hitsLimit": 500,
"credits": 0,
"server": 11,
"queryTime": 10
}
}
Code Playground
Fantasy API
Work in Progress Detailed Scorecard, Squad and Ball-By-Ball APIsFantasy API includes Scorecard, Ball-by-Ball and Squad API for each match. This is still a work in progress, so expect more changes to come in the future!