Football (Soccer) documentation

  • Home
  • Football (Soccer) documentation

Endpoints

ALL SPORTS API - Football (Soccer) API Version 1.2 (old version)

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 api/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": "41",
      "country_name": "England"
    },
    {
      "country_key": "46",
      "country_name": "France"
    },
    {
      "country_key": "51",
      "country_name": "Germany"
    },
    {
      "country_key": "68",
      "country_name": "Italy"
    },
    {
      "country_key": "100",
      "country_name": "Netherlands"
    },
    {
      "country_key": "115",
      "country_name": "Portugal"
    },
    {
      "country_key": "124",
      "country_name": "Scotland"
    },
    {
      "country_key": "135",
      "country_name": "Spain"
    }
  ......
  ]
}
                

PHP call example


$APIkey='!_your_account_APIkey_!';

$curl_options = array(
  CURLOPT_URL => "https://allsportsapi.com/api/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 api/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": "195",
      "league_name": "Bundesliga",
      "country_key": "51",
      "country_name": "Germany",
      "league_logo": "https://allsportsapi.com/logo/logo_leagues/195_bundesliga.png"
    },
    {
      "league_key": "176",
      "league_name": "Ligue 1",
      "country_key": "46",
      "country_name": "France",
      "league_logo": "https://allsportsapi.com/logo/logo_leagues/176_ligue-1.png"
    },
    {
      "league_key": "148",
      "league_name": "Premier League",
      "country_key": "41",
      "country_name": "England",
      "league_logo": "https://allsportsapi.com/logo/logo_leagues/512_1.-lig.png"
    }
.......
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$countryId = 135;

