Football (Soccer) documentation


Football API V2

  • Home
  • Football (Soccer) documentation

Endpoints

ALL SPORTS API - Football (Soccer) API Version 2.1

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

Countries


Method

GET/POST apiv2.allsportsapi.com/football?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": "10",
        "country_name": "Albania",
        "country_iso2": null,
        "country_logo": "https://apiv2.allsportsapi.com/logo/logo_country/10_albania.png"
    },
    {
        "country_key": "11",
        "country_name": "Algeria",
        "country_iso2": null,
        "country_logo": "https://apiv2.allsportsapi.com/logo/logo_country/11_algeria.png"
    },
    {
        "country_key": "12",
        "country_name": "Andorra",
        "country_iso2": null,
        "country_logo": "https://apiv2.allsportsapi.com/logo/logo_country/12_andorra.png"
    },
    {
        "country_key": "13",
        "country_name": "Angola",
        "country_iso2": null,
        "country_logo": "https://apiv2.allsportsapi.com/logo/logo_country/13_angola.png"
    },
    ......
  ]
}
                

PHP call example


$APIkey='!_your_account_APIkey_!';

$curl_options = array(
  CURLOPT_URL => "https://apiv2.allsportsapi.com/football/?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 apiv2.allsportsapi.com/football?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": "205",
         "league_name": "Coppa Italia",
         "country_key": "5",
         "country_name": "Italy",
         "league_logo": "https://apiv2.allsportsapi.com/logo/logo_leagues/205_coppa-italia.png",
         "country_logo": "https://apiv2.allsportsapi.com/logo/logo_country/5_italy.png"
     },
     {
         "league_key": "206",
         "league_name": "Serie B",
         "country_key": "5",
         "country_name": "Italy",
         "league_logo": "https://apiv2.allsportsapi.com/logo/logo_leagues/206_serie-b.png",
         "country_logo": "https://apiv2.allsportsapi.com/logo/logo_country/5_italy.png"
     },
     {
         "league_key": "207",
         "league_name": "Serie A",
         "country_key": "5",
         "country_name": "Italy",
         "league_logo": "https://apiv2.allsportsapi.com/logo/logo_leagues/207_serie-a.png",
         "country_logo": "https://apiv2.allsportsapi.com/logo/logo_country/5_italy.png"
     },
     .......
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$countryId = 5;

