ALL SPORTS API - Cricket API Version 1.0 (old version)
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.
Countries
Method
GET/POST
api/cricket/?met=Countries
Returns list of supported countries included in your current subscription plan
Parameters
Parameter | Description |
---|---|
met | API method name |
APIkey | Authorization code generated from your allsportsapi account |
Request URL
JSON Response
{ "success": 1, "result": [ { "country_key": "626", "country_name": "Afghanistan" }, { "country_key": "631", "country_name": "Africa" }, { "country_key": "511", "country_name": "Asia" }, { "country_key": "502", "country_name": "Australia" }, { "country_key": "503", "country_name": "Bangladesh" }, { "country_key": "627", "country_name": "Canada" }, { "country_key": "628", "country_name": "Hong Kong" }, { "country_key": "504", "country_name": "India" }, { "country_key": "505", "country_name": "New Zealand" }, { "country_key": "512", "country_name": "North & Central America" }, { "country_key": "506", "country_name": "Pakistan" }, { "country_key": "507", "country_name": "South Africa" }, { "country_key": "508", "country_name": "Sri Lanka" }, { "country_key": "509", "country_name": "United Kingdom" }, { "country_key": "513", "country_name": "World" }, { "country_key": "510", "country_name": "Zimbabwe" } ] }
PHP call example
$APIkey='!_your_account_APIkey_!'; $curl_options = array( CURLOPT_URL => "https://allsportsapi.com/api/cricket/?met=Countries&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);
Leagues
Method
GET/POST
api/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 |
countryId | Country ID - if set only leagues from specific country will be returned (Optional) |
Request URL
JSON Response
{ "success": 1, "result": [ { "league_key": "9788", "league_name": "Deodhar Trophy", "country_key": "504", "country_name": "India" }, { "league_key": "9789", "league_name": "Duleep Trophy", "country_key": "504", "country_name": "India" }, { "league_key": "9785", "league_name": "IPL", "country_key": "504", "country_name": "India" }, { "league_key": "9790", "league_name": "Irani Cup", "country_key": "504", "country_name": "India" }, { "league_key": "9786", "league_name": "Karnataka Premier League", "country_key": "504", "country_name": "India" }, { "league_key": "9791", "league_name": "North India Champions League", "country_key": "504", "country_name": "India" }, { "league_key": "9787", "league_name": "Ranji Trophy", "country_key": "504", "country_name": "India" }, { "league_key": "9792", "league_name": "Syed Mushtaq Ali Trophy", "country_key": "504", "country_name": "India" }, { "league_key": "9793", "league_name": "Tamil Nadu Premier League", "country_key": "504", "country_name": "India" }, { "league_key": "9794", "league_name": "Vijay Hazare Trophy", "country_key": "504", "country_name": "India" } ....... ] }
PHP call example
$APIkey=!_your_account_APIkey_!; $countryId = 504; $curl_options = array( CURLOPT_URL => "https://allsportsapi.com/api/cricket/?met=Leagues&APIkey=$APIkey&countryId=$countryId", 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
api/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) |
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": [ { "event_key": "391", "event_date_start": "2019-03-13", "event_date_stop": "2019-03-13", "event_time": "09:00", "event_home_team": "India", "home_team_key": "30", "event_away_team": "Australia", "away_team_key": "5", "event_service_home": "", "event_service_away": "", "event_home_final_result": "237/10 (50)", "event_away_final_result": "272/9 (50)", "event_home_rr": "RR 4.74", "event_away_rr": "RR 5.44", "event_status": "Finished", "event_status_info": "Australia won by 35 runs.", "country_name": "World", "league_name": "One Day International", "league_key": "9847", "league_round": "", "league_season": "2019", "event_live": "0", "event_home_team_logo": "https://allsportsapi.com/logo-cricket/30_india.png", "event_away_team_logo": "https://allsportsapi.com/logo-cricket/5_australia.png", "scorecard": { "AUS Innings": [ { "innings": "AUS Innings", "player": "Khawaja U.", "type": "Batsman", "status": "c Kohli V. b Kumar B.", "R": "100", "B": "106", "Min": "133", "4s": "10", "6s": "2", "SR": "94.34" }, { "innings": "AUS Innings", "player": "Finch A.", "type": "Batsman", "status": "b Jadeja R.", "R": "27", "B": "43", "Min": "60", "4s": "4", "6s": "0", "SR": "62.79" }, { "innings": "AUS Innings", "player": "Handscomb P.", "type": "Batsman", "status": "c Pant R. b Shami M.", "R": "52", "B": "60", "Min": "91", "4s": "4", "6s": "0", "SR": "86.67" }, { "innings": "AUS Innings", "player": "Maxwell G.", "type": "Batsman", "status": "c Kohli V. b Jadeja R.", "R": "1", "B": "3", "Min": "6", "4s": "0", "6s": "0", "SR": "33.33" }, { "innings": "AUS Innings", "player": "Stoinis M.", "type": "Batsman", "status": "b Kumar B.", "R": "20", "B": "27", "Min": "49", "4s": "1", "6s": "1", "SR": "74.07" }, { "innings": "AUS Innings", "player": "Turner A.", "type": "Batsman", "status": "c Jadeja R. b Yadav K.", "R": "20", "B": "20", "Min": "21", "4s": "2", "6s": "1", "SR": "100.00" }, { "innings": "AUS Innings", "player": "Carey A.", "type": "Batsman", "status": "c Pant R. b Shami M.", "R": "3", "B": "9", "Min": "22", "4s": "0", "6s": "0", "SR": "33.33" }, { "innings": "AUS Innings", "player": "Richardson J.", "type": "Batsman", "status": "run out Kohli V.", "R": "29", "B": "21", "Min": "28", "4s": "3", "6s": "0", "SR": "138.10" }, { "innings": "AUS Innings", "player": "Cummins P.", "type": "Batsman", "status": "c & b Kumar B.", "R": "15", "B": "8", "Min": "14", "4s": "2", "6s": "0", "SR": "187.50" }, { "innings": "AUS Innings", "player": "Lyon N.", "type": "Batsman", "status": "not out", "R": "1", "B": "3", "Min": "8", "4s": "0", "6s": "0", "SR": "33.33" }, { "innings": "AUS Innings", "player": "Jadhav K.", "type": "Bowler", "status": "", "R": "8", "O": "1", "M": "0", "W": "0", "ER": "8.00" }, { "innings": "AUS Innings", "player": "Jadeja R.", "type": "Bowler", "status": "", "R": "45", "O": "10", "M": "0", "W": "2", "ER": "4.50" }, { "innings": "AUS Innings", "player": "Kumar B.", "type": "Bowler", "status": "", "R": "48", "O": "10", "M": "0", "W": "3", "ER": "4.80" }, { "innings": "AUS Innings", "player": "Yadav K.", "type": "Bowler", "status": "", "R": "74", "O": "10", "M": "0", "W": "1", "ER": "7.40" }, { "innings": "AUS Innings", "player": "Shami M.", "type": "Bowler", "status": "", "R": "57", "O": "9", "M": "0", "W": "2", "ER": "6.33" }, { "innings": "AUS Innings", "player": "Bumrah J.", "type": "Bowler", "status": "", "R": "39", "O": "10", "M": "0", "W": "0", "ER": "3.90" }, { "innings": "AUS Innings", "player": "Khawaja U. / Finch A.", "type": "Partnership", "status": "", "pos": "1", "R": "76", "B": "87", "Min": "60", "SR": "87.36" }, { "innings": "AUS Innings", "player": "Khawaja U. / Handscomb P.", "type": "Partnership", "status": "", "pos": "2", "R": "99", "B": "111", "Min": "73", "SR": "89.19" }, { "innings": "AUS Innings", "player": "Maxwell G. / Handscomb P.", "type": "Partnership", "status": "", "pos": "3", "R": "3", "B": "5", "Min": "6", "SR": "60.00" }, { "innings": "AUS Innings", "player": "Handscomb P. / Stoinis M.", "type": "Partnership", "status": "", "pos": "4", "R": "4", "B": "15", "Min": "12", "SR": "26.67" }, { "innings": "AUS Innings", "player": "Turner A. / Stoinis M.", "type": "Partnership", "status": "", "pos": "5", "R": "28", "B": "30", "Min": "21", "SR": "93.33" }, { "innings": "AUS Innings", "player": "Stoinis M. / Carey A.", "type": "Partnership", "status": "", "pos": "6", "R": "15", "B": "18", "Min": "16", "SR": "83.33" }, { "innings": "AUS Innings", "player": "Richardson J. / Carey A.", "type": "Partnership", "status": "", "pos": "7", "R": "4", "B": "9", "Min": "6", "SR": "44.44" }, { "innings": "AUS Innings", "player": "Cummins P. / Richardson J.", "type": "Partnership", "status": "", "pos": "8", "R": "34", "B": "16", "Min": "14", "SR": "212.50" }, { "innings": "AUS Innings", "player": "Lyon N. / Richardson J.", "type": "Partnership", "status": "", "pos": "9", "R": "9", "B": "9", "Min": "8", "SR": "100.00" } ], "IND Innings": [ { "innings": "IND Innings", "player": "Sharma R.", "type": "Batsman", "status": "st Carey A. b Zampa A.", "R": "56", "B": "89", "Min": "113", "4s": "4", "6s": "0", "SR": "62.92" }, { "innings": "IND Innings", "player": "Dhawan S.", "type": "Batsman", "status": "c Carey A. b Cummins P.", "R": "12", "B": "15", "Min": "17", "4s": "2", "6s": "0", "SR": "80.00" }, { "innings": "IND Innings", "player": "Kohli V.", "type": "Batsman", "status": "c Carey A. b Stoinis M.", "R": "20", "B": "22", "Min": "35", "4s": "2", "6s": "0", "SR": "90.91" }, { "innings": "IND Innings", "player": "Pant R.", "type": "Batsman", "status": "c Turner A. b Lyon N.", "R": "16", "B": "16", "Min": "24", "4s": "1", "6s": "1", "SR": "100.00" }, { "innings": "IND Innings", "player": "Shankar V.", "type": "Batsman", "status": "c Khawaja U. b Zampa A.", "R": "16", "B": "21", "Min": "23", "4s": "0", "6s": "1", "SR": "76.19" }, { "innings": "IND Innings", "player": "Jadhav K.", "type": "Batsman", "status": "c Maxwell G. b Richardson J.", "R": "44", "B": "57", "Min": "89", "4s": "4", "6s": "1", "SR": "77.19" }, { "innings": "IND Innings", "player": "Jadeja R.", "type": "Batsman", "status": "st Carey A. b Zampa A.", "R": "0", "B": "3", "Min": "6", "4s": "0", "6s": "0", "SR": "0.00" }, { "innings": "IND Innings", "player": "Kumar B.", "type": "Batsman", "status": "c Finch A. b Cummins P.", "R": "46", "B": "54", "Min": "66", "4s": "3", "6s": "2", "SR": "85.19" }, { "innings": "IND Innings", "player": "Yadav K.", "type": "Batsman", "status": "b Stoinis M.", "R": "9", "B": "12", "Min": "17", "4s": "1", "6s": "0", "SR": "75.00" }, { "innings": "IND Innings", "player": "Shami M.", "type": "Batsman", "status": "c & b Richardson J.", "R": "3", "B": "7", "Min": "13", "4s": "0", "6s": "0", "SR": "42.86" }, { "innings": "IND Innings", "player": "Bumrah J.", "type": "Batsman", "status": "not out", "R": "1", "B": "4", "Min": "7", "4s": "0", "6s": "0", "SR": "25.00" }, { "innings": "IND Innings", "player": "Maxwell G.", "type": "Bowler", "status": "", "R": "34", "O": "6", "M": "0", "W": "0", "ER": "5.67" }, { "innings": "IND Innings", "player": "Stoinis M.", "type": "Bowler", "status": "", "R": "31", "O": "4", "M": "0", "W": "2", "ER": "7.75" }, { "innings": "IND Innings", "player": "Richardson J.", "type": "Bowler", "status": "", "R": "48", "O": "10", "M": "0", "W": "2", "ER": "4.80" }, { "innings": "IND Innings", "player": "Cummins P.", "type": "Bowler", "status": "", "R": "38", "O": "10", "M": "1", "W": "2", "ER": "3.80" }, { "innings": "IND Innings", "player": "Lyon N.", "type": "Bowler", "status": "", "R": "34", "O": "10", "M": "1", "W": "1", "ER": "3.40" }, { "innings": "IND Innings", "player": "Zampa A.", "type": "Bowler", "status": "", "R": "46", "O": "10", "M": "1", "W": "3", "ER": "4.60" }, { "innings": "IND Innings", "player": "Dhawan S. / Sharma R.", "type": "Partnership", "status": "", "pos": "1", "R": "15", "B": "26", "Min": "17", "SR": "57.69" }, { "innings": "IND Innings", "player": "Kohli V. / Sharma R.", "type": "Partnership", "status": "", "pos": "2", "R": "53", "B": "49", "Min": "35", "SR": "108.16" }, { "innings": "IND Innings", "player": "Sharma R. / Pant R.", "type": "Partnership", "status": "", "pos": "3", "R": "23", "B": "32", "Min": "24", "SR": "71.88" }, { "innings": "IND Innings", "player": "Sharma R. / Shankar V.", "type": "Partnership", "status": "", "pos": "4", "R": "29", "B": "41", "Min": "23", "SR": "70.73" }, { "innings": "IND Innings", "player": "Jadhav K. / Sharma R.", "type": "Partnership", "status": "", "pos": "5", "R": "12", "B": "22", "Min": "14", "SR": "54.55" }, { "innings": "IND Innings", "player": "Jadeja R. / Jadhav K.", "type": "Partnership", "status": "", "pos": "6", "R": "0", "B": "3", "Min": "6", "SR": "0.00" }, { "innings": "IND Innings", "player": "Kumar B. / Jadhav K.", "type": "Partnership", "status": "", "pos": "7", "R": "91", "B": "103", "Min": "66", "SR": "88.35" }, { "innings": "IND Innings", "player": "Shami M. / Jadhav K.", "type": "Partnership", "status": "", "pos": "8", "R": "0", "B": "1", "Min": "3", "SR": "0.00" }, { "innings": "IND Innings", "player": "Shami M. / Yadav K.", "type": "Partnership", "status": "", "pos": "9", "R": "7", "B": "14", "Min": "10", "SR": "50.00" }, { "innings": "IND Innings", "player": "Bumrah J. / Yadav K.", "type": "Partnership", "status": "", "pos": "10", "R": "7", "B": "9", "Min": "7", "SR": "77.78" } ] }, "ball_by_ball": { "AUS Innings": [ { "innings": "AUS Innings", "nr": "50", "balls": ".|.|1|1B|4|1,W", "runs": "7", "bowler_to_batsma": "Bumrah J. to Richardson J. & Lyon N." }, { "innings": "AUS Innings", "nr": "49", "balls": "1|2|W|1|1|.", "runs": "5", "bowler_to_batsma": "Kumar B. to Richardson J., Cummins P. & Lyon N." }, { "innings": "AUS Innings", "nr": "48", "balls": "2|4|4|4|1|4", "runs": "19", "bowler_to_batsma": "Bumrah J. to Richardson J. & Cummins P." }, { "innings": "AUS Innings", "nr": "47", "balls": ".|4|3|1|1|1WD|1", "runs": "11", "bowler_to_batsma": "Kumar B. to Cummins P. & Richardson J." }, { "innings": "AUS Innings", "nr": "46", "balls": ".|.|1|.|W|1", "runs": "2", "bowler_to_batsma": "Shami M. to Richardson J., Carey A. & Cummins P." }, { "innings": "AUS Innings", "nr": "45", "balls": "1|W|2|.|.|1", "runs": "4", "bowler_to_batsma": "Kumar B. to Carey A., Stoinis M. & Richardson J." }, { "innings": "AUS Innings", "nr": "44", "balls": "1|1|1|1|2|.", "runs": "6", "bowler_to_batsma": "Shami M. to Stoinis M. & Carey A." }, { "innings": "AUS Innings", "nr": "43", "balls": ".|.|1|.|.|.", "runs": "1", "bowler_to_batsma": "Bumrah J. to Stoinis M. & Carey A." }, { "innings": "AUS Innings", "nr": "42", "balls": "6|1WD|W|6|.|1|.", "runs": "14", "bowler_to_batsma": "Yadav K. to Turner A., Stoinis M. & Carey A." }, { "innings": "AUS Innings", "nr": "41", "balls": ".|1|.|.|.|.", "runs": "1", "bowler_to_batsma": "Bumrah J. to Turner A. & Stoinis M." }, { "innings": "AUS Innings", "nr": "40", "balls": ".|1|1|.|1|.", "runs": "3", "bowler_to_batsma": "Yadav K. to Turner A. & Stoinis M." }, { "innings": "AUS Innings", "nr": "39", "balls": ".|1|.|.|1|4", "runs": "6", "bowler_to_batsma": "Shami M. to Stoinis M. & Turner A." }, { "innings": "AUS Innings", "nr": "38", "balls": "1|.|.|.|4|.", "runs": "5", "bowler_to_batsma": "Jadeja R. to Stoinis M. & Turner A." }, { "innings": "AUS Innings", "nr": "37", "balls": ".|W|4|2|.|.", "runs": "6", "bowler_to_batsma": "Shami M. to Handscomb P. & Turner A." }, { "innings": "AUS Innings", "nr": "36", "balls": "1|.|.|1|.|1", "runs": "3", "bowler_to_batsma": "Jadeja R. to Handscomb P. & Stoinis M." }, { "innings": "AUS Innings", "nr": "35", "balls": ".|.|.|1|.|.", "runs": "1", "bowler_to_batsma": "Kumar B. to Handscomb P. & Stoinis M." }, { "innings": "AUS Innings", "nr": "34", "balls": "1|.|1|1|W|.", "runs": "3", "bowler_to_batsma": "Jadeja R. to Handscomb P., Maxwell G. & Stoinis M." }, { "innings": "AUS Innings", "nr": "33", "balls": ".|1|.|.|.|W", "runs": "1", "bowler_to_batsma": "Kumar B. to Handscomb P. & Khawaja U." }, { "innings": "AUS Innings", "nr": "32", "balls": "1|2|4|1|1|1", "runs": "10", "bowler_to_batsma": "Yadav K. to Khawaja U. & Handscomb P." }, { "innings": "AUS Innings", "nr": "31", "balls": ".|1|.|.|2|.", "runs": "3", "bowler_to_batsma": "Bumrah J. to Khawaja U. & Handscomb P." }, { "innings": "AUS Innings", "nr": "30", "balls": ".|2|.|.|.|1", "runs": "3", "bowler_to_batsma": "Yadav K. to Khawaja U." }, { "innings": "AUS Innings", "nr": "29", "balls": ".|.|.|.|1|.", "runs": "1", "bowler_to_batsma": "Bumrah J. to Khawaja U. & Handscomb P." }, { "innings": "AUS Innings", "nr": "28", "balls": ".|1|1|1|1|1", "runs": "5", "bowler_to_batsma": "Yadav K. to Khawaja U. & Handscomb P." }, { "innings": "AUS Innings", "nr": "27", "balls": ".|1|.|1|4|1", "runs": "7", "bowler_to_batsma": "Jadeja R. to Khawaja U. & Handscomb P." }, { "innings": "AUS Innings", "nr": "26", "balls": "1|1|6|.|.|1", "runs": "9", "bowler_to_batsma": "Yadav K. to Khawaja U. & Handscomb P." }, { "innings": "AUS Innings", "nr": "25", "balls": "1|.|4|1|1|1", "runs": "8", "bowler_to_batsma": "Jadeja R. to Handscomb P. & Khawaja U." }, { "innings": "AUS Innings", "nr": "24", "balls": "1|4|.|2|.|.", "runs": "7", "bowler_to_batsma": "Shami M. to Handscomb P. & Khawaja U." }, { "innings": "AUS Innings", "nr": "23", "balls": ".|.|1|.|.|1", "runs": "2", "bowler_to_batsma": "Jadeja R. to Khawaja U. & Handscomb P." }, { "innings": "AUS Innings", "nr": "22", "balls": "2|1|4|.|.|1", "runs": "8", "bowler_to_batsma": "Shami M. to Handscomb P. & Khawaja U." }, { "innings": "AUS Innings", "nr": "21", "balls": "3|.|1|.|1|1", "runs": "6", "bowler_to_batsma": "Jadeja R. to Khawaja U. & Handscomb P." }, { "innings": "AUS Innings", "nr": "20", "balls": "4|.|1|1|1|1", "runs": "8", "bowler_to_batsma": "Jadhav K. to Handscomb P. & Khawaja U." }, { "innings": "AUS Innings", "nr": "19", "balls": "1|.|1|.|.|1", "runs": "3", "bowler_to_batsma": "Jadeja R. to Handscomb P. & Khawaja U." }, { "innings": "AUS Innings", "nr": "18", "balls": ".|.|.|2|1|.", "runs": "3", "bowler_to_batsma": "Yadav K. to Handscomb P. & Khawaja U." }, { "innings": "AUS Innings", "nr": "17", "balls": ".|1|1|1|1|.", "runs": "4", "bowler_to_batsma": "Jadeja R. to Khawaja U. & Handscomb P." }, { "innings": "AUS Innings", "nr": "16", "balls": "1|.|1|4|4|.", "runs": "10", "bowler_to_batsma": "Yadav K. to Handscomb P. & Khawaja U." }, { "innings": "AUS Innings", "nr": "15", "balls": "2|1|W|.|.|1", "runs": "4", "bowler_to_batsma": "Jadeja R. to Khawaja U., Finch A. & Handscomb P." }, { "innings": "AUS Innings", "nr": "14", "balls": "1WD|1|4|.|.|.|.", "runs": "6", "bowler_to_batsma": "Yadav K. to Khawaja U. & Finch A." }, { "innings": "AUS Innings", "nr": "13", "balls": ".|.|.|.|2|.", "runs": "2", "bowler_to_batsma": "Bumrah J. to Finch A." }, { "innings": "AUS Innings", "nr": "12", "balls": ".|1|1|1|6|2", "runs": "11", "bowler_to_batsma": "Yadav K. to Finch A. & Khawaja U." }, { "innings": "AUS Innings", "nr": "11", "balls": "1|.|.|.|1|.", "runs": "2", "bowler_to_batsma": "Bumrah J. to Khawaja U. & Finch A." }, { "innings": "AUS Innings", "nr": "10", "balls": "1|.|3|.|1|.", "runs": "5", "bowler_to_batsma": "Kumar B. to Khawaja U. & Finch A." }, { "innings": "AUS Innings", "nr": "9", "balls": ".|.|1|.|.|.", "runs": "1", "bowler_to_batsma": "Bumrah J. to Khawaja U. & Finch A." }, { "innings": "AUS Innings", "nr": "8", "balls": ".|.|.|4|.|1", "runs": "5", "bowler_to_batsma": "Kumar B. to Khawaja U." }, { "innings": "AUS Innings", "nr": "7", "balls": ".|.|2|1|.|.", "runs": "3", "bowler_to_batsma": "Bumrah J. to Khawaja U. & Finch A." }, { "innings": "AUS Innings", "nr": "6", "balls": ".|.|4|.|4|.", "runs": "8", "bowler_to_batsma": "Shami M. to Finch A." }, { "innings": "AUS Innings", "nr": "5", "balls": "1|.|.|.|1|.", "runs": "2", "bowler_to_batsma": "Kumar B. to Khawaja U. & Finch A." }, { "innings": "AUS Innings", "nr": "4", "balls": "4|.|4|1|.|.", "runs": "9", "bowler_to_batsma": "Shami M. to Khawaja U. & Finch A." }, { "innings": "AUS Innings", "nr": "3", "balls": "4|1|.|4|.|1", "runs": "10", "bowler_to_batsma": "Kumar B. to Finch A. & Khawaja U." }, { "innings": "AUS Innings", "nr": "2", "balls": ".|1|.|.|4|.", "runs": "5", "bowler_to_batsma": "Shami M. to Finch A. & Khawaja U." }, { "innings": "AUS Innings", "nr": "1", "balls": ".|.|.|4|.|.", "runs": "4", "bowler_to_batsma": "Kumar B. to Khawaja U." } ], "IND Innings": [ { "innings": "IND Innings", "nr": "50", "balls": "4|1WD|1|1|.|.|W", "runs": "7", "bowler_to_batsma": "Stoinis M. to Yadav K. & Bumrah J." }, { "innings": "IND Innings", "nr": "49", "balls": "1|1|W|.|.|.", "runs": "2", "bowler_to_batsma": "Richardson J. to Shami M., Yadav K. & Bumrah J." }, { "innings": "IND Innings", "nr": "48", "balls": ".|1|.|.|.|1", "runs": "2", "bowler_to_batsma": "Cummins P. to Yadav K. & Shami M." }, { "innings": "IND Innings", "nr": "47", "balls": "W|.|.|1|1|1", "runs": "3", "bowler_to_batsma": "Richardson J. to Jadhav K., Yadav K. & Shami M." }, { "innings": "IND Innings", "nr": "46", "balls": "4|1WD|1|2|1|.|W", "runs": "9", "bowler_to_batsma": "Cummins P. to Kumar B. & Jadhav K." }, { "innings": "IND Innings", "nr": "45", "balls": "1|6|.|1|1LB|1", "runs": "10", "bowler_to_batsma": "Richardson J. to Jadhav K. & Kumar B." }, { "innings": "IND Innings", "nr": "44", "balls": "1|1|.|.|1|1", "runs": "4", "bowler_to_batsma": "Cummins P. to Kumar B. & Jadhav K." }, { "innings": "IND Innings", "nr": "43", "balls": "1|.|1|6|1|.", "runs": "9", "bowler_to_batsma": "Zampa A. to Kumar B. & Jadhav K." }, { "innings": "IND Innings", "nr": "42", "balls": ".|1|6|2|.|.", "runs": "9", "bowler_to_batsma": "Maxwell G. to Kumar B. & Jadhav K." }, { "innings": "IND Innings", "nr": "41", "balls": "1|.|1|1|.|1", "runs": "4", "bowler_to_batsma": "Zampa A. to Jadhav K. & Kumar B." }, { "innings": "IND Innings", "nr": "40", "balls": "4|.|1|.|.|4", "runs": "9", "bowler_to_batsma": "Maxwell G. to Jadhav K. & Kumar B." }, { "innings": "IND Innings", "nr": "39", "balls": ".|1|.|4LB|.|1", "runs": "6", "bowler_to_batsma": "Richardson J. to Kumar B. & Jadhav K." }, { "innings": "IND Innings", "nr": "38", "balls": ".|.|.|.|.|.", "runs": "0", "bowler_to_batsma": "Lyon N. to Jadhav K." }, { "innings": "IND Innings", "nr": "37", "balls": ".|2|.|.|.|.", "runs": "2", "bowler_to_batsma": "Richardson J. to Kumar B." }, { "innings": "IND Innings", "nr": "36", "balls": ".|.|.|1WD|1|1|.", "runs": "3", "bowler_to_batsma": "Lyon N. to Jadhav K. & Kumar B." }, { "innings": "IND Innings", "nr": "35", "balls": "1|4|.|.|1|1", "runs": "7", "bowler_to_batsma": "Cummins P. to Jadhav K. & Kumar B." }, { "innings": "IND Innings", "nr": "34", "balls": "1|1|.|.|.|.", "runs": "2", "bowler_to_batsma": "Lyon N. to Kumar B. & Jadhav K." }, { "innings": "IND Innings", "nr": "33", "balls": "1|.|1|1|.|.", "runs": "3", "bowler_to_batsma": "Cummins P. to Kumar B. & Jadhav K." }, { "innings": "IND Innings", "nr": "32", "balls": "1|4|.|1|1|.", "runs": "7", "bowler_to_batsma": "Lyon N. to Kumar B. & Jadhav K." }, { "innings": "IND Innings", "nr": "31", "balls": ".|.|.|.|1|.", "runs": "1", "bowler_to_batsma": "Zampa A. to Kumar B. & Jadhav K." }, { "innings": "IND Innings", "nr": "30", "balls": "1|.|1|4|.|.", "runs": "6", "bowler_to_batsma": "Maxwell G. to Jadhav K. & Kumar B." }, { "innings": "IND Innings", "nr": "29", "balls": ".|W|.|.|W|.", "runs": "0", "bowler_to_batsma": "Zampa A. to Sharma R., Jadeja R. & Kumar B." }, { "innings": "IND Innings", "nr": "28", "balls": ".|.|.|.|.|1", "runs": "1", "bowler_to_batsma": "Maxwell G. to Sharma R." }, { "innings": "IND Innings", "nr": "27", "balls": ".|1|1|.|1|.", "runs": "3", "bowler_to_batsma": "Zampa A. to Sharma R. & Jadhav K." }, { "innings": "IND Innings", "nr": "26", "balls": ".|1|1|.|.|4", "runs": "6", "bowler_to_batsma": "Maxwell G. to Jadhav K. & Sharma R." }, { "innings": "IND Innings", "nr": "25", "balls": ".|.|6|W|2|.", "runs": "8", "bowler_to_batsma": "Zampa A. to Shankar V. & Sharma R." }, { "innings": "IND Innings", "nr": "24", "balls": ".|.|1|1|1|.", "runs": "3", "bowler_to_batsma": "Maxwell G. to Shankar V. & Sharma R." }, { "innings": "IND Innings", "nr": "23", "balls": ".|1|1|1|1LB|.", "runs": "4", "bowler_to_batsma": "Zampa A. to Sharma R. & Shankar V." }, { "innings": "IND Innings", "nr": "22", "balls": ".|1|1|1|1|.", "runs": "4", "bowler_to_batsma": "Lyon N. to Shankar V. & Sharma R." }, { "innings": "IND Innings", "nr": "21", "balls": "1|1|1|.|2|.", "runs": "5", "bowler_to_batsma": "Zampa A. to Shankar V. & Sharma R." }, { "innings": "IND Innings", "nr": "20", "balls": ".|1|1|.|1|1", "runs": "4", "bowler_to_batsma": "Lyon N. to Sharma R. & Shankar V." }, { "innings": "IND Innings", "nr": "19", "balls": "1|.|1|.|.|1", "runs": "3", "bowler_to_batsma": "Zampa A. to Sharma R. & Shankar V." }, { "innings": "IND Innings", "nr": "18", "balls": ".|.|1|.|W|.", "runs": "1", "bowler_to_batsma": "Lyon N. to Sharma R., Pant R. & Shankar V." }, { "innings": "IND Innings", "nr": "17", "balls": "6|1|1|1|1|.", "runs": "10", "bowler_to_batsma": "Zampa A. to Pant R. & Sharma R." }, { "innings": "IND Innings", "nr": "16", "balls": ".|1|.|.|1|.", "runs": "2", "bowler_to_batsma": "Lyon N. to Sharma R. & Pant R." }, { "innings": "IND Innings", "nr": "15", "balls": "4|.|1|1|.|.", "runs": "6", "bowler_to_batsma": "Stoinis M. to Pant R. & Sharma R." }, { "innings": "IND Innings", "nr": "14", "balls": ".|.|1|1|.|.", "runs": "2", "bowler_to_batsma": "Lyon N. to Sharma R. & Pant R." }, { "innings": "IND Innings", "nr": "13", "balls": "1|1|W|1|.|1", "runs": "4", "bowler_to_batsma": "Stoinis M. to Kohli V., Sharma R. & Pant R." }, { "innings": "IND Innings", "nr": "12", "balls": "4|1|1|1|1|1", "runs": "9", "bowler_to_batsma": "Lyon N. to Kohli V. & Sharma R." }, { "innings": "IND Innings", "nr": "11", "balls": "1|5WD|5|1|1|.|1", "runs": "14", "bowler_to_batsma": "Stoinis M. to Kohli V. & Sharma R." }, { "innings": "IND Innings", "nr": "10", "balls": ".|.|1|.|4|.", "runs": "5", "bowler_to_batsma": "Richardson J. to Kohli V. & Sharma R." }, { "innings": "IND Innings", "nr": "9", "balls": ".|.|.|.|.|.", "runs": "0", "bowler_to_batsma": "Cummins P. to Sharma R." }, { "innings": "IND Innings", "nr": "8", "balls": ".|4|1|.|.|.", "runs": "5", "bowler_to_batsma": "Richardson J. to Sharma R. & Kohli V." }, { "innings": "IND Innings", "nr": "7", "balls": "1|.|.|.|.|1", "runs": "2", "bowler_to_batsma": "Cummins P. to Kohli V. & Sharma R." }, { "innings": "IND Innings", "nr": "6", "balls": "1|.|.|4|1|1", "runs": "7", "bowler_to_batsma": "Richardson J. to Kohli V. & Sharma R." }, { "innings": "IND Innings", "nr": "5", "balls": ".|W|.|4|1|4", "runs": "9", "bowler_to_batsma": "Cummins P. to Dhawan S., Kohli V. & Sharma R." }, { "innings": "IND Innings", "nr": "4", "balls": ".|1|.|1|.|1", "runs": "3", "bowler_to_batsma": "Richardson J. to Dhawan S. & Sharma R." }, { "innings": "IND Innings", "nr": "3", "balls": ".|.|1|.|.|.", "runs": "1", "bowler_to_batsma": "Cummins P. to Dhawan S. & Sharma R." }, { "innings": "IND Innings", "nr": "2", "balls": "1|.|4|4|1|.", "runs": "10", "bowler_to_batsma": "Richardson J. to Sharma R. & Dhawan S." }, { "innings": "IND Innings", "nr": "1", "balls": ".|.|.|1|.|.", "runs": "1", "bowler_to_batsma": "Cummins P. to Sharma R. & Dhawan S." } ] }, "wickets": { "AUS Innings": [ { "innings": "AUS Innings", "fall": "14.3 ov", "balwer": "b Jadeja R.", "batsman": "Finch A.", "score": "76/1" }, { "innings": "AUS Innings", "fall": "32.6 ov", "balwer": "c Kohli V. b Kumar B.", "batsman": "Khawaja U.", "score": "175/2" }, { "innings": "AUS Innings", "fall": "33.5 ov", "balwer": "c Kohli V. b Jadeja R.", "batsman": "Maxwell G.", "score": "178/3" }, { "innings": "AUS Innings", "fall": "36.2 ov", "balwer": "c Pant R. b Shami M.", "batsman": "Handscomb P.", "score": "182/4" }, { "innings": "AUS Innings", "fall": "41.2 ov", "balwer": "c Jadeja R. b Yadav K.", "batsman": "Turner A.", "score": "210/5" }, { "innings": "AUS Innings", "fall": "44.2 ov", "balwer": "b Kumar B.", "batsman": "Stoinis M.", "score": "225/6" }, { "innings": "AUS Innings", "fall": "45.5 ov", "balwer": "c Pant R. b Shami M.", "batsman": "Carey A.", "score": "229/7" }, { "innings": "AUS Innings", "fall": "48.3 ov", "balwer": "c & b Kumar B.", "batsman": "Cummins P.", "score": "263/8" }, { "innings": "AUS Innings", "fall": "49.6 ov", "balwer": "run out Kohli V.", "batsman": "Richardson J.", "score": "272/9" } ], "IND Innings": [ { "innings": "IND Innings", "fall": "4.2 ov", "balwer": "c Carey A. b Cummins P.", "batsman": "Dhawan S.", "score": "15/1" }, { "innings": "IND Innings", "fall": "12.3 ov", "balwer": "c Carey A. b Stoinis M.", "batsman": "Kohli V.", "score": "68/2" }, { "innings": "IND Innings", "fall": "17.5 ov", "balwer": "c Turner A. b Lyon N.", "batsman": "Pant R.", "score": "91/3" }, { "innings": "IND Innings", "fall": "24.4 ov", "balwer": "c Khawaja U. b Zampa A.", "batsman": "Shankar V.", "score": "120/4" }, { "innings": "IND Innings", "fall": "28.2 ov", "balwer": "st Carey A. b Zampa A.", "batsman": "Sharma R.", "score": "132/5" }, { "innings": "IND Innings", "fall": "28.5 ov", "balwer": "st Carey A. b Zampa A.", "batsman": "Jadeja R.", "score": "132/6" }, { "innings": "IND Innings", "fall": "45.6 ov", "balwer": "c Finch A. b Cummins P.", "batsman": "Kumar B.", "score": "223/7" }, { "innings": "IND Innings", "fall": "46.1 ov", "balwer": "c Maxwell G. b Richardson J.", "batsman": "Jadhav K.", "score": "223/8" }, { "innings": "IND Innings", "fall": "48.3 ov", "balwer": "c & b Richardson J.", "batsman": "Shami M.", "score": "230/9" }, { "innings": "IND Innings", "fall": "49.6 ov", "balwer": "b Stoinis M.", "batsman": "Yadav K.", "score": "237/10" } ] }, "extra": { "AUS Innings": { "innings": "AUS Innings", "nr": "4.00", "text": "(w 3, b 1)", "total_overs": "(50 overs)", "total": "272/9", "percent_over": "(5.44 runs per over)" }, "IND Innings": { "innings": "IND Innings", "nr": "14.00", "text": "(w 8, lb 6)", "total_overs": "(50 overs)", "total": "237/10", "percent_over": "(4.74 runs per over)" } }, "lineups": { "home_team": { "starting_lineups": [ { "player": "Sharma R.", "player_country": "India" }, { "player": "Dhawan S.", "player_country": "India" }, { "player": "Kohli V. (C)", "player_country": "India" }, { "player": "Pant R.", "player_country": "India" }, { "player": "Jadhav K.", "player_country": "India" }, { "player": "Shankar V.", "player_country": "India" }, { "player": "Jadeja R.", "player_country": "India" }, { "player": "Kumar B.", "player_country": "India" }, { "player": "Yadav K.", "player_country": "India" }, { "player": "Shami M.", "player_country": "India" }, { "player": "Bumrah J.", "player_country": "India" } ], "coaches": [ { "coache": "Shastri R.", "coache_country": "India" } ] }, "away_team": { "starting_lineups": [ { "player": "Finch A. (C)", "player_country": "Australia" }, { "player": "Khawaja U.", "player_country": "Australia" }, { "player": "Handscomb P.", "player_country": "Australia" }, { "player": "Stoinis M.", "player_country": "Australia" }, { "player": "Maxwell G.", "player_country": "Australia" }, { "player": "Turner A.", "player_country": "Australia" }, { "player": "Carey A.", "player_country": "Australia" }, { "player": "Richardson J.", "player_country": "Australia" }, { "player": "Cummins P.", "player_country": "Australia" }, { "player": "Zampa A.", "player_country": "Australia" }, { "player": "Lyon N.", "player_country": "Australia" } ], "coaches": [ { "coache": "Langer J.", "coache_country": "Australia" } ] } } }, ....... ] }
PHP call example
$APIkey=!_your_account_APIkey_!; $from = '2019-03-13'; $to = '2019-03-13'; $curl_options = array( CURLOPT_URL => "https://allsportsapi.com/api/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
api/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) |
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": [ { "event_key": "415", "event_date_start": "2019-03-15", "event_date_stop": "2019-03-19", "event_time": "05:30", "event_home_team": "Afghanistan", "home_team_key": "78", "event_away_team": "Ireland", "away_team_key": "72", "event_service_home": "Batting team", "event_service_away": "Bowling team", "event_home_final_result": "311/9 (105)", "event_away_final_result": "172", "event_home_rr": "", "event_away_rr": "", "event_status": "1st Innings", "event_status_info": "Afghanistan lead by 139 runs with 1 wicket remaining in the 1st innings.", "country_name": "World", "league_name": "Test Series", "league_key": "9846", "league_round": "", "league_season": "2019", "event_live": "1", "event_home_team_logo": "https://allsportsapi.com/logo-cricket/78_afghanistan.png", "event_away_team_logo": "https://allsportsapi.com/logo-cricket/72_ireland.png", "scorecard": [], "ball_by_ball": [], "wickets": [], "extra": [], "lineups": { "home_team": { "starting_lineups": [ { "player": "Asghar A. (C)", "player_country": "Afghanistan" }, { "player": "Shahzad M.", "player_country": "Afghanistan" }, { "player": "Ihsanullah", "player_country": "Afghanistan" }, { "player": "Shah R.", "player_country": "Afghanistan" }, { "player": "Shahidi H.", "player_country": "Afghanistan" }, { "player": "Khil I.", "player_country": "Afghanistan" }, { "player": "Nabi M.", "player_country": "Afghanistan" }, { "player": "Khan R.", "player_country": "Afghanistan" }, { "player": "Wafadar M.", "player_country": "Afghanistan" }, { "player": "Ahmadzai Y.", "player_country": "Afghanistan" }, { "player": "Salamkheil W.", "player_country": "Afghanistan" } ], "coaches": [ { "coache": "Simmons P.", "coache_country": "Trinidad and Tobago" } ] }, "away_team": { "starting_lineups": [ { "player": "Porterfield W. (C)", "player_country": "Ireland" }, { "player": "Balbirnie A.", "player_country": "Ireland" }, { "player": "Cameron-Dow J.", "player_country": "Ireland" }, { "player": "Dockrell G.", "player_country": "Ireland" }, { "player": "McBrine A.", "player_country": "Ireland" }, { "player": "McCollum J.", "player_country": "Ireland" }, { "player": "Murtagh T.", "player_country": "Ireland" }, { "player": "O'Brien K.", "player_country": "Ireland" }, { "player": "Poynter S.", "player_country": "Ireland" }, { "player": "Stirling P.", "player_country": "Ireland" }, { "player": "Thompson S.", "player_country": "Ireland" } ], "coaches": [ { "coache": "Ford G.", "coache_country": "South Africa" } ] } } }, ....... ] }
PHP call example
$APIkey=!_your_account_APIkey_!; $curl_options = array( CURLOPT_URL => "https://allsportsapi.com/api/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
api/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": "391", "event_date_start": "2019-03-13", "event_date_stop": "2019-03-13", "event_time": "09:00", "event_home_team": "India", "home_team_key": "30", "event_away_team": "Australia", "away_team_key": "5", "event_service_home": "", "event_service_away": "", "event_home_final_result": "237/10 (50)", "event_away_final_result": "272/9 (50)", "event_home_rr": "RR 4.74", "event_away_rr": "RR 5.44", "event_status": "Finished", "event_status_info": "Australia won by 35 runs.", "league_name": "One Day International", "league_key": "9847", "league_round": "", "league_season": "", "event_live": "0" }, { "event_key": "362", "event_date_start": "2019-03-10", "event_date_stop": "2019-03-10", "event_time": "09:00", "event_home_team": "India", "home_team_key": "30", "event_away_team": "Australia", "away_team_key": "5", "event_service_home": "", "event_service_away": "", "event_home_final_result": "358/9 (50)", "event_away_final_result": "359/6 (47.5)", "event_home_rr": "RR 7.16", "event_away_rr": "RR 7.51", "event_status": "Finished", "event_status_info": "Australia won by 4 wickets.", "league_name": "One Day International", "league_key": "9847", "league_round": "", "league_season": "", "event_live": "0" }, ....... ], "firstTeamResults": [ { "event_key": "191", "event_date_start": "2019-02-24", "event_date_stop": "2019-02-24", "event_time": "14:30", "event_home_team": "India", "home_team_key": "30", "event_away_team": "Australia", "away_team_key": "5", "event_service_home": "", "event_service_away": "", "event_home_final_result": "126/7 (20)", "event_away_final_result": "127/7 (20)", "event_home_rr": "RR 6.30", "event_away_rr": "RR 6.35", "event_status": "Finished", "event_status_info": "Australia won by 3 wickets.", "league_name": "Twenty20 International", "league_key": "9848", "league_round": "", "league_season": "", "event_live": "0" }, { "event_key": "86", "event_date_start": "2019-02-10", "event_date_stop": "2019-02-10", "event_time": "08:00", "event_home_team": "New Zealand", "home_team_key": "29", "event_away_team": "India", "away_team_key": "30", "event_service_home": "", "event_service_away": "", "event_home_final_result": "212/4 (20)", "event_away_final_result": "208/6 (20)", "event_home_rr": "RR 10.60", "event_away_rr": "RR 10.40", "event_status": "Finished", "event_status_info": "New Zealand won by 4 runs.", "league_name": "Twenty20 International", "league_key": "9848", "league_round": "", "league_season": "", "event_live": "0" }, ........ ], "secondTeamResults": [ { "event_key": "191", "event_date_start": "2019-02-24", "event_date_stop": "2019-02-24", "event_time": "14:30", "event_home_team": "India", "home_team_key": "30", "event_away_team": "Australia", "away_team_key": "5", "event_service_home": "", "event_service_away": "", "event_home_final_result": "126/7 (20)", "event_away_final_result": "127/7 (20)", "event_home_rr": "RR 6.30", "event_away_rr": "RR 6.35", "event_status": "Finished", "event_status_info": "Australia won by 3 wickets.", "league_name": "Twenty20 International", "league_key": "9848", "league_round": "", "league_season": "", "event_live": "0" }, { "event_key": "2049", "event_date_start": "2019-02-01", "event_date_stop": "2019-02-04", "event_time": "00:30", "event_home_team": "Australia", "home_team_key": "5", "event_away_team": "Sri Lanka", "away_team_key": "6", "event_service_home": null, "event_service_away": null, "event_home_final_result": "534/5d & 196/3d", "event_away_final_result": "215 & 149", "event_home_rr": "", "event_away_rr": "", "event_status": "Finished", "event_status_info": "Australia won by 366 runs.", "league_name": "Test Series", "league_key": "9846", "league_round": "", "league_season": "", "event_live": "0" }, ......... ] } }
PHP call example
$APIkey=!_your_account_APIkey_!; $firstTeamId=30; $secondTeamId=5; $curl_options = array( CURLOPT_URL => "https://allsportsapi.com/api/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
api/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": "Promotion - Premier League (Play Offs: Semi-finals)", "standing_team": "Balkh Legends", "standing_MP": "8", "standing_W": "6", "standing_L": "2", "standing_NR": "0", "standing_R": "1366:1254", "standing_NRR": "", "standing_Pts": "12", "team_key": "136", "league_key": "9869", "league_round": "", "standing_updated": "2019-03-11 18:46:41" }, { "standing_place": "2", "standing_place_type": "Promotion - Premier League (Play Offs: Semi-finals)", "standing_team": "Paktia Panthers", "standing_MP": "8", "standing_W": "5", "standing_L": "3", "standing_NR": "0", "standing_R": "1307:1325", "standing_NRR": "", "standing_Pts": "10", "team_key": "138", "league_key": "9869", "league_round": "", "standing_updated": "2019-03-11 18:46:41" }, ....... ], "home": [ { "standing_place": "1", "standing_place_type": "", "standing_team": "Balkh Legends", "standing_MP": "7", "standing_W": "5", "standing_L": "2", "standing_NR": "0", "standing_R": "1189:1078", "standing_NRR": "", "standing_Pts": "10", "team_key": "136", "league_key": "9869", "league_round": "", "standing_updated": "2019-03-11 18:46:45" }, { "standing_place": "2", "standing_place_type": "", "standing_team": "Kabul Zawanan", "standing_MP": "6", "standing_W": "3", "standing_L": "3", "standing_NR": "0", "standing_R": "1028:1042", "standing_NRR": "", "standing_Pts": "6", "team_key": "137", "league_key": "9869", "league_round": "", "standing_updated": "2019-03-11 18:46:45" }, ....... ], "away": [ { "standing_place": "1", "standing_place_type": "", "standing_team": "Paktia Panthers", "standing_MP": "6", "standing_W": "4", "standing_L": "2", "standing_NR": "0", "standing_R": "905:942", "standing_NRR": "", "standing_Pts": "8", "team_key": "138", "league_key": "9869", "league_round": "", "standing_updated": "2019-03-11 18:46:49" }, { "standing_place": "2", "standing_place_type": "", "standing_team": "Nangarhar Leopards", "standing_MP": "7", "standing_W": "3", "standing_L": "4", "standing_NR": "0", "standing_R": "1037:1093", "standing_NRR": "", "standing_Pts": "6", "team_key": "139", "league_key": "9869", "league_round": "", "standing_updated": "2019-03-11 18:46:49" }, ........ ] } }
PHP call example
$APIkey=!_your_account_APIkey_!; $leagueId = 9869; $curl_options = array( CURLOPT_URL => "https://allsportsapi.com/api/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
api/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": "138", "team_name": "Paktia Panthers", "team_logo": "https://allsportsapi.com/logo-cricket/-1" } ] }
PHP call example
$APIkey=!_your_account_APIkey_!; $teamId = 138; $curl_options = array( CURLOPT_URL => "https://allsportsapi.com/api/cricket/?met=Teams&APIkey=$APIkey&teamId=$teamId", 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
api/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": { "2762": { "Home/Away - FT including OT": { "1": { "10Bet": "1.63", "188BET": "1.66", "bet365": "1.66", "bet365.it": "1.66", "Betfred": "1.67", "Bethard": "1.63", "BetVictor": "1.67", "BoyleSports": "1.67", "Chance.cz": "1.70", "ComeOn": "1.63", "iFortuna.cz": "1.69", "KTO": "1.64", "Marathonbet": "1.72", "SAZKAbet.cz": "1.63", "STS.pl": "1.65", "Tipsport.cz": "1.70", "Tipsport.sk": "1.70", "Titanbet": "1.67", "William Hill": "1.73" }, "2": { "10Bet": "2.15", "188BET": "2.16", "bet365": "2.20", "bet365.it": "2.20", "Betfred": "2.20", "Bethard": "2.15", "BetVictor": "2.10", "BoyleSports": "2.20", "Chance.cz": "1.96", "ComeOn": "2.15", "iFortuna.cz": "2.12", "KTO": "2.12", "Marathonbet": "2.15", "SAZKAbet.cz": "2.15", "STS.pl": "1.97", "Tipsport.cz": "1.96", "Tipsport.sk": "1.96", "Titanbet": "2.10", "William Hill": "2.10" } }, "Home/Away - Full Time": { "1": { "888sport": "1.67", "Jetbull": "1.69", "Unibet": "1.67" }, "2": { "888sport": "2.20", "Jetbull": "2.12", "Unibet": "2.20" } }, "AH - Full Time": { "AH 0": { "1": { "SBOBET": "1.65" }, "2": { "SBOBET": "2.26" } } }, "O/U - Full Time": { "O/U +525.5": { "Over": { "1xBet": "1.73" }, "Under": { "1xBet": "2.00" } } } } } }
PHP call example
$APIkey=!_your_account_APIkey_!; $eventId = 2762; $curl_options = array( CURLOPT_URL => "https://allsportsapi.com/api/cricket/?met=Odds&APIkey=$APIkey&matchId=$eventId", 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);