$curl_options = array(
  CURLOPT_URL => "https://allsportsapi.com/api/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 api/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": "98146",
      "event_date": "2018-05-12",
      "event_time": "18:30",
      "event_home_team": "Dep. La Coruna",
      "home_team_key": "7093",
      "event_away_team": "Villarreal",
      "away_team_key": "7107",
      "event_halftime_result": "0 - 3",
      "event_final_result": "2 - 4",
      "event_ft_result": "",
      "event_penalty_result": "",
      "event_status": "Finished",
      "country_name": "SPAIN",
      "league_name": "LaLiga",
      "league_key": "468",
      "league_round": "Round 37",
      "league_season": "2017/2018",
      "event_live": "0",
      "event_stadium": "Estadio Municipal de Riazor (La Coruña)",
      "event_referee": "Hernandez A. (Esp)",
      "home_team_logo": "https://allsportsapi.com/logo/7093_dep.-la-coruna.png",
      "away_team_logo": "https://allsportsapi.com/logo/7107_villarreal.png",
      "event_country_key": "135",
      "event_home_formation": "4 - 3 - 3",
      "event_away_formation": "4 - 2 - 3 - 1",
      "goalscorers": [
        {
          "time": "2",
          "home_scorer": "",
          "score": "0 - 1",
          "away_scorer": "Castillejo S.",
          "score_info": ""
        },
        {
          "time": "31",
          "home_scorer": "",
          "score": "0 - 2",
          "away_scorer": "Trigueros M.",
          "score_info": ""
        },
        {
          "time": "45",
          "home_scorer": "",
          "score": "0 - 3",
          "away_scorer": "Castillejo S.",
          "score_info": ""
        },
        {
          "time": "58",
          "home_scorer": "Borja",
          "score": "1 - 3",
          "away_scorer": "",
          "score_info": ""
        }
      ],
      "cards": [
        {
          "time": "22",
          "home_fault": "Guilherme",
          "card": "yellow card",
          "away_fault": ""
        },
        {
          "time": "61",
          "home_fault": "Borja",
          "card": "yellow card",
          "away_fault": ""
        }
      ],
      "lineups": {
        "home_team": {
          "starting_lineups": [
            {
              "player": "Adrian (C)",
              "player_number": "15",
              "player_country": "Spain"
            },
            {
              "player": "Albentosa R.",
              "player_number": "6",
              "player_country": "Spain"
            },
            {
              "player": "Borja",
              "player_number": "19",
              "player_country": "Spain"
            },
            {
              "player": "Guilherme",
              "player_number": "20",
              "player_country": "Brazil"
            },
            {
              "player": "Juanfran",
              "player_number": "2",
              "player_country": "Spain"
            },
            {
              "player": "Krohn-Dehli M.",
              "player_number": "14",
              "player_country": "Denmark"
            },
            {
              "player": "Luisinho",
              "player_number": "16",
              "player_country": "Portugal"
            },
            {
              "player": "Navarro F.",
              "player_number": "3",
              "player_country": "Spain"
            },
            {
              "player": "Perez L.",
              "player_number": "7",
              "player_country": "Spain"
            },
            {
              "player": "Ruben (G)",
              "player_number": "13",
              "player_country": "Spain"
            },
            {
              "player": "Valverde F.",
              "player_number": "17",
              "player_country": "Uruguay"
            }
          ],
          "substitutes": [
            {
              "player": "Bakkali Z.",
              "player_number": "18",
              "player_country": "Belgium"
            },
            {
              "player": "Colak E.",
              "player_number": "8",
              "player_country": "Turkey"
            },
            {
              "player": "Koval M. (G)",
              "player_number": "25",
              "player_country": "Ukraine"
            },
            {
              "player": "Mosquera P.",
              "player_number": "5",
              "player_country": "Spain"
            },
            {
              "player": "Muntari S.",
              "player_number": "21",
              "player_country": "Ghana"
            },
            {
              "player": "Sadick M.",
              "player_number": "34",
              "player_country": "Spain"
            },
            {
              "player": "Valentin G.",
              "player_number": "23",
              "player_country": "Spain"
            }
          ],
          "coaches": [
            {
              "coache": "Seedorf C.",
              "coache_country": "Netherlands"
            }
          ]
        },
        "away_team": {
          "starting_lineups": [
            {
              "player": "Asenjo S. (G)",
              "player_number": "1",
              "player_country": "Spain"
            },
            {
              "player": "Bacca C.",
              "player_number": "9",
              "player_country": "Colombia"
            },
            {
              "player": "Castillejo S.",
              "player_number": "10",
              "player_country": "Spain"
            },
            {
              "player": "Fornals P.",
              "player_number": "8",
              "player_country": "Spain"
            },
            {
              "player": "Alvaro",
              "player_number": "3",
              "player_country": "Spain"
            },
            {
              "player": "Hernandez R.",
              "player_number": "16",
              "player_country": "Spain"
            },
            {
              "player": "Jaume",
              "player_number": "11",
              "player_country": "Spain"
            },
            {
              "player": "Mario Gaspar (C)",
              "player_number": "2",
              "player_country": "Spain"
            },
            {
              "player": "Raba",
              "player_number": "28",
              "player_country": "Spain"
            },
            {
              "player": "Ruiz V.",
              "player_number": "6",
              "player_country": "Spain"
            },
            {
              "player": "Trigueros M.",
              "player_number": "14",
              "player_country": "Spain"
            }
          ],
          "substitutes": [
            {
              "player": "Bonera D.",
              "player_number": "23",
              "player_country": "Italy"
            },
            {
              "player": "Cheryshev D.",
              "player_number": "7",
              "player_country": "Russia"
            },
            {
              "player": "Fernandez A. (G)",
              "player_number": "13",
              "player_country": "Spain"
            },
            {
              "player": "Fuego J.",
              "player_number": "19",
              "player_country": "Spain"
            },
            {
              "player": "Rukavina A.",
              "player_number": "22",
              "player_country": "Serbia"
            },
            {
              "player": "Sansone N.",
              "player_number": "18",
              "player_country": "Italy"
            },
            {
              "player": "Unal E.",
              "player_number": "15",
              "player_country": "Turkey"
            }
          ],
          "coaches": [
            {
              "coache": "Calleja Revilla J.",
              "coache_country": "Spain"
            }
          ]
        }
      },
      "statistics": [
        {
          "type": "Ball Possession",
          "home": "52%",
          "away": "48%"
        },
        {
          "type": "Goal Attempts",
          "home": "16",
          "away": "11"
        },
        {
          "type": "Shots on Goal",
          "home": "7",
          "away": "7"
        },
        {
          "type": "Shots off Goal",
          "home": "8",
          "away": "2"
        },
        {
          "type": "Blocked Shots",
          "home": "1",
          "away": "2"
        },
        {
          "type": "Free Kicks",
          "home": "9",
          "away": "17"
        },
        {
          "type": "Corner Kicks",
          "home": "11",
          "away": "0"
        },
        {
          "type": "Offsides",
          "home": "2",
          "away": "4"
        },
        {
          "type": "Goalkeeper Saves",
          "home": "3",
          "away": "5"
        },
        {
          "type": "Fouls",
          "home": "14",
          "away": "5"
        },
        {
          "type": "Yellow Cards",
          "home": "3",
          "away": "0"
        }
      ]
    }