$curl_options = array(
  CURLOPT_URL => "https://apiv2.allsportsapi.com/football/?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 apiv2.allsportsapi.com/football?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)
teamId Team ID - if set only details from specific team will be returned (Optional)

Request URL


JSON Response

{
  "success": 1,
  "result": [
  {
        "event_key": "59409",
        "event_date": "2021-05-18",
        "event_time": "20:30",
        "event_home_team": "Lazio",
        "home_team_key": "93",
        "event_away_team": "Torino",
        "away_team_key": "4973",
        "event_halftime_result": "0 - 0",
        "event_final_result": "0 - 0",
        "event_ft_result": "0 - 0",
        "event_penalty_result": "",
        "event_status": "Finished",
        "country_name": "Italy",
        "league_name": "Serie A",
        "league_key": "207",
        "league_round": "Round 25",
        "league_season": "2020/2021",
        "event_live": "0",
        "event_stadium": "Stadio Olimpico (Roma)",
        "event_referee": "M. Fabbri",
        "home_team_logo": "https://apiv2.allsportsapi.com/logo/93_lazio.jpg",
        "away_team_logo": "https://apiv2.allsportsapi.com/logo/4973_torino.jpg",
        "event_country_key": "5",
        "league_logo": "https://apiv2.allsportsapi.com/logo/logo_leagues/207_serie-a.png",
        "country_logo": "https://apiv2.allsportsapi.com/logo/logo_country/5_italy.png",
        "event_home_formation": "",
        "event_away_formation": "",
        "fk_stage_key": "331",
        "stage_name": "Current",
        "goalscorers": [],
        "substitutes": [
            {
                "time": "61",
                "home_scorer": {
                    "in": "M. Fares",
                    "out": "S. Lulic"
                },
                "score": "substitution",
                "away_scorer": []
            },
            {
                "time": "68",
                "home_scorer": {
                    "in": "Lucas Leiva",
                    "out": "G. Escalante"
                },
                "score": "substitution",
                "away_scorer": []
            },
            .................
        ],
        "cards": [
            {
                "time": "28",
                "home_fault": "T. Strakosha",
                "card": "yellow card",
                "away_fault": ""
            },
            ..................
        ],
        "lineups": {
            "home_team": {
                "starting_lineups": [
                    {
                        "player": "Thomas Strakosha",
                        "player_number": "1",
                        "player_position": "1",
                        "player_country": null,
                        "player_key": "979073766"
                    },
                    {
                        "player": "Adam Marusic",
                        "player_number": "77",
                        "player_position": "2",
                        "player_country": null,
                        "player_key": "988865105"
                    },
                    ..........................
                ],
                "substitutes": [
                    {
                        "player": "Pepe Reina",
                        "player_number": "25",
                        "player_position": "0",
                        "player_country": null,
                        "player_key": "926105079"
                    },
                    {
                        "player": "Marco Alia",
                        "player_number": "71",
                        "player_position": "0",
                        "player_country": null,
                        "player_key": "3598033023"
                    },
                    ......................
                ],
                "coaches": [
                    {
                        "coache": "S. Inzaghi",
                        "coache_country": null
                    }
                ],
                "missing_players": []
            },
            "away_team": {
                "starting_lineups": [
                    {
                        "player": "Salvatore Sirigu",
                        "player_number": "39",
                        "player_position": "1",
                        "player_country": null,
                        "player_key": "72635334"
                    },
                    {
                        "player": "Armando Izzo",
                        "player_number": "5",
                        "player_position": "2",
                        "player_country": null,
                        "player_key": "3292395742"
                    },
                    ............................
                ],
                "substitutes": [
                    {
                        "player": "Vanja Milinkovic-Savic",
                        "player_number": "32",
                        "player_position": "0",
                        "player_country": null,
                        "player_key": "3036656066"
                    },
                    {
                        "player": "Samir Ujkani",
                        "player_number": "18",
                        "player_position": "0",
                        "player_country": null,
                        "player_key": "1358621159"
                    },
                    ..................................
                ],
                "coaches": [
                    {
                        "coache": "D. Nicola",
                        "coache_country": null
                    }
                ],
                "missing_players": []
            }
        },
        "statistics": [
            {
                "type": "Shots Total",
                "home": "24",
                "away": "6"
            },
            {
                "type": "Shots On Goal",
                "home": "7",
                "away": "3"
            },
            {
                "type": "Shots Off Goal",
                "home": "12",
                "away": "3"
            },
            ...................
        ]
    }
.......
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$from = '2021-05-18';
$to = '2021-05-18';

$curl_options = array(
  CURLOPT_URL => "https://apiv2.allsportsapi.com/football/?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 apiv2.allsportsapi.com/football?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": "59409",
                "event_date": "2021-05-18",
                "event_time": "20:30",
                "event_home_team": "Lazio",
                "home_team_key": "93",
                "event_away_team": "Torino",
                "away_team_key": "4973",
                "event_halftime_result": "0 - 0",
                "event_final_result": "0 - 0",
                "event_status": "Finished",
                "country_name": "Italy",
                "league_name": "Serie A",
                "league_key": "207",
                "league_round": "25",
                "league_season": "",
                "event_live": "0",
                "event_country_key": "5"
            },
            {
                "event_key": "59224",
                "event_date": "2020-11-01",
                "event_time": "15:00",
                "event_home_team": "Torino",
                "home_team_key": "4973",
                "event_away_team": "Lazio",
                "away_team_key": "93",
                "event_halftime_result": "2 - 1",
                "event_final_result": "3 - 4",
                "event_status": "Finished",
                "country_name": "Italy",
                "league_name": "Serie A",
                "league_key": "207",
                "league_round": "6",
                "league_season": "",
                "event_live": "0",
                "event_country_key": "5"
            },
            ..................................
        ],
        "firstTeamResults": [
            {
                "event_key": "59409",
                "event_date": "2021-05-18",
                "event_time": "20:30",
                "event_home_team": "Lazio",
                "home_team_key": "93",
                "event_away_team": "Torino",
                "away_team_key": "4973",
                "event_halftime_result": "0 - 0",
                "event_final_result": "0 - 0",
                "event_status": "Finished",
                "country_name": "Italy",
                "league_name": "Serie A",
                "league_key": "207",
                "league_round": "25",
                "league_season": "",
                "event_live": "0",
                "event_country_key": "5"
            },
            {
                "event_key": "138735",
                "event_date": "2021-05-15",
                "event_time": "20:45",
                "event_home_team": "Roma",
                "home_team_key": "139",
                "event_away_team": "Lazio",
                "away_team_key": "93",
                "event_halftime_result": "1 - 0",
                "event_final_result": "2 - 0",
                "event_status": "Finished",
                "country_name": "Italy",
                "league_name": "Serie A",
                "league_key": "207",
                "league_round": "37",
                "league_season": "",
                "event_live": "0",
                "event_country_key": "5"
            },
            ...........................
        ],
        "secondTeamResults": [
            {
                "event_key": "59409",
                "event_date": "2021-05-18",
                "event_time": "20:30",
                "event_home_team": "Lazio",
                "home_team_key": "93",
                "event_away_team": "Torino",
                "away_team_key": "4973",
                "event_halftime_result": "0 - 0",
                "event_final_result": "0 - 0",
                "event_status": "Finished",
                "country_name": "Italy",
                "league_name": "Serie A",
                "league_key": "207",
                "league_round": "25",
                "league_season": "",
                "event_live": "0",
                "event_country_key": "5"
            },
            {
                "event_key": "138733",
                "event_date": "2021-05-15",
                "event_time": "15:00",
                "event_home_team": "Spezia",
                "home_team_key": "4977",
                "event_away_team": "Torino",
                "away_team_key": "4973",
                "event_halftime_result": "2 - 0",
                "event_final_result": "4 - 1",
                "event_status": "Finished",
                "country_name": "Italy",
                "league_name": "Serie A",
                "league_key": "207",
                "league_round": "37",
                "league_season": "",
                "event_live": "0",
                "event_country_key": "5"
            },
            .............................
        ]
  }
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$firstTeamId=93;
$secondTeamId=4973;

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

            


Livescore


Method

GET/POST apiv2.allsportsapi.com/football?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": "11205",
        "event_date": "2021-05-21",
        "event_time": "11:05",
        "event_home_team": "Newcastle Jets",
        "home_team_key": "1056",
        "event_away_team": "Brisbane Roar",
        "away_team_key": "399",
        "event_halftime_result": "0 - 1",
        "event_final_result": "1 - 2",
        "event_ft_result": "1 - 2",
        "event_penalty_result": "",
        "event_status": "74",
        "country_name": "Australia",
        "league_name": "A-League - Regular Season",
        "league_key": "49",
        "league_round": "22",
        "league_season": "",
        "event_live": "1",
        "event_stadium": "McDonald Jones Stadium",
        "event_referee": "",
        "event_country_key": "17",
        "league_logo": "https://apiv2.allsportsapi.com/logo/logo_leagues/49_a-league.png",
        "country_logo": "https://apiv2.allsportsapi.com/logo/logo_country/17_australia.png",
        "event_home_formation": "",
        "event_away_formation": "",
        "fk_stage_key": "528",
        "stage_name": "Regular Season",
        "goalscorers": [
            {
                "time": "34",
                "home_scorer": "",
                "score": "0 - 1",
                "away_scorer": "R. Danzaki"
            },
            {
                "time": "61",
                "home_scorer": "J. O'Shea (o.g.)",
                "score": "1 - 1",
                "away_scorer": ""
            },
            {
                "time": "73",
                "home_scorer": "",
                "score": "1 - 2",
                "away_scorer": "J. O'Shea"
            }
        ],
        "cards": [
            {
                "time": "21",
                "home_fault": "",
                "card": "yellow card",
                "away_fault": "M. Gillesphey"
            },
            {
                "time": "42",
                "home_fault": "J. Hoffman",
                "card": "yellow card",
                "away_fault": ""
            },
            ........................
        ],
        "substitutes": [
            {
                "time": "46",
                "home_scorer": {
                    "in": "C. O'Toole",
                    "out": "L. Mauragis"
                },
                "score": "substitution",
                "away_scorer": []
            },
            {
                "time": "46",
                "home_scorer": {
                    "in": "A. Abbas",
                    "out": "A. Goodwin"
                },
                "score": "substitution",
                "away_scorer": []
            },
            ..............
        ],
        "lineups": {
            "home_team": {
                "starting_lineups": [
                    {
                        "player": "Jack Duncan",
                        "player_number": "23",
                        "player_country": null
                    },
                    {
                        "player": "Johnny Koutroumbis",
                        "player_number": "2",
                        "player_country": null
                    },
                    .......................
                ],
                "substitutes": [
                    {
                        "player": "Lewis Italiano",
                        "player_number": "1",
                        "player_country": null
                    },
                    {
                        "player": "Lachlan Jackson",
                        "player_number": "22",
                        "player_country": null
                    },
                    .................
                ],
                "substitutes": [
                    {
                        "player": "Macklin Freke",
                        "player_number": "1",
                        "player_country": null
                    },
                    {
                        "player": "Antonee Burke-Gilroy",
                        "player_number": "22",
                        "player_country": null
                    },
                    ..................
                ],
                "coaches": [
                    {
                        "coache": "W. Moon",
                        "coache_country": null
                    }
                ]
            }
        },
        "statistics": [
            {
                "type": "Shots Blocked",
                "home": "1",
                "away": "6"
            },
            {
                "type": "Shots Inside Box",
                "home": "3",
                "away": "8"
            },
            {
                "type": "Shots Outside Box",
                "home": "3",
                "away": "8"
            },
            ..................
        ]
    },
    .......
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;

