ALL SPORTS API - Cricket API Version 2.0
Welcome to the documentation page of AllSportsAPI.com Cricket service. Please find bellow the full list of the methods you can relay on to get real time Cricket data helping you build awesome applications.
Leagues
Method
GET/POST
https://apiv2.allsportsapi.com/cricket/?met=Leagues
Returns list of supported competitions included in your current subscription plan
Parameters
Parameter | Description |
---|---|
action | API method name |
APIkey | Authorization code generated from your allsportsapi account |
Request URL
JSON Response
{ "success": 1, "result": [ { "league_key": "731", "league_name": "Pakistan Cup", "league_year": "2021/22" }, { "league_key": "729", "league_name": "Pakistan Super League", "league_year": "2021/22" }, { "league_key": "727", "league_name": "Plunket Shield", "league_year": "2021/22" }, ....... ] }
PHP call example
$APIkey=!_your_account_APIkey_!; $curl_options = array( CURLOPT_URL => "https://apiv2.allsportsapi.com/cricket/?met=Leagues&APIkey=$APIkey", CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false, CURLOPT_TIMEOUT => 30, CURLOPT_CONNECTTIMEOUT => 5 ); $curl = curl_init(); curl_setopt_array( $curl, $curl_options ); $result = curl_exec( $curl ); $result = (array) json_decode($result); var_dump($result);
Fixtures
Method
GET/POST
https://apiv2.allsportsapi.com/cricket/?met=Fixtures
Returns events included in your current subscription plan
Parameters
Parameter | Description |
---|---|
action | API method name |
APIkey | Authorization code generated from your allsportsapi account |
timezone | The timezone where you want to receive the data in tz format (exemple: America/New_York). Default timezone: Europe/Berlin (Optional) |
from | Start date (yyyy-mm-dd) |
to | Stop date (yyyy-mm-dd) |
leagueId | League ID - if set events from specific league will be returned (Optional) |
matchId | Match ID - if set only details from specific match will be returned (Optional) |
Request URL
JSON Response
{ "success": 1, "result": [ { "event_key": "2", "event_date_start": "2022-03-16", "event_date_stop": "2022-03-18", "event_time": "00:30", "event_home_team": "Tasmania", "home_team_key": "3", "event_away_team": "Victoria", "away_team_key": "2", "event_service_home": "", "event_service_away": "", "event_home_final_result": "355", "event_away_final_result": "210/4", "event_home_rr": null, "event_away_rr": null, "event_status": "Stumps", "event_status_info": "Day 2 - Victoria trail by 145 runs.", "country_name": "Cricket", "league_name": "Sheffield Shield", "league_key": "726", "league_round": "", "league_season": "2021/22", "event_live": "0", "event_type": "First-class", "event_toss": "Tasmania, elected to bat first", "event_man_of_match": "", "event_stadium": "Junction Oval, Melbourne", "event_home_team_logo": "https://apiv2.allsportsapi.com/logo-cricket/3_tasmania.png", "event_away_team_logo": "https://apiv2.allsportsapi.com/logo-cricket/2_victoria.png", "scorecard": { "Victoria 1 INN": [ { "innings": "Victoria 1 INN", "player": "J Seymour", "type": "Batsman", "status": "lbw b Bird", "R": "10", "B": "26", "Min": "0", "4s": "1", "6s": "0", "O": null, "M": null, "W": null, "SR": "38.46", "ER": null }, ............. ], ........ }, "comments": { "Victoria 2 INN": [ { "innings": "Victoria 2 INN", "balls": "6", "overs": "71.6", "ended": "No", "runs": "0", "post": "Manenti to Harper, no run" }, { "innings": "Victoria 2 INN", "balls": "5", "overs": "71.5", "ended": "No", "runs": "0", "post": "Manenti to Harper, no run" }, ........... ], .......... }, "lineups": { "home_team": { "starting_lineups": [ { "player": "Cameron Bancroft", "player_country": "" }, { "player": "Sam Whiteman", "player_country": "" }, { "player": "Shaun Marsh", "player_country": "" }, .......... ], ....... }, .......... }, "wickets": { "Western Australia 1 INN": [ { "innings": "Western Australia 1 INN", "fall": "87.2 ov", "balwer": "Cameron Bancroft", "batsman": " lbw b Tremain 117 ", "score": "211/3" }, ......... ], ....... }, "extra": { "Western Australia 1 INN": { "innings": "Western Australia 1 INN", "nr": "12.00", "text": "(w 1, lb 10)", "total_overs": null, "total": "231 ( 96 )", "percent_over": null }, .......... }, }, ........... ] }
PHP call example
$APIkey=!_your_account_APIkey_!; $from = '2022-03-16'; $to = '2022-03-16'; $curl_options = array( CURLOPT_URL => "https://apiv2.allsportsapi.com/cricket/?met=Fixtures&APIkey=$APIkey&from=$from&to=$to", CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false, CURLOPT_TIMEOUT => 30, CURLOPT_CONNECTTIMEOUT => 5 ); $curl = curl_init(); curl_setopt_array( $curl, $curl_options ); $result = curl_exec( $curl ); $result = (array) json_decode($result); var_dump($result);
Livescore
Method
GET/POST
https://apiv2.allsportsapi.com/cricket/?met=Livescore
Returns playing now events included in your current subscription plan
Parameters
Parameter | Description |
---|---|
action | API method name |
APIkey | Authorization code generated from your allsportsapi account |
timezone | The timezone where you want to receive the data in tz format (exemple: America/New_York). Default timezone: Europe/Berlin (Optional) |
leagueId | League ID - if set events from specific league will be returned (Optional) |
matchId | Match ID - if set only details from specific match will be returned (Optional) |
Request URL
JSON Response
{ "success": 1, "result": [ { "event_key": "490", "event_date_start": "2022-03-16", "event_date_stop": "2022-03-20", "event_time": "15:00", "event_home_team": "England", "home_team_key": "135", "event_away_team": "West Indies", "away_team_key": "134", "event_service_home": "", "event_service_away": "", "event_home_final_result": "29/1", "event_away_final_result": "", "event_home_rr": null, "event_away_rr": null, "event_status": "In Progress", "event_status_info": "Day 1 - Session 1: England chose to bat.", "country_name": "Cricket", "league_name": "England tour of West Indies", "league_key": "741", "league_round": "", "league_season": "2021/22", "event_live": "1", "event_type": "TEST", "event_toss": "England, elected to bat first", "event_man_of_match": "", "event_stadium": "Kensington Oval, Bridgetown, Barbados", "event_home_team_logo": "https://apiv2.allsportsapi.com/logo-cricket/135_england.png", "event_away_team_logo": "https://apiv2.allsportsapi.com/logo-cricket/134_west_indies.png", "scorecard": { "England 1 INN": [ { "innings": "England 1 INN", "player": "AZ Lees", "type": "Batsman", "status": "not out", "R": "11", "B": "48", "Min": "0", "4s": "2", "6s": "0", "O": null, "M": null, "W": null, "SR": "22.91", "ER": null }, ........... ], ......... }, "comments": { "Live": [ { "innings": "Live", "balls": "1", "overs": "16.1", "ended": "No", "runs": "0", "post": "Permaul to Root" }, { "innings": "Live", "balls": "6", "overs": "15.6", "ended": "No", "runs": "0", "post": "Joseph to Lees" }, ............ ], ........ }, "wickets": { "England 1 INN": [ { "innings": "England 1 INN", "fall": "3.1 ov", "balwer": "Z Crawley", "batsman": " c ?Da Silva b Seales 0 ", "score": "4/1" }, ......... ], .......... }, "extra": { "England 1 INN": { "innings": "England 1 INN", "nr": "0.00", "text": "()", "total_overs": null, "total": "29 ( 16.1 )", "percent_over": null }, .......... }, "lineups": { "home_team": { "starting_lineups": [ { "player": "AZ Lees", "player_country": "" }, { "player": "Z Crawley", "player_country": "" }, ........... ], ............ }, ......... } }, ....... ] }
PHP call example
$APIkey=!_your_account_APIkey_!; $curl_options = array( CURLOPT_URL => "https://apiv2.allsportsapi.com/cricket/?met=Livescore&APIkey=$APIkey", CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false, CURLOPT_TIMEOUT => 30, CURLOPT_CONNECTTIMEOUT => 5 ); $curl = curl_init(); curl_setopt_array( $curl, $curl_options ); $result = curl_exec( $curl ); $result = (array) json_decode($result); var_dump($result);
H2H (Head to Head)
Method
GET/POST
https://apiv2.allsportsapi.com/cricket/?met=H2H
Returns the last games between submiteted teams and the last games of each team
Parameters
Parameter | Description |
---|---|
action | API method name |
APIkey | Authorization code generated from your allsportsapi account |
timezone | The timezone where you want to receive the data in tz format (exemple: America/New_York). Default timezone: Europe/Berlin (Optional) |
firstTeamId | First team Id |
secondTeamId | Second team Id |
Request URL
JSON Response
{ "success": 1, "result": { "H2H": [ { "event_key": "489", "event_date_start": null, "event_date_stop": null, "event_time": null, "event_home_team": "England", "home_team_key": "135", "event_away_team": "West Indies", "away_team_key": "134", "event_service_home": "", "event_service_away": "target 286", "event_home_final_result": "311 & 349/6d", "event_away_final_result": "375 & 147/4", "event_home_rr": null, "event_away_rr": null, "event_status": "Finished", "event_status_info": "Match drawn", "league_name": "England tour of West Indies", "league_key": "741", "league_round": "1st Test", "league_season": "", "event_live": "0" }, ....... ], "firstTeamResults": [ { "event_key": "489", "event_date_start": null, "event_date_stop": null, "event_time": null, "event_home_team": "England", "home_team_key": "135", "event_away_team": "West Indies", "away_team_key": "134", "event_service_home": "", "event_service_away": "target 286", "event_home_final_result": "311 & 349/6d", "event_away_final_result": "375 & 147/4", "event_home_rr": null, "event_away_rr": null, "event_status": "Finished", "event_status_info": "Match drawn", "league_name": "England tour of West Indies", "league_key": "741", "league_round": "1st Test", "league_season": "", "event_live": "0" }, ........ ], "secondTeamResults": [ { "event_key": "489", "event_date_start": null, "event_date_stop": null, "event_time": null, "event_home_team": "England", "home_team_key": "135", "event_away_team": "West Indies", "away_team_key": "134", "event_service_home": "", "event_service_away": "target 286", "event_home_final_result": "311 & 349/6d", "event_away_final_result": "375 & 147/4", "event_home_rr": null, "event_away_rr": null, "event_status": "Finished", "event_status_info": "Match drawn", "league_name": "England tour of West Indies", "league_key": "741", "league_round": "1st Test", "league_season": "", "event_live": "0" }, ......... ] } }
PHP call example
$APIkey=!_your_account_APIkey_!; $firstTeamId=135; $secondTeamId=134; $curl_options = array( CURLOPT_URL => "https://apiv2.allsportsapi.com/cricket/?met=H2H&APIkey=$APIkey&firstTeamId=$firstTeamId&secondTeamId=$secondTeamId", CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false, CURLOPT_TIMEOUT => 30, CURLOPT_CONNECTTIMEOUT => 5 ); $curl = curl_init(); curl_setopt_array( $curl, $curl_options ); $result = curl_exec( $curl ); $result = (array) json_decode($result); var_dump($result);
Standings
Method
GET/POST
https://apiv2.allsportsapi.com/cricket/?met=Standings
Returns standings for leagues included in your current subscription plan
Parameters
Parameter | Description |
---|---|
action | API method name |
APIkey | Authorization code generated from your allsportsapi account |
leagueId | League internal code |
Request URL
JSON Response
{ "success": 1, "result": { "total": [ { "standing_place": "1", "standing_place_type": "", "standing_team": "Titans", "standing_MP": "2", "standing_W": "2", "standing_L": "0", "standing_NR": "0", "standing_R": "", "standing_NRR": "", "standing_Pts": "9", "team_key": "15", "league_key": "750", "league_round": "", "standing_updated": "2022-03-16 15:31:04" }, { "standing_place": "2", "standing_place_type": "", "standing_team": "North West", "standing_MP": "2", "standing_W": "1", "standing_L": "0", "standing_NR": "1", "standing_R": "", "standing_NRR": "", "standing_Pts": "6", "team_key": "18", "league_key": "750", "league_round": "", "standing_updated": "2022-03-16 15:31:04" }, ......... ], } }
PHP call example
$APIkey=!_your_account_APIkey_!; $leagueId = 750; $curl_options = array( CURLOPT_URL => "https://apiv2.allsportsapi.com/cricket/?met=Leagues&APIkey=$APIkey&leagueId=$leagueId", CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false, CURLOPT_TIMEOUT => 30, CURLOPT_CONNECTTIMEOUT => 5 ); $curl = curl_init(); curl_setopt_array( $curl, $curl_options ); $result = curl_exec( $curl ); $result = (array) json_decode($result); var_dump($result);
Teams
Method
GET/POST
https://apiv2.allsportsapi.com/cricket/?met=Teams
Returns teams for leagues included in your current subscription plan
Parameters
Parameter | Description |
---|---|
action | API method name |
APIkey | Authorization code generated from your allsportsapi account |
teamId | Team internal code |
leagueId | League internal code |
Request URL
JSON Response
{ "success": 1, "result": [ { "team_key": "7", "team_name": "TBA", "team_logo": null }, { "team_key": "14", "team_name": "Dolphins", "team_logo": "https://apiv2.allsportsapi.com/logo-cricket/14_dolphins.png" }, { "team_key": "15", "team_name": "Titans", "team_logo": "https://apiv2.allsportsapi.com/logo-cricket/15_titans.png" }, ..... ] }
PHP call example
$APIkey=!_your_account_APIkey_!; $leagueId = 750; $curl_options = array( CURLOPT_URL => "https://apiv2.allsportsapi.com/cricket/?met=Teams&APIkey=$APIkey&leagueId=$leagueId", CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false, CURLOPT_TIMEOUT => 30, CURLOPT_CONNECTTIMEOUT => 5 ); $curl = curl_init(); curl_setopt_array( $curl, $curl_options ); $result = curl_exec( $curl ); $result = (array) json_decode($result); var_dump($result);
Odds
Method
GET/POST
cricket/?met=Odds
Returns odds for events included in your current subscription plan
Parameters
Parameter | Description |
---|---|
action | API method name |
APIkey | Authorization code generated from your allsportsapi account |
from | Start date (yyyy-mm-dd) |
to | Stop date (yyyy-mm-dd) |
countryId | Country ID - if set only events from specific country will be returned (Optional) |
leagueId | League ID - if set events from specific league will be returned (Optional) |
matchId | Match ID - if set only details from specific match will be returned (Optional) |
Request URL
JSON Response
{ "success": 1, "result": { "490": { "3Way Result": { "Home": { "bwin": "3.25", "NordicBet": "3.40", "bet365": "3.00", "Marathon": "3.32", "Betsson": "3.40", "Pncl": "3.18", "1xbet": "3.08", "Sportingbet": "3.25", "Betway": "3.25", "Betcris": "3.10" }, "Draw": { "bwin": "4.00", "NordicBet": "4.00", "bet365": "4.50", "Marathon": "4.30", "Betsson": "4.00", "Pncl": "4.11", "1xbet": "4.60", "Sportingbet": "4.00", "Betway": "3.75", "Betcris": "4.00" }, "Away": { "bwin": "1.91", "NordicBet": "1.92", "bet365": "1.95", "Marathon": "1.99", "Betsson": "1.92", "Pncl": "1.96", "1xbet": "1.99", "Sportingbet": "1.91", "Betway": "1.91", "Betcris": "1.88" } }, "Home/Away": { "Home": { "NordicBet": "2.60", "bet365": "2.50", "Marathon": "2.56", "Unibet": "2.30", "Betsson": "2.60", "1xbet": "2.35", "Betway": "2.63" }, "Away": { "NordicBet": "1.48", "bet365": "1.53", "Marathon": "1.55", "Unibet": "1.60", "Betsson": "1.48", "1xbet": "1.62", "Betway": "1.45" } }, ......... } } }
PHP call example
$APIkey=!_your_account_APIkey_!; $matchId = 490; $curl_options = array( CURLOPT_URL => "https://apiv2.allsportsapi.com/cricket/?met=Odds&APIkey=$APIkey&matchId=$matchId", CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false, CURLOPT_TIMEOUT => 30, CURLOPT_CONNECTTIMEOUT => 5 ); $curl = curl_init(); curl_setopt_array( $curl, $curl_options ); $result = curl_exec( $curl ); $result = (array) json_decode($result); var_dump($result);