.......
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$from = '2018-05-23';
$to = '2018-05-23';

$curl_options = array(
  CURLOPT_URL => "https://allsportsapi.com/api/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 api/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": "70876",
        "event_date": "2018-01-24",
        "event_time": "21:00",
        "event_home_team": "Arsenal",
        "home_team_key": "2617",
        "event_away_team": "Chelsea",
        "away_team_key": "2616",
        "event_halftime_result": "1 - 1",
        "event_final_result": "2 - 1",
        "event_ft_result": "",
        "event_penalty_result": "",
        "event_status": "Finished",
        "country_name": "ENGLAND",
        "league_name": "Carabao Cup",
        "league_key": "8640",
        "league_round": "Semi-finals",
        "league_season": "",
        "event_live": "0",
        "event_country_key": "41"
      },
      {
        "event_key": "68621",
        "event_date": "2018-01-10",
        "event_time": "21:00",
        "event_home_team": "Chelsea",
        "home_team_key": "2616",
        "event_away_team": "Arsenal",
        "away_team_key": "2617",
        "event_halftime_result": "0 - 0",
        "event_final_result": "0 - 0",
        "event_status": "Finished",
        "country_name": "ENGLAND",
        "league_name": "Carabao Cup",
        "league_key": "8640",
        "league_round": "Semi-finals",
        "league_season": "",
        "event_live": "0",
        "event_country_key": "41"
      },
      {
        "event_key": "68013",
        "event_date": "2018-01-03",
        "event_time": "20:45",
        "event_home_team": "Arsenal",
        "home_team_key": "2617",
        "event_away_team": "Chelsea",
        "away_team_key": "2616",
        "event_halftime_result": "0 - 0",
        "event_final_result": "2 - 2",
        "event_status": "Finished",
        "country_name": "ENGLAND",
        "league_name": "Premier League",
        "league_key": "148",
        "league_round": "Round 22",
        "league_season": "",
        "event_live": "0",
        "event_country_key": "41"
      },
      {
        "event_key": "13324",
        "event_date": "2017-09-17",
        "event_time": "14:30",
        "event_home_team": "Chelsea",
        "home_team_key": "2616",
        "event_away_team": "Arsenal",
        "away_team_key": "2617",
        "event_halftime_result": "0 - 0",
        "event_final_result": "0 : 0",
        "event_status": "Finished",
        "country_name": "ENGLAND",
        "league_name": "Premier League",
        "league_key": "148",
        "league_round": "Round 5",
        "league_season": "",
        "event_live": "0",
        "event_country_key": "41"
      }
    ],
    "firstTeamResults": [
      {
        "event_key": "99967",
        "event_date": "2018-05-19",
        "event_time": "18:15",
        "event_home_team": "Chelsea",
        "home_team_key": "2616",
        "event_away_team": "Manchester United",
        "away_team_key": "2627",
        "event_halftime_result": null,
        "event_final_result": "1 - 0",
        "event_status": "Finished",
        "country_name": "ENGLAND",
        "league_name": "FA Cup",
        "league_key": "8639",
        "league_round": "Final",
        "league_season": "",
        "event_live": "0",
        "event_country_key": "41"
      },
      {
        "event_key": "98613",
        "event_date": "2018-05-13",
        "event_time": "16:00",
        "event_home_team": "Newcastle",
        "home_team_key": "2630",
        "event_away_team": "Chelsea",
        "away_team_key": "2616",
        "event_halftime_result": "1 - 0",
        "event_final_result": "3 - 0",
        "event_status": "Finished",
        "country_name": "ENGLAND",
        "league_name": "Premier League",
        "league_key": "148",
        "league_round": "Round 38",
        "league_season": "",
        "event_live": "0",
        "event_country_key": "41"
      },
      {
        "event_key": "97642",
        "event_date": "2018-05-09",
        "event_time": "20:45",
        "event_home_team": "Chelsea",
        "home_team_key": "2616",
        "event_away_team": "Huddersfield",
        "away_team_key": "2622",
        "event_halftime_result": "0 - 0",
        "event_final_result": "1 - 1",
        "event_status": "Finished",
        "country_name": "ENGLAND",
        "league_name": "Premier League",
        "league_key": "148",
        "league_round": "Round 35",
        "league_season": "",
        "event_live": "0",
        "event_country_key": "41"
      },
      {
        "event_key": "96795",
        "event_date": "2018-05-06",
        "event_time": "17:30",
        "event_home_team": "Chelsea",
        "home_team_key": "2616",
        "event_away_team": "Liverpool",
        "away_team_key": "2621",
        "event_halftime_result": "1 - 0",
        "event_final_result": "1 - 0",
        "event_status": "Finished",
        "country_name": "ENGLAND",
        "league_name": "Premier League",
        "league_key": "148",
        "league_round": "Round 37",
        "league_season": "",
        "event_live": "0",
        "event_country_key": "41"
      }
    ],
    "secondTeamResults": [
      {
        "event_key": "98610",
        "event_date": "2018-05-13",
        "event_time": "16:00",
        "event_home_team": "Huddersfield",
        "home_team_key": "2622",
        "event_away_team": "Arsenal",
        "away_team_key": "2617",
        "event_halftime_result": "0 - 1",
        "event_final_result": "0 - 1",
        "event_status": "Finished",
        "country_name": "ENGLAND",
        "league_name": "Premier League",
        "league_key": "148",
        "league_round": "Round 38",
        "league_season": "",
        "event_live": "0",
        "event_country_key": "41"
      },
      {
        "event_key": "83075",
        "event_date": "2018-05-09",
        "event_time": "20:45",
        "event_home_team": "Leicester",
        "home_team_key": "2611",
        "event_away_team": "Arsenal",
        "away_team_key": "2617",
        "event_halftime_result": "1 - 0",
        "event_final_result": "3 - 1",
        "event_status": "Finished",
        "country_name": "ENGLAND",
        "league_name": "Premier League",
        "league_key": "148",
        "league_round": "Round 31",
        "league_season": "",
        "event_live": "0",
        "event_country_key": "41"
      },
      {
        "event_key": "96794",
        "event_date": "2018-05-06",
        "event_time": "17:30",
        "event_home_team": "Arsenal",
        "home_team_key": "2617",
        "event_away_team": "Burnley",
        "away_team_key": "2629",
        "event_halftime_result": "2 - 0",
        "event_final_result": "5 - 0",
        "event_status": "Finished",
        "country_name": "ENGLAND",
        "league_name": "Premier League",
        "league_key": "148",
        "league_round": "Round 37",
        "league_season": "",
        "event_live": "0",
        "event_country_key": "41"
      },
      {
        "event_key": "95975",
        "event_date": "2018-05-03",
        "event_time": "21:05",
        "event_home_team": "Atl. Madrid",
        "home_team_key": "7106",
        "event_away_team": "Arsenal",
        "away_team_key": "2617",
        "event_halftime_result": "1 - 0",
        "event_final_result": "1 - 0",
        "event_status": "Finished",
        "country_name": "EUROPE",
        "league_name": "Europa League",
        "league_key": "590",
        "league_round": "Semi-finals",
        "league_season": "",
        "event_live": "0",
        "event_country_key": "165"
      }
    ]
  }
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$firstTeamId=2616;
$secondTeamId=2617;

