Tennis documentation

  • Home
  • Tennis documentation

Endpoints

ALL SPORTS API - Tennis API Version 2.0

Welcome to the documentation page of AllSportsAPI.com tennis service. Please find bellow the full list of the methods you can relay on to get real time tennis data helping you build awesome applications.

Tournaments Types


Method

GET/POST https://apiv2.allsportsapi.com/tennis/?met=Countries

Returns list of supported tennis tournaments types 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": "267",
            "country_name": "Atp Doubles"
        },
        {
            "country_key": "265",
            "country_name": "Atp Singles"
        },
        {
            "country_key": "279",
            "country_name": "Boys Doubles"
        },
    ......
  ]
}
                                

PHP call example


$APIkey='!_your_account_APIkey_!';

$curl_options = array(
  CURLOPT_URL => "https://apiv2.allsportsapi.com/tennis/?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);

                                


Tournaments


Method

GET/POST https://apiv2.allsportsapi.com/tennis/?met=Leagues

Returns list of supported tennis 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": "2833",
            "league_name": "Aachen",
            "country_key": "281",
            "country_name": "Challenger Men Singles"
        },
        {
            "league_key": "2655",
            "league_name": "Abu Dhabi",
            "country_key": "283",
            "country_name": "Exhibition Men"
        },
        {
            "league_key": "2801",
            "league_name": "Abu Dhabi",
            "country_key": "276",
            "country_name": "Exhibition Women"
        },
     .......
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;


$curl_options = array(
  CURLOPT_URL => "https://apiv2.allsportsapi.com/tennis/?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/tennis/?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
from Start date (yyyy-mm-dd)
to Stop date (yyyy-mm-dd)
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)
playerId Player ID - if set only details from specific team will be returned (Optional)

Request URL


JSON Response