$curl_options = array(
  CURLOPT_URL => "https://apiv2.allsportsapi.com/football/?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 apiv2.allsportsapi.com/football?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 - Champions League (Group Stage)",
                "standing_team": "Inter",
                "standing_P": "37",
                "standing_W": "27",
                "standing_D": "7",
                "standing_L": "3",
                "standing_F": "84",
                "standing_A": "34",
                "standing_GD": "50",
                "standing_PTS": "88",
                "team_key": "79",
                "league_key": "207",
                "league_season": "2020/2021",
                "league_round": "",
            },
            ...............
        ],
        "home": [
            {
                "standing_place": "1",
                "standing_place_type": null,
                "standing_team": "Inter",
                "standing_P": "18",
                "standing_W": "16",
                "standing_D": "1",
                "standing_L": "1",
                "standing_F": "48",
                "standing_A": "17",
                "standing_GD": "31",
                "standing_PTS": "49",
                "team_key": "79",
                "league_key": "207",
                "league_season": "2020/2021",
                "league_round": "",
                "standing_updated": "2021-05-18 22:40:28",
                "fk_stage_key": "331",
                "stage_name": "Current"
            },
            ...........................
        ],
        "away": [
            {
                "standing_place": "1",
                "standing_place_type": null,
                "standing_team": "AC Milan",
                "standing_P": "18",
                "standing_W": "15",
                "standing_D": "1",
                "standing_L": "2",
                "standing_F": "41",
                "standing_A": "17",
                "standing_GD": "24",
                "standing_PTS": "46",
                "team_key": "159",
                "league_key": "207",
                "league_season": "2020/2021",
                "league_round": "",
                "standing_updated": "2021-05-18 22:40:29",
                "fk_stage_key": "331",
                "stage_name": "Current"
            },
            .........................
        ]
      }
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$leagueId = 207;

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

            