$curl_options = array(
  CURLOPT_URL => "https://allsportsapi.com/api/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 api/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": "98146",
      "event_date": "2018-05-12",
      "event_time": "18:30",
      "event_home_team": "Dep. La Coruna",
      "home_team_key": "7093",
      "event_away_team": "Villarreal",
      "away_team_key": "7107",
      "event_halftime_result": "0 - 3",
      "event_final_result": "2 - 4",
      "event_status": "Finished",
      "country_name": "SPAIN",
      "league_name": "LaLiga",
      "league_key": "468",
      "league_round": "Round 37",
      "league_season": "2017/2018",
      "event_live": "1",
      "event_stadium": "Estadio Municipal de Riazor (La Coruña)",
      "event_referee": "Hernandez A. (Esp)",
      "event_country_key": "135",
      "event_home_formation": "4 - 3 - 3",
      "event_away_formation": "4 - 2 - 3 - 1",
      "goalscorers": [
        {
          "time": "2",
          "home_scorer": "",
          "score": "0 - 1",
          "away_scorer": "Castillejo S.",
          "score_info": ""
        },
        {
          "time": "31",
          "home_scorer": "",
          "score": "0 - 2",
          "away_scorer": "Trigueros M.",
          "score_info": ""
        },
        {
          "time": "45",
          "home_scorer": "",
          "score": "0 - 3",
          "away_scorer": "Castillejo S.",
          "score_info": ""
        },
        {
          "time": "58",
          "home_scorer": "Borja",
          "score": "1 - 3",
          "away_scorer": "",
          "score_info": ""
        }
      ],
      "cards": [
        {
          "time": "22",
          "home_fault": "Guilherme",
          "card": "yellow card",
          "away_fault": "",
          "score_info": ""
        },
        {
          "time": "61",
          "home_fault": "Borja",
          "card": "yellow card",
          "away_fault": "",
          "score_info": ""
        }
      ],
      "lineups": {
        "home_team": {
          "starting_lineups": [
            {
              "player": "Adrian (C)",
              "player_number": "15",
              "player_country": "Spain"
            },
            {
              "player": "Albentosa R.",
              "player_number": "6",
              "player_country": "Spain"
            },
            {
              "player": "Borja",
              "player_number": "19",
              "player_country": "Spain"
            },
            {
              "player": "Guilherme",
              "player_number": "20",
              "player_country": "Brazil"
            },
            {
              "player": "Juanfran",
              "player_number": "2",
              "player_country": "Spain"
            },
            {
              "player": "Krohn-Dehli M.",
              "player_number": "14",
              "player_country": "Denmark"
            },
            {
              "player": "Luisinho",
              "player_number": "16",
              "player_country": "Portugal"
            },
            {
              "player": "Navarro F.",
              "player_number": "3",
              "player_country": "Spain"
            },
            {
              "player": "Perez L.",
              "player_number": "7",
              "player_country": "Spain"
            },
            {
              "player": "Ruben (G)",
              "player_number": "13",
              "player_country": "Spain"
            },
            {
              "player": "Valverde F.",
              "player_number": "17",
              "player_country": "Uruguay"
            }
          ],
          "substitutes": [
            {
              "player": "Bakkali Z.",
              "player_number": "18",
              "player_country": "Belgium"
            },
            {
              "player": "Colak E.",
              "player_number": "8",
              "player_country": "Turkey"
            },
            {
              "player": "Koval M. (G)",
              "player_number": "25",
              "player_country": "Ukraine"
            },
            {
              "player": "Mosquera P.",
              "player_number": "5",
              "player_country": "Spain"
            },
            {
              "player": "Muntari S.",
              "player_number": "21",
              "player_country": "Ghana"
            },
            {
              "player": "Sadick M.",
              "player_number": "34",
              "player_country": "Spain"
            },
            {
              "player": "Valentin G.",
              "player_number": "23",
              "player_country": "Spain"
            }
          ],
          "coaches": [
            {
              "coache": "Seedorf C.",
              "coache_country": "Netherlands"
            }
          ]
        },
        "away_team": {
          "starting_lineups": [
            {
              "player": "Asenjo S. (G)",
              "player_number": "1",
              "player_country": "Spain"
            },
            {
              "player": "Bacca C.",
              "player_number": "9",
              "player_country": "Colombia"
            },
            {
              "player": "Castillejo S.",
              "player_number": "10",
              "player_country": "Spain"
            },
            {
              "player": "Fornals P.",
              "player_number": "8",
              "player_country": "Spain"
            },
            {
              "player": "Alvaro",
              "player_number": "3",
              "player_country": "Spain"
            },
            {
              "player": "Hernandez R.",
              "player_number": "16",
              "player_country": "Spain"
            },
            {
              "player": "Jaume",
              "player_number": "11",
              "player_country": "Spain"
            },
            {
              "player": "Mario Gaspar (C)",
              "player_number": "2",
              "player_country": "Spain"
            },
            {
              "player": "Raba",
              "player_number": "28",
              "player_country": "Spain"
            },
            {
              "player": "Ruiz V.",
              "player_number": "6",
              "player_country": "Spain"
            },
            {
              "player": "Trigueros M.",
              "player_number": "14",
              "player_country": "Spain"
            }
          ],
          "substitutes": [
            {
              "player": "Bonera D.",
              "player_number": "23",
              "player_country": "Italy"
            },
            {
              "player": "Cheryshev D.",
              "player_number": "7",
              "player_country": "Russia"
            },
            {
              "player": "Fernandez A. (G)",
              "player_number": "13",
              "player_country": "Spain"
            },
            {
              "player": "Fuego J.",
              "player_number": "19",
              "player_country": "Spain"
            },
            {
              "player": "Rukavina A.",
              "player_number": "22",
              "player_country": "Serbia"
            },
            {
              "player": "Sansone N.",
              "player_number": "18",
              "player_country": "Italy"
            },
            {
              "player": "Unal E.",
              "player_number": "15",
              "player_country": "Turkey"
            }
          ],
          "coaches": [
            {
              "coache": "Calleja Revilla J.",
              "coache_country": "Spain"
            }
          ]
        }
      },
      "statistics": [
        {
          "type": "Ball Possession",
          "home": "52%",
          "away": "48%"
        },
        {
          "type": "Goal Attempts",
          "home": "16",
          "away": "11"
        },
        {
          "type": "Shots on Goal",
          "home": "7",
          "away": "7"
        },
        {
          "type": "Shots off Goal",
          "home": "8",
          "away": "2"
        },
        {
          "type": "Blocked Shots",
          "home": "1",
          "away": "2"
        },
        {
          "type": "Free Kicks",
          "home": "9",
          "away": "17"
        },
        {
          "type": "Corner Kicks",
          "home": "11",
          "away": "0"
        },
        {
          "type": "Offsides",
          "home": "2",
          "away": "4"
        },
        {
          "type": "Goalkeeper Saves",
          "home": "3",
          "away": "5"
        },
        {
          "type": "Fouls",
          "home": "14",
          "away": "5"
        },
        {
          "type": "Yellow Cards",
          "home": "3",
          "away": "0"
        }
      ]
    }