{
    "success": 1,
    "result": [
        {
            "event_key": "143104",
            "event_date": "2022-06-17",
            "event_time": "18:00",
            "event_first_player": "M. Navone",
            "first_player_key": "949",
            "event_second_player": "C. Gomez-Herrera",
            "second_player_key": "3474",
            "event_final_result": "-",
            "event_game_result": "-",
            "event_serve": null,
            "event_winner": null,
            "event_status": "",
            "country_name": "Challenger Men Singles",
            "league_name": "Corrientes Challenger Men",
            "league_key": "2646",
            "league_round": "",
            "league_season": "2022",
            "event_live": "0",
            "event_first_player_logo": null,
            "event_second_player_logo": "https://apiv2.allsportsapi.com/logo-tennis/3474_c-gomez-herrera.jpg",
            "pointbypoint": [],
            "scores": []
        },
        {
            "event_key": "143113",
            "event_date": "2022-06-17",
            "event_time": "01:05",
            "event_first_player": "C. Chidekh",
            "first_player_key": "7102",
            "event_second_player": "M. Cassone",
            "second_player_key": "12744",
            "event_final_result": "2 - 0",
            "event_game_result": "-",
            "event_serve": null,
            "event_winner": "First Player",
            "event_status": "Finished",
            "country_name": "Itf Men Singles",
            "league_name": "ITF M25 Wichita, KS Men",
            "league_key": "4195",
            "league_round": "",
            "league_season": "2022",
            "event_live": "0",
            "event_first_player_logo": null,
            "event_second_player_logo": null,
            "pointbypoint": [
                {
                    "set_number": "Set 1",
                    "number_game": "1",
                    "player_served": "First Player",
                    "serve_winner": "First Player",
                    "serve_lost": null,
                    "score": "1 - 0",
                    "points": [
                        {
                            "number_point": "1",
                            "score": "15 - 0",
                            "break_point": null,
                            "set_point": null,
                            "match_point": null
                        },
                      .........
                    ],
                },
                ...........
              ],
              "scores": [
                {
                    "score_first": "6",
                    "score_second": "4",
                    "score_set": "1"
                },
                {
                    "score_first": "6",
                    "score_second": "2",
                    "score_set": "2"
                }
              ]
          }
      }
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$from = '2022-06-17';
$to = '2022-06-17';

$curl_options = array(
  CURLOPT_URL => "https://apiv2.allsportsapi.com/tennis/?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);

            


H2H (Head to Head)


Method

GET/POST https://apiv2.allsportsapi.com/tennis/?met=H2H

Returns the last tennis games between submiteted players and the last games of each player


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)
firstPlayerId First player Id
secondPlayerId Second player Id

Request URL


JSON Response

{
    "success": 1,
    "result": {
        "H2H": [
              {
                  "event_key": "143113",
                  "event_date": "2022-06-17",
                  "event_time": "01:05",
                  "event_first_player": "C. Chidekh",
                  "first_player_key": "7102",
                  "event_second_player": "M. Cassone",
                  "second_player_key": "12744",
                  "event_final_result": "2 - 0",
                  "event_game_result": "-",
                  "event_serve": null,
                  "event_winner": "First Player",
                  "event_status": "Finished",
                  "country_name": "Itf Men Singles",
                  "league_name": "ITF M25 Wichita, KS Men",
                  "league_key": "4195",
                  "league_round": "",
                  "league_season": "2022",
                  "event_live": "0",
                  "event_first_player_logo": null,
                  "event_second_player_logo": null
              },
            ........
          ],
          "firstTeamResults": [
            {
                  "event_key": "142805",
                  "event_date": "2022-06-15",
                  "event_time": "16:10",
                  "event_first_player": "M. Cassone",
                  "first_player_key": "12744",
                  "event_second_player": "D. Sweeny",
                  "second_player_key": "1308",
                  "event_final_result": "2 - 1",
                  "event_game_result": "-",
                  "event_serve": null,
                  "event_winner": "First Player",
                  "event_status": "Finished",
                  "country_name": "Itf Men Singles",
                  "league_name": "ITF M25 Wichita, KS Men",
                  "league_key": "4195",
                  "league_round": "",
                  "league_season": "2022",
                  "event_live": "0",
                  "event_first_player_logo": null,
                  "event_second_player_logo": null
              },
              .....
            ],
            "secondTeamResults": [
              {
                "event_key": "138687",
                "event_date": "2022-05-31",
                "event_time": "18:10",
                "event_first_player": "M. Cassone",
                "first_player_key": "12744",
                "event_second_player": "M. Mmoh",
                "second_player_key": "439",
                "event_final_result": "2 - 1",
                "event_game_result": "-",
                "event_serve": null,
                "event_winner": "First Player",
                "event_status": "Finished",
                "country_name": "Challenger Men Singles",
                "league_name": "Little Rock Challenger Men",
                "league_key": "3130",
                "league_round": "",
                "league_season": "2022",
                "event_live": "0",
                "event_first_player_logo": null,
                "event_second_player_logo": "https://apiv2.allsportsapi.com/logo-tennis/439_m-mmoh.jpg"
            },
              ......
            ]
        }
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$firstPlayerId=12744;
$secondPlayerId=7102;

$curl_options = array(
  CURLOPT_URL => "https://apiv2.allsportsapi.com/tennis/?met=H2H&APIkey=$APIkey&firstPlayerId=$firstPlayerId&secondPlayerId=$secondPlayerId",
  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/tennis/?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": "143192",
            "event_date": "2022-06-17",
            "event_time": "10:10",
            "event_first_player": "S. Bejlek",
            "first_player_key": "9393",
            "event_second_player": "R. Zarazua",
            "second_player_key": "1805",
            "event_final_result": "0 - 0",
            "event_game_result": "0 - 0",
            "event_serve": "First Player",
            "event_winner": null,
            "event_status": "Set 1",
            "country_name": "Itf Women Singles",
            "league_name": "ITF W60 Ceska Lipa Women",
            "league_key": "4210",
            "league_round": "",
            "league_season": "2022",
            "event_live": "1",
            "event_first_player_logo": null,
            "event_second_player_logo": "https://apiv2.allsportsapi.com/logo-tennis/1805_r-zarazua.jpg",
            "pointbypoint": [
                {
                    "set_number": "Set 1",
                    "number_game": "1",
                    "player_served": "First Player",
                    "serve_winner": "First Player",
                    "serve_lost": null,
                    "score": "1 - 0",
                    "points": [
                        {
                            "number_point": "1",
                            "score": "15 - 0",
                            "break_point": null,
                            "set_point": null,
                            "match_point": null
                        },
                        .............
                    ],
                },
                .............
            ],
            "scores": [
                {
                    "score_first": "5",
                    "score_second": "5",
                    "score_set": "1"
                }
            ]
        }
    ]
    .......
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;

$curl_options = array(
  CURLOPT_URL => "https://apiv2.allsportsapi.com/tennis/?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);

            


Standings


Method

GET/POST https://apiv2.allsportsapi.com/tennis/?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
league 'ATP' or 'WTP'

Request URL


JSON Response

{
    "success": 1,
    "result": [
        {
            "place": "1",
            "player": "Daniil Medvedev",
            "player_key": "1093",
            "league": "ATP",
            "movement": "down",
            "country": "Russia",
            "points": "7950"
        },
        {
            "place": "2",
            "player": "Alexander Zverev",
            "player_key": "1980",
            "league": "ATP",
            "movement": "down",
            "country": "Germany",
            "points": "7075"
        },
        {
            "place": "3",
            "player": "Novak Djokovic",
            "player_key": "1905",
            "league": "ATP",
            "movement": "up",
            "country": "Serbia",
            "points": "6770"
        },
         .......
     ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$league = 'ATP';

$curl_options = array(
  CURLOPT_URL => "https://apiv2.allsportsapi.com/tennis/?met=Standings&APIkey=$APIkey&league=$league",
  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);

            


Players


Method

GET/POST https://apiv2.allsportsapi.com/tennis/?met=Players

Returns players for tennis tournaments 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
playerId Player internal code

Request URL


JSON Response

{
    "success": 1,
    "result": [
        {
            "player_key": "1905",
            "player_name": "N. Djokovic",
            "player_country": "Serbia",
            "player_bday": "22.05.1987",
            "player_logo": "https://apiv2.allsportsapi.com/logo-tennis/1905_n-djokovic.jpg",
            "stats": [
                {
                    "season": "2021",
                    "type": "doubles",
                    "rank": "255",
                    "titles": "0",
                    "matches_won": "6",
                    "matches_lost": "4",
                    "hard_won": "2",
                    "hard_lost": "2",
                    "clay_won": "",
                    "clay_lost": "",
                    "grass_won": "3",
                    "grass_lost": "0"
                },
                {
                    "season": "2020",
                    "type": "doubles",
                    "rank": "158",
                    "titles": "0",
                    "matches_won": "2",
                    "matches_lost": "1",
                    "hard_won": "2",
                    "hard_lost": "1",
                    "clay_won": "",
                    "clay_lost": "",
                    "grass_won": "",
                    "grass_lost": ""
                },
                .........
            ],
            "tournaments": [
                {
                    "name": "Rome",
                    "season": "2022",
                    "type": "singles",
                    "surface": "clay",
                    "prize": "€4,332,325"
                },
                {
                    "name": "Paris",
                    "season": "2021",
                    "type": "singles",
                    "surface": "hard (indoor)",
                    "prize": "€3,901,015"
                },
                {
                    "name": "Wimbledon",
                    "season": "2021",
                    "type": "singles",
                    "surface": "grass",
                    "prize": "£13,490,000"
                },
                ......
            ],
        }
    ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$playerId = 1905;

$curl_options = array(
  CURLOPT_URL => "https://apiv2.allsportsapi.com/tennis/?met=Players&APIkey=$APIkey&playerId=$playerId",
  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 https://apiv2.allsportsapi.com/tennis/?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": {
        "143113": {
            "Home/Away": {
                "Home": {
                    "bwin": "1.44",
                    "NordicBet": "1.47",
                    "10Bet": "1.50",
                    "WilliamHill": "1.50",
                    "bet365": "1.53",
                    "Marathon": "1.53",
                    "Unibet": "1.48",
                    "Betsson": "1.47",
                    "Pncl": "1.50",
                    "Sbo": "1.54",
                    "Netbet": "1.50",
                    "1xbet": "1.55",
                    "Sportingbet": "1.44",
                    "ComeOn": "1.50",
                    "Betway": "1.50",
                    "Tipico": "1.40",
                    "Betcris": "1.46",
                    "888Sport": "1.48"
                },
                "Away": {
                    "bwin": "2.55",
                    "NordicBet": "2.50",
                    "10Bet": "2.40",
                    "WilliamHill": "2.50",
                    "bet365": "2.37",
                    "Marathon": "2.44",
                    "Unibet": "2.52",
                    "Betsson": "2.50",
                    "Pncl": "2.48",
                    "Sbo": "2.35",
                    "Netbet": "2.35",
                    "1xbet": "2.42",
                    "Sportingbet": "2.55",
                    "ComeOn": "2.40",
                    "Betway": "2.40",
                    "Tipico": "2.55",
                    "Betcris": "2.46",
                    "888Sport": "2.52"
                }
            },
            "Correct Score 1st Half": {
                "6:0": {
                    "bet365": "34.00",
                    "1xbet": "41.00"
                },
                "6:1": {
                    "bet365": "19.00",
                    "1xbet": "21.00"
                },
                "6:2": {
                    "bet365": "7.00",
                    "1xbet": "8.00"
                },
                "0:6": {
                    "bet365": "51.00",
                    "1xbet": "41.00"
                },
                .......
            },
            ......
        },
        ......
    }
}
              

PHP call example


  $APIkey=!_your_account_APIkey_!;
  $eventId = 143113;

  $curl_options = array(
    CURLOPT_URL => "https://apiv2.allsportsapi.com/tennis/?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);