Topscorers


Method

GET/POST apiv2.allsportsapi.com/football?met=Topscorers

Returns topsorers 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": [
        {
            "player_place": "1",
            "player_name": "Cristiano Ronaldo",
            "player_key": 103051168,
            "team_name": "Juventus",
            "team_key": "96",
            "goals": "29",
            "assists": null,
            "penalty_goals": "6"
        },
        {
            "player_place": "2",
            "player_name": "R. Lukaku",
            "player_key": 592781429,
            "team_name": "Internazionale",
            "team_key": "79",
            "goals": "23",
            "assists": "11",
            "penalty_goals": "6"
        },
        {
            "player_place": "3",
            "player_name": "L. Muriel",
            "player_key": 740446579,
            "team_name": "Atalanta",
            "team_key": "85",
            "goals": "22",
            "assists": "9",
            "penalty_goals": "2"
        },
        .......
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$leagueId = 207;

$curl_options = array(
  CURLOPT_URL => "https://allsportsapi.com/football/?met=Topsorers&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 apiv2.allsportsapi.com/football?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
leagueId League internal code

Request URL


JSON Response

{
  "success": 1,
  "result": [
    {
        "team_key": "96",
        "team_name": "Juventus",
        "team_logo": "https://apiv2.allsportsapi.com/logo/96_juventus.jpg",
        "players": [
            {
                "player_key": 3932445726,
                "player_name": "W. Szczęsny",
                "player_number": "1",
                "player_country": null,
                "player_type": "Goalkeepers",
                "player_age": "31",
                "player_match_played": "29",
                "player_goals": "0",
                "player_yellow_cards": "0",
                "player_red_cards": "0"
            },
            {
                "player_key": 1136721488,
                "player_name": "C. Pinsoglio",
                "player_number": "31",
                "player_country": null,
                "player_type": "Goalkeepers",
                "player_age": "31",
                "player_match_played": "0",
                "player_goals": "0",
                "player_yellow_cards": "0",
                "player_red_cards": "1"
            },
            .......
        ]
    }
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$teamId = 96;

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

            


Players


Method

GET/POST apiv2.allsportsapi.com/football?met=Players

Returns players for leagues included in your current subscription plan


Parameters

Parameter Description
action API method name
APIkey Authorization code generated from your allsportsapi account
playerId Player internal code
playerName Player name

Request URL


JSON Response

{
  "success": 1,
  "result": [
  {
          "player_key": 103051168,
          "player_name": "Cristiano Ronaldo",
          "player_number": "7",
          "player_country": null,
          "player_type": "Forwards",
          "player_age": "36",
          "player_match_played": "33",
          "player_goals": "29",
          "player_yellow_cards": "3",
          "player_red_cards": "0",
          "player_minutes": "2803",
          "player_injured": "No",
          "player_substitute_out": "3",
          "player_substitutes_on_bench": "2",
          "player_assists": "3",
          "player_is_captain": "0",
          "player_shots_total": "10",
          "player_goals_conceded": "0",
          "player_fouls_commited": "4",
          "player_tackles": "2",
          "player_blocks": "",
          "player_crosses_total": "2",
          "player_interceptions": "1",
          "player_clearances": "2",
          "player_dispossesed": "5",
          "player_saves": "",
          "player_inside_box_saves": "",
          "player_duels_total": "35",
          "player_duels_won": "22",
          "player_dribble_attempts": "9",
          "player_dribble_succ": "8",
          "player_pen_comm": "",
          "player_pen_won": "",
          "player_pen_scored": "1",
          "player_pen_missed": "0",
          "player_passes": "102",
          "player_passes_accuracy": "90",
          "player_key_passes": "3",
          "player_woordworks": "",
          "player_rating": "7.45",
          "team_name": "Juventus",
          "team_key": "96"
      },
      ...........
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$playerId = 103051168;

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

            


Videos


Method

GET/POST apiv2.allsportsapi.com/football?met=Videos

Returns videos for events included in your current subscription plan


Parameters

Parameter Description
action API method name
APIkey Authorization code generated from your allsportsapi account
eventId Event internal Id

Request URL


JSON Response

{
  "success": 1,
  "result": [
    {
         "event_key": "86392",
         "video_title_full": "Highlights",
         "video_title": "Highlights",
         "video_url": "https://cc.sporttube.com/embed/Za4CCCG"
     },
     {
         "event_key": "86392",
         "video_title_full": "Highlights",
         "video_title": "Highlights",
         "video_url": "https://cc.sporttube.com/embed/g74CCCG"
     },
     {
         "event_key": "86392",
         "video_title_full": "Highlights",
         "video_title": "Highlights",
         "video_url": "https://cc.sporttube.com/embed/v74CCCG"
     },
     {
         "event_key": "86392",
         "video_title_full": "Highlights",
         "video_title": "Highlights",
         "video_url": "https://cc.sporttube.com/embed/BJ4CCCG"
     },
     {
         "event_key": "86392",
         "video_title_full": "Highlights",
         "video_title": "Highlights",
         "video_url": "https://cc.sporttube.com/embed/KJ4CCCG"
     },
     {
         "event_key": "86392",
         "video_title_full": "Highlights",
         "video_title": "Highlights",
         "video_url": "https://cc.sporttube.com/embed/uJ4CCCG"
     }
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$eventId = 86392;

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

            

Odds


Method

GET/POST apiv2.allsportsapi.com/football?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": {
        "86392": [
            {
                "match_id": "86392",
                "odd_bookmakers": "bwin",
                "odd_1": "1.83",
                "odd_x": "3.40",
                "odd_2": "4.75",
                "odd_1x": "1.18",
                "odd_12": "1.25",
                "odd_x2": "1.95",
                "ah-4.5_1": null,
                "ah-4.5_2": null,
                "ah-4_1": null,
                "ah-4_2": null,
                "ah-3.5_1": null,
                "ah-3.5_2": null,
                "ah-3_1": null,
                "ah-3_2": null,
                "ah-2.5_1": null,
                "ah-2.5_2": null,
                "ah-2_1": null,
                "ah-2_2": null,
                "ah-1.5_1": null,
                "ah-1.5_2": null,
                "ah-1_1": null,
                "ah-1_2": null,
                "ah0_1": null,
                "ah0_2": null,
                "ah+0.5_1": null,
                "ah+1_1": null,
                "ah+1_2": null,
                "ah+1.5_1": null,
                "ah+1.5_2": null,
                "ah+2_1": null,
                "ah+2_2": null,
                "ah+2.5_1": null,
                "ah+2.5_2": null,
                "ah+3_1": null,
                "ah+3_2": null,
                "ah+3.5_1": null,
                "ah+3.5_2": null,
                "ah+4_1": null,
                "ah+4_2": null,
                "ah+4.5_1": null,
                "ah+4.5_2": null,
                "o+0.5": "1.08",
                "u+0.5": "6.50",
                "o+1": null,
                "u+1": null,
                "o+1.5": "1.44",
                "u+1.5": "2.60",
                "o+2": null,
                "u+2": null,
                "o+2.5": "2.30",
                "u+2.5": "1.57",
                "o+3": null,
                "u+3": null,
                "o+3.5": "4.20",
                "u+3.5": "1.19",
                "o+4": null,
                "u+4": null,
                "o+4.5": "7.75",
                "u+4.5": "1.05",
                "o+5": null,
                "u+5": null,
                "o+5.5": "15.00",
                "u+5.5": "1.01",
                "bts_yes": "2.15",
                "bts_no": "1.62"
            },
            .........
      }
    ]
  }
}
              

PHP call example


  $APIkey=!_your_account_APIkey_!;
  $eventId = 86392;

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

              

Probabilities


Method

GET/POST apiv2.allsportsapi.com/football?met=Probabilities

Returns probabilities for events included in your current subscription plan


Parameters

Parameter Description
met 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": [
        {
            "event_key": "86392",
            "country_key": "6",
            "country_name": "Spain",
            "league_key": "302",
            "league_name": "La Liga",
            "event_date": "2021-05-16",
            "event_time": "18:30",
            "event_status": "Finished",
            "home_team_key": "7275",
            "event_home_team": "Deportivo Alavés",
            "event_away_team": "Granada",
            "away_team_key": "151",
            "event_halftime_result": "2 - 1",
            "event_final_result": "4 - 2",
            "event_ft_result": "",
            "event_penalty_result": "",
            "event_home_formation": "4-4-2",
            "event_away_formation": "4-2-3-1",
            "event_live": "0",
            "event_HW": "39.00",
            "event_D": "25.00",
            "event_AW": "36.00",
            "event_HW_D": "64.00",
            "event_AW_D": "61.00",
            "event_HW_AW": "75.00",
            "event_O": "56.00",
            "event_U": "44.00",
            "event_O_1": "79.00",
            "event_U_1": "21.00",
            "event_O_3": "34.00",
            "event_U_3": "66.00",
            "event_bts": "59.00",
            "event_ots": "41.00",
            "event_ah_h_45": "100.00",
            "event_ah_a_45": "0.00",
            "event_ah_h_35": "98.00",
            "event_ah_a_35": "2.00",
            "event_ah_h_25": "94.00",
            "event_ah_a_25": "6.00",
            "event_ah_h_15": "83.00",
            "event_ah_a_15": "17.00",
            "event_ah_h_05": "64.00",
            "event_ah_a_05": "36.00",
            "event_ah_h_-05": "39.00",
            "event_ah_a_-05": "61.00",
            "event_ah_h_-15": "19.00",
            "event_ah_a_-15": "81.00",
            "event_ah_h_-25": "7.00",
            "event_ah_a_-25": "93.00",
            "event_ah_h_-35": "2.00",
            "event_ah_a_-35": "98.00",
            "event_ah_h_-45": "1.00",
            "event_ah_a_-45": "99.00"
        }
    ]
}
              

PHP call example


  $APIkey=!_your_account_APIkey_!;
  $eventId = 86392;

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