.......
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;

$curl_options = array(
  CURLOPT_URL => "https://allsportsapi.com/api/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 api/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": "",
        "standing_team": "Hapoel Bnei Lod",
        "standing_P": "36",
        "standing_W": "15",
        "standing_D": "9",
        "standing_L": "12",
        "standing_F": "43",
        "standing_A": "37",
        "standing_GD": "6",
        "standing_PTS": "54",
        "team_key": "4124",
        "league_key": "258",
        "league_season": "2017/2018",
        "league_round": "",
        "standing_updated": "2018-05-14 19:55:13"
      },
      {
        "standing_place": "2",
        "standing_place_type": "",
        "standing_team": "Hapoel Petah Tikva",
        "standing_P": "36",
        "standing_W": "14",
        "standing_D": "10",
        "standing_L": "12",
        "standing_F": "45",
        "standing_A": "40",
        "standing_GD": "5",
        "standing_PTS": "52",
        "team_key": "4125",
        "league_key": "258",
        "league_season": "2017/2018",
        "league_round": "",
        "standing_updated": "2018-05-14 19:55:13"
      }
.......
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$leagueId = 258;

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

            


Topscorers


Method

GET/POST api/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": "Dayan G.",
      "player_key": 1642004408,
      "team_name": "H. Nazareth",
      "team_key": "4133",
      "goals": "13"
    },
    {
      "player_place": "1",
      "player_name": "Zikri R.",
      "player_key": 674365466,
      "team_name": "Hapoel Kfar-Saba",
      "team_key": "4131",
      "goals": "13"
    },
    {
      "player_place": "3",
      "player_name": "Fadida O.",
      "player_key": 3153059605,
      "team_name": "Hapoel Kfar-Saba",
      "team_key": "4131",
      "goals": "11"
    },
    {
      "player_place": "3",
      "player_name": "Guma A.",
      "player_key": 223710137,
      "team_name": "Hapoel Hadera",
      "team_key": "4127",
      "goals": "11"
    }
.......
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$leagueId = 258;

$curl_options = array(
  CURLOPT_URL => "https://allsportsapi.com/api/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 api/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": "2616",
      "team_name": "Chelsea",
      "team_logo": "https://allsportsapi.com/logo/2616_chelsea.png",
      "players": [
        {
          "player_key": 3172678050,
          "player_name": "Bulka Marcin",
          "player_number": "1",
          "player_country": "Poland",
          "player_type": "Goalkeepers",
          "player_age": "18",
          "player_match_played": "0",
          "player_goals": "0",
          "player_yellow_cards": "0",
          "player_red_cards": "0"
        },
        {
          "player_key": 2059460065,
          "player_name": "Caballero Wilfredo",
          "player_number": "1",
          "player_country": "Argentina",
          "player_type": "Goalkeepers",
          "player_age": "36",
          "player_match_played": "0",
          "player_goals": "0",
          "player_yellow_cards": "0",
          "player_red_cards": "0"
        },
        {
          "player_key": 3383592810,
          "player_name": "Courtois Thibaut",
          "player_number": "13",
          "player_country": "Belgium",
          "player_type": "Goalkeepers",
          "player_age": "25",
          "player_match_played": "21",
          "player_goals": "0",
          "player_yellow_cards": "0",
          "player_red_cards": "0"
        }
.......
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$teamId = 2616;

$curl_options = array(
  CURLOPT_URL => "https://allsportsapi.com/api/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 api/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": 3183500916,
      "player_name": "Ronaldo Cristiano",
      "player_number": "7",
      "player_country": "Portugal",
      "player_type": "Forwards",
      "player_age": "32",
      "player_match_played": "12",
      "player_goals": "4",
      "player_yellow_cards": "1",
      "player_red_cards": "0",
      "team_name": "Real Madrid",
      "team_key": "7099"
    }
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$playerName = 'Ronaldo Cristiano';

$curl_options = array(
  CURLOPT_URL => "https://allsportsapi.com/api/football/?met=Players&APIkey=$APIkey&playerName=$playerName",
  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 api/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": [
    {
      "video_title": "Goal - 1:0 - 12'\n Poli A., Bologna",
      "video_url": "https://cc.sporttube.com/embed/leMCCCG/no-preload"
    },
    {
      "video_title": "Goal - 1:1 - 38'\n Babacar K., Sassuolo",
      "video_url": "https://cc.sporttube.com/embed/TeMCCCG/no-preload"
    },
    {
      "video_title": "Yellow Card - 86'\n Goldaniga E., Sassuolo",
      "video_url": "https://cc.sporttube.com/embed/EeMCCCG/no-preload"
    },
    {
      "video_title": "Goal - 2:1 - 88'\n Pulgar E., Bologna",
      "video_url": "https://cc.sporttube.com/embed/FeMCCCG/no-preload"
    },
    {
      "video_title": "Highlights",
      "video_url": "https://streamable.com/e/0d35p"
    }
  ]
}
            

PHP call example


$APIkey=!_your_account_APIkey_!;
$eventId = 76387;

$curl_options = array(
  CURLOPT_URL => "https://allsportsapi.com/api/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 api/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": {
                      "160932": [
                          {
                            {
                                "match_id": "160932",
                                "odd_bookmakers": "22Bet",
                                "odd_1": "4.78",
                                "odd_x": "3.96",
                                "odd_2": "1.65",
                                "odd_1x": "2.29",
                                "odd_12": "1.28",
                                "odd_x2": "1.21",
                                "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": "10.50",
                                "ah-1.5_2": "1.05",
                                "ah-1_1": "8.70",
                                "ah-1_2": "1.06",
                                "ah0_1": "3.46",
                                "ah0_2": "1.31",
                                "ah+0.5_1": null,
                                "ah+1_1": "1.70",
                                "ah+1_2": "2.16",
                                "ah+1.5_1": "1.42",
                                "ah+1.5_2": "2.86",
                                "ah+2_1": "1.19",
                                "ah+2_2": "4.64",
                                "ah+2.5_1": "1.14",
                                "ah+2.5_2": "5.60",
                                "ah+3_1": "1.05",
                                "ah+3_2": "9.80",
                                "ah+3.5_1": "1.04",
                                "ah+3.5_2": "10.50",
                                "ah+4_1": null,
                                "ah+4_2": null,
                                "ah+4.5_1": null,
                                "ah+4.5_2": null,
                                "o+0.5": "1.02",
                                "u+0.5": "12.50",
                                "o+1": "1.04",
                                "u+1": "10.50",
                                "o+1.5": "1.22",
                                "u+1.5": "4.28",
                                "o+2": "1.34",
                                "u+2": "3.24",
                                "o+2.5": "1.75",
                                "u+2.5": "2.08",
                                "o+3": "2.18",
                                "u+3": "1.69",
                                "o+3.5": "2.69",
                                "u+3.5": "1.47",
                                "o+4": "4.28",
                                "u+4": "1.22",
                                "o+4.5": "5.10",
                                "u+4.5": "1.17",
                                "o+5": "8.20",
                                "u+5": "1.08",
                                "o+5.5": "10.50",
                                "u+5.5": "1.05",
                                "bts_yes": "1.66",
                                "bts_no": "2.14"
                            },
                            ......

                        }
                      ]
                    }
                  }
              

PHP call example


  $APIkey=!_your_account_APIkey_!;
  $eventId = 160932;

  $curl_options = array(
    CURLOPT_URL => "https://allsportsapi.com/api/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 api/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":"405595",
                          "country_key":"32",
                          "country_name":"Cyprus",
                          "league_key":"115",
                          "league_name":"Division 2",
                          "event_date":"2021-02-24",
                          "event_time":"14:15",
                          "event_status":"Finished",
                          "home_team_key":"2148",
                          "event_home_team":"Othellos Athienou",
                          "event_away_team":"Sotiras",
                          "away_team_key":"2160",
                          "event_halftime_result":"2 -2",
                          "event_final_result":"2\u00a0-\u00a02",
                          "event_ft_result":"",
                          "event_penalty_result":"",
                          "event_home_formation":null,
                          "event_away_formation":null,
                          "event_live":"0",
                          "event_HW":"49.00",
                          "event_D":"24.00",
                          "event_AW":"27.00",
                          "event_HW_D":"73.00",
                          "event_AW_D":"51.00",
                          "event_HW_AW":"76.00",
                          "event_O":"54.00",
                          "event_U":"46.00",
                          "event_O_1":"77.00",
                          "event_U_1":"23.00",
                          "event_O_3":"31.00",
                          "event_U_3":"69.00",
                          "event_bts":"56.00",
                          "event_ots":"44.00",
                          "event_ah_h_45":"100.00",
                          "event_ah_a_45":"0.00",
                          "event_ah_h_35":"99.00",
                          "event_ah_a_35":"1.00",
                          "event_ah_h_25":"97.00",
                          "event_ah_a_25":"3.00",
                          "event_ah_h_15":"89.00",
                          "event_ah_a_15":"11.00",
                          "event_ah_h_05":"73.00",
                          "event_ah_a_05":"27.00",
                          "event_ah_h_-05":"49.00",
                          "event_ah_a_-05":"51.00",
                          "event_ah_h_-15":"26.00",
                          "event_ah_a_-15":"74.00",
                          "event_ah_h_-25":"11.00",
                          "event_ah_a_-25":"89.00",
                          "event_ah_h_-35":"4.00",
                          "event_ah_a_-35":"96.00",
                          "event_ah_h_-45":"1.00",
                          "event_ah_a_-45":"99.00"
                      },
                      ......
                    ]
                  }
              

PHP call example


  $APIkey=!_your_account_APIkey_!;
  $eventId = 405595;

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