Documentation

  • Version: 2.0.3
  • Created: 2019-06-01
  • Latest Update: 2020-10-10

Countries


Method

GET apiv2.apifootball.com/?action=get_countries

Returns list of supported countries included in your current subscription plan


Parameters

Parameter Description
action API method name
APIkey Authorization code generated from your apifootball account

Request URL


JSON Response

[
  {
	"country_id": "41",
	"country_name": "England"
  },
  {
    "country_id": "68",
    "country_name": "Italy"
  },
  {
    "country_id": "135",
    "country_name": "Spain"
  },
  {
    "country_id": "51",
    "country_name": "Germany"
  },
  }
    "country_id": "46",
    "country_name": "France"
  },
  {
    "country_id": "100",
    "country_name": "Netherlands"
  },
  {
    "country_id": "13",
    "country_name": "Belgium"
  },
  {
    "country_id": "115",
    "country_name": "Portugal"
  },
  {
    "country_id": "124",
    "country_name": "Scotland"
  },
    ....
]
            

PHP call example


$APIkey='xxxxxxxxxxxxxx';

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

            

Competitions


Method

GET apiv2.apifootball.com/?action=get_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 apifootball account
country_id Country ID - if set only leagues from specific country will be returned (Optional)

Request URL


JSON Response

[
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "149",
    "league_name": "Championship"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "8640",
    "league_name": "EFL Cup"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "8401",
    "league_name": "EFL Trophy"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "8641",
    "league_name": "FA Community Shield"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "8639",
    "league_name": "FA Cup"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "9478",
    "league_name": "FA Cup Women"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "8642",
    "league_name": "FA Trophy"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "157",
    "league_name": "Isthmian League Premier Division"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "150",
    "league_name": "League One"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "151",
    "league_name": "League Two"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "152",
    "league_name": "National League"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "153",
    "league_name": "National League North"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "154",
    "league_name": "National League South"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "156",
    "league_name": "NPL Premier Division"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "148",
    "league_name": "Premier League"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "8635",
    "league_name": "Premier League 2"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "8643",
    "league_name": "Premier League Cup"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "8644",
    "league_name": "Premier League International Cup"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "8637",
    "league_name": "Premier League U18"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "8638",
    "league_name": "Premier League U21"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "8636",
    "league_name": "Professional Development League"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "9663",
    "league_name": "Southern League Central Division"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "9662",
    "league_name": "Southern League South Division"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "155",
    "league_name": "Southern Premier League"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "8645",
    "league_name": "WSL 1 Women"
  },
  {
    "country_id": "41",
    "country_name": "England",
    "league_id": "8646",
    "league_name": "WSL 2 Women"
  }
]
            

PHP call example


$APIkey='xxxxxxxxxxxxxx';
$country_id = 41;

$curl_options = array(
  CURLOPT_URL => "https://apiv2.apifootball.com/?action=get_leagues&country_id=$country_id&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);

            

Teams


Method

GET apiv2.apifootball.com/?action=get_teams

Returns list of available teams


Parameters

Parameter Description
action API method name
APIkey Authorization code generated from your apifootball account
team_id Team ID - team id mandatory if league id is not set
league_id League ID - league id mandatory if team id is not set

Request URL


JSON Response

[
  {
    "team_key": "2611",
    "team_name": "Leicester",
    "team_badge": "https://apiv2.apifootball.com/badges/2611_leicester.png",
    "players": [
      {
        "player_key": 2683922391,
        "player_name": "Jakupovic Eldin",
        "player_number": "1",
        "player_country": "Switzerland",
        "player_type": "Goalkeepers",
        "player_age": "34",
        "player_match_played": "0",
        "player_goals": "0",
        "player_yellow_cards": "0",
        "player_red_cards": "0"
      },
      {
        "player_key": 140150332,
        "player_name": "Schmeichel Kasper",
        "player_number": "1",
        "player_country": "Denmark",
        "player_type": "Goalkeepers",
        "player_age": "32",
        "player_match_played": "38",
        "player_goals": "0",
        "player_yellow_cards": "3",
        "player_red_cards": "0"
      },
	  .........
    "coaches": [
      {
        "coach_name": "Rodgers Brendan",
        "coach_country": "Northern Ireland",
        "coach_age": "46"
      }
    ]
  },
  {
    "team_key": "2612",
    "team_name": "Everton",
    "team_badge": "https://apiv2.apifootball.com/badges/2612_everton.png",
    "players": [
      {
        "player_key": 2428303769,
        "player_name": "Pickford Jordan",
        "player_number": "1",
        "player_country": "England",
        "player_type": "Goalkeepers",
        "player_age": "25",
        "player_match_played": "38",
        "player_goals": "0",
        "player_yellow_cards": "1",
        "player_red_cards": "0"
      },
      {
        "player_key": 3962487041,
        "player_name": "Stekelenburg Maarten",
        "player_number": "22",
        "player_country": "Netherlands",
        "player_type": "Goalkeepers",
        "player_age": "36",
        "player_match_played": "0",
        "player_goals": "0",
        "player_yellow_cards": "0",
        "player_red_cards": "0"
      },
	.....
	    "coaches": [
      {
        "coach_name": "da Silva Marco",
        "coach_country": "Portugal",
        "coach_age": "41"
      }
    ]
  },
  .....
]
            

PHP call example


$APIkey='xxxxxxxxxxxxxx';
$league_id = 148;

$curl_options = array(
  CURLOPT_URL => "https://apiv2.apifootball.com/?action=get_teams&league_id=$league_id&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);

            

Players


Method

GET apiv2.apifootball.com/?action=get_players

Returns available players


Parameters

Parameter Description
action API method name
APIkey Authorization code generated from your apifootball account
player_id Player ID - mandatory if player name is not set
player_name Player Name - mandatory if player id is not set

Request URL


JSON Response

[
  {
    "player_key": 3183500916,
    "player_name": "Ronaldo Cristiano",
    "player_number": "7",
    "player_country": "Portugal",
    "player_type": "Forwards",
    "player_age": "34",
    "player_match_played": "31",
    "player_goals": "21",
    "player_yellow_cards": "3",
    "player_red_cards": "0",
    "team_name": "Juventus",
    "team_key": "4187"
  }
]
            

PHP call example


$APIkey='xxxxxxxxxxxxxx';
$player_name = "ronaldo cristiano";

$curl_options = array(
  CURLOPT_URL => "https://apiv2.apifootball.com/?action=get_players&player_name=$player_name&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 apiv2.apifootball.com/?action=get_standings

Returns standings for leagues included in your current subscription plan


Parameters

Parameter Description
action API method name
APIkey Authorization code generated from your apifootball account
league_id League internal code

Request URL


JSON Response

[
  {
    "country_name": "England",
    "league_id": "148",
    "league_name": "Premier League",
    "team_id": "2626",
    "team_name": "Manchester City",
    "overall_league_position": "1",
    "overall_league_payed": "38",
    "overall_league_W": "32",
    "overall_league_D": "2",
    "overall_league_L": "4",
    "overall_league_GF": "95",
    "overall_league_GA": "23",
    "overall_league_PTS": "98",
    "home_league_position": "1",
    "home_league_payed": "19",
    "home_league_W": "18",
    "home_league_D": "0",
    "home_league_L": "1",
    "home_league_GF": "57",
    "home_league_GA": "12",
    "home_league_PTS": "54",
    "away_league_position": "1",
    "away_league_payed": "19",
    "away_league_W": "14",
    "away_league_D": "2",
    "away_league_L": "3",
    "away_league_GF": "38",
    "away_league_GA": "11",
    "away_league_PTS": "44"
  },
  {
    "country_name": "England",
    "league_id": "148",
    "league_name": "Premier League",
    "team_id": "2621",
    "team_name": "Liverpool",
    "overall_league_position": "2",
    "overall_league_payed": "38",
    "overall_league_W": "30",
    "overall_league_D": "7",
    "overall_league_L": "1",
    "overall_league_GF": "89",
    "overall_league_GA": "22",
    "overall_league_PTS": "97",
    "home_league_position": "2",
    "home_league_payed": "19",
    "home_league_W": "17",
    "home_league_D": "2",
    "home_league_L": "0",
    "home_league_GF": "55",
    "home_league_GA": "10",
    "home_league_PTS": "53",
    "away_league_position": "2",
    "away_league_payed": "19",
    "away_league_W": "13",
    "away_league_D": "5",
    "away_league_L": "1",
    "away_league_GF": "34",
    "away_league_GA": "12",
    "away_league_PTS": "44"
  },
  ......
]
            

PHP call example


$APIkey='xxxxxxxxxxxxxx';
$league_id = 148;

$curl_options = array(
  CURLOPT_URL => "https://apiv2.apifootball.com/?action=get_standings&league_id=$league_id&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);
?>

            

Events (Results / Fixtures)


Method

GET apiv2.apifootball.com/?action=get_events

Returns events included in your current subscription plan


Parameters

Parameter Description
action API method name
APIkey Authorization code generated from your apifootball account
timezone Default timezone: Europe/Berlin. With this filter you can set the timezone where you want to receive the data. Timezone is in TZ format (exemple: America/New_York). (Optional)
from Start date (yyyy-mm-dd)
to Stop date (yyyy-mm-dd)
country_id Country ID - if set only leagues from specific country will be returned (Optional)
league_id League ID - if set events from specific league will be returned (Optional)
match_id Match ID - if set only details from specific match will be returned (Optional)
team_id Team ID - if set only details from specific team will be returned (Optional)

Request URL


JSON Response

 [
  {
    "match_id": "194200",
    "country_id": "41",
    "country_name": "England",
    "league_id": "148",
    "league_name": "Premier League",
    "match_date": "2019-04-01",
    "match_status": "Finished",
    "match_time": "21:00",
    "match_hometeam_id": "2617",
    "match_hometeam_name": "Arsenal",
    "match_hometeam_score": "2 ",
    "match_awayteam_name": "Newcastle",
    "match_awayteam_id": "2630",
    "match_awayteam_score": " 0",
    "match_hometeam_halftime_score": "1",
    "match_awayteam_halftime_score": "0",
    "match_hometeam_extra_score": "1",
    "match_awayteam_extra_score": "0",
    "match_hometeam_penalty_score": "",
    "match_awayteam_penalty_score": "",
    "match_hometeam_ft_score": "",
    "match_awayteam_ft_score": "",
    "match_hometeam_system": "3 - 4 - 2 - 1",
    "match_awayteam_system": "5 - 4 - 1",
    "match_live": "0",
    "match_round": "Round 32",
    "match_stadium": "",
    "match_referee": "",
    "team_home_badge": "https://apiv2.apifootball.com/badges/2617_arsenal.png",
    "team_away_badge": "https://apiv2.apifootball.com/badges/2630_newcastle.png",
    "league_logo": "https://apiv2.apifootball.com/badges/logo_leagues/148_premier-league.png",
    "country_logo": "https://apiv2.apifootball.com/badges/logo_leagues/41_england.png",
    "goalscorer": [
      {
        "time": "30",
        "home_scorer": "Ramsey A.",
        "score": "1 - 0",
        "away_scorer": "",
        "info": ""
      },
      {
        "time": "83",
        "home_scorer": "Lacazette A.",
        "score": "2 - 0",
        "away_scorer": "",
        "info": ""
      }
    ],
    "cards": [
      {
        "time": "59",
        "home_fault": "Monreal N.",
        "card": "yellow card",
        "away_fault": "",
        "info": ""
      },
      {
        "time": "71",
        "home_fault": "Kolasinac S.",
        "card": "yellow card",
        "away_fault": "",
        "info": ""
      }
    ],
    "substitutions": {
      "home": [
        {
          "time": "61",
          "substitution": "Iwobi A. | Aubameyang P."
        },
        {
          "time": "67",
          "substitution": "Ramsey A. | Elneny M."
        },
        {
          "time": "84",
          "substitution": "Ozil M. | Mkhitaryan H."
        }
      ],
      "away": [
        {
          "time": "67",
          "substitution": "Hayden I. | Ki Sung-Yong"
        },
        {
          "time": "75",
          "substitution": "Ritchie M. | Kenedy"
        },
        {
          "time": "77",
          "substitution": "Perez A. | Muto Y."
        }
      ]
    },
    "lineup": {
      "home": {
        "starting_lineups": [
          {
            "lineup_player": "Guendouzi M.",
            "lineup_number": "29",
            "lineup_position": "7"
          },
          {
            "lineup_player": "Iwobi A.",
            "lineup_number": "17",
            "lineup_position": "10"
          },
          {
            "lineup_player": "Kolasinac S.",
            "lineup_number": "31",
            "lineup_position": "8"
          },
          {
            "lineup_player": "Lacazette A.",
            "lineup_number": "9",
            "lineup_position": "11"
          },
          {
            "lineup_player": "Leno B. (G)",
            "lineup_number": "19",
            "lineup_position": "1"
          },
          {
            "lineup_player": "Maitland-Niles A.",
            "lineup_number": "15",
            "lineup_position": "5"
          },
          {
            "lineup_player": "Monreal N.",
            "lineup_number": "18",
            "lineup_position": "4"
          },
          {
            "lineup_player": "Mustafi S.",
            "lineup_number": "20",
            "lineup_position": "2"
          },
          {
            "lineup_player": "Ozil M.",
            "lineup_number": "10",
            "lineup_position": "9"
          },
          {
            "lineup_player": "Ramsey A. (C)",
            "lineup_number": "8",
            "lineup_position": "6"
          },
          {
            "lineup_player": "Sokratis",
            "lineup_number": "5",
            "lineup_position": "3"
          }
        ],
        "substitutes": [
          {
            "lineup_player": "Aubameyang P.",
            "lineup_number": "14",
            "lineup_position": ""
          },
          {
            "lineup_player": "Cech P. (G)",
            "lineup_number": "1",
            "lineup_position": ""
          },
          {
            "lineup_player": "Elneny M.",
            "lineup_number": "4",
            "lineup_position": ""
          },
          {
            "lineup_player": "Jenkinson C.",
            "lineup_number": "25",
            "lineup_position": ""
          },
          {
            "lineup_player": "Mkhitaryan H.",
            "lineup_number": "7",
            "lineup_position": ""
          },
          {
            "lineup_player": "Nketiah E.",
            "lineup_number": "49",
            "lineup_position": ""
          },
          {
            "lineup_player": "Suarez D.",
            "lineup_number": "22",
            "lineup_position": ""
          }
        ],
        "coach": [
          {
            "lineup_player": "Emery U.",
            "lineup_number": "-1",
            "lineup_position": ""
          }
        ],
        "missing_players": [
          {
            "lineup_player": "Bellerin H.",
            "lineup_number": "-1",
            "lineup_position": ""
          },
          {
            "lineup_player": "Holding R.",
            "lineup_number": "-1",
            "lineup_position": ""
          },
          {
            "lineup_player": "Torreira L.",
            "lineup_number": "-1",
            "lineup_position": ""
          },
          {
            "lineup_player": "Welbeck D.",
            "lineup_number": "-1",
            "lineup_position": ""
          }
        ]
      },
      "away": {
        "starting_lineups": [
          {
            "lineup_player": "Almiron M.",
            "lineup_number": "24",
            "lineup_position": "10"
          },
          {
            "lineup_player": "Diame M.",
            "lineup_number": "10",
            "lineup_position": "9"
          },
          {
            "lineup_player": "Dubravka M. (G)",
            "lineup_number": "12",
            "lineup_position": "1"
          },
          {
            "lineup_player": "Dummett P.",
            "lineup_number": "3",
            "lineup_position": "5"
          },
          {
            "lineup_player": "Hayden I.",
            "lineup_number": "14",
            "lineup_position": "8"
          },
          {
            "lineup_player": "Lascelles J. (C)",
            "lineup_number": "6",
            "lineup_position": "4"
          },
          {
            "lineup_player": "Lejeune F.",
            "lineup_number": "20",
            "lineup_position": "3"
          },
          {
            "lineup_player": "Perez A.",
            "lineup_number": "17",
            "lineup_position": "7"
          },
          {
            "lineup_player": "Ritchie M.",
            "lineup_number": "11",
            "lineup_position": "6"
          },
          {
            "lineup_player": "Rondon S.",
            "lineup_number": "9",
            "lineup_position": "11"
          },
          {
            "lineup_player": "Yedlin D.",
            "lineup_number": "22",
            "lineup_position": "2"
          }
        ],
        "substitutes": [
          {
            "lineup_player": "Darlow K. (G)",
            "lineup_number": "26",
            "lineup_position": ""
          },
          {
            "lineup_player": "Fernandez F.",
            "lineup_number": "18",
            "lineup_position": ""
          },
          {
            "lineup_player": "Kenedy",
            "lineup_number": "15",
            "lineup_position": ""
          },
          {
            "lineup_player": "Ki Sung-Yong",
            "lineup_number": "4",
            "lineup_position": ""
          },
          {
            "lineup_player": "Manquillo J.",
            "lineup_number": "19",
            "lineup_position": ""
          },
          {
            "lineup_player": "Muto Y.",
            "lineup_number": "13",
            "lineup_position": ""
          },
          {
            "lineup_player": "Shelvey J.",
            "lineup_number": "8",
            "lineup_position": ""
          }
        ],
        "coach": [
          {
            "lineup_player": "Benitez R.",
            "lineup_number": "-1",
            "lineup_position": ""
          }
        ],
        "missing_players": [
          {
            "lineup_player": "Longstaff S.",
            "lineup_number": "-1",
            "lineup_position": ""
          },
          {
            "lineup_player": "Schar F.",
            "lineup_number": "-1",
            "lineup_position": ""
          }
        ]
      }
    },
    "statistics": [
      {
        "type": "Ball Possession",
        "home": "70%",
        "away": "30%"
      },
      {
        "type": "Goal Attempts",
        "home": "6",
        "away": "3"
      },
      {
        "type": "Shots on Goal",
        "home": "4",
        "away": "1"
      },
      {
        "type": "Shots off Goal",
        "home": "1",
        "away": "2"
      },
      {
        "type": "Blocked Shots",
        "home": "1",
        "away": "0"
      },
      {
        "type": "Free Kicks",
        "home": "10",
        "away": "12"
      },
      {
        "type": "Corner Kicks",
        "home": "5",
        "away": "2"
      },
      {
        "type": "Offsides",
        "home": "2",
        "away": "1"
      },
      {
        "type": "Goalkeeper Saves",
        "home": "1",
        "away": "2"
      },
      {
        "type": "Fouls",
        "home": "11",
        "away": "9"
      },
      {
        "type": "Yellow Cards",
        "home": "2",
        "away": "0"
      },
      {
        "type": "Total Passes",
        "home": "657",
        "away": "272"
      },
      {
        "type": "Tackles",
        "home": "11",
        "away": "18"
      }
    ]
  },
  .....
]
            

PHP call example


$APIkey='xxxxxxxxxxxxxx';
$from = '2019-04-01';
$to = '2019-04-03';
$league_id = 148;

$curl_options = array(
  CURLOPT_URL => "https://apiv2.apifootball.com/?action=get_events&from=$from&to=$to&league_id=$league_id&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);
?>

            

Lineups


Method

GET apiv2.apifootball.com/?action=get_lineups

Returns lineups of one event


Parameters

Parameter Description
action API method name
APIkey Authorization code generated from your apifootball account
match_id Match ID

Request URL


JSON Response

{
  "24562": {
    "lineup": {
      "home": {
        "starting_lineups": [
          {
            "lineup_player": "Asamoah K.",
            "lineup_number": "22",
            "lineup_position": "5"
          },
          {
            "lineup_player": "Barzagli A.",
            "lineup_number": "15",
            "lineup_position": "3"
          },
          {
            "lineup_player": "Bentancur R.",
            "lineup_number": "30",
            "lineup_position": "7"
          },
          {
            "lineup_player": "Buffon G. (G) (C)",
            "lineup_number": "1",
            "lineup_position": "1"
          },
          {
            "lineup_player": "Chiellini G.",
            "lineup_number": "3",
            "lineup_position": "4"
          },
          {
            "lineup_player": "Costa D.",
            "lineup_number": "11",
            "lineup_position": "9"
          },
          {
            "lineup_player": "Higuain G.",
            "lineup_number": "9",
            "lineup_position": "10"
          },
          {
            "lineup_player": "Khedira S.",
            "lineup_number": "6",
            "lineup_position": "6"
          },
          {
            "lineup_player": "Lichtsteiner S.",
            "lineup_number": "26",
            "lineup_position": "2"
          },
          {
            "lineup_player": "Mandzukic M.",
            "lineup_number": "17",
            "lineup_position": "11"
          },
          {
            "lineup_player": "Matuidi B.",
            "lineup_number": "14",
            "lineup_position": "8"
          }
        ],
        "substitutes": [
          {
            "lineup_player": "Alex Sandro",
            "lineup_number": "12",
            "lineup_position": ""
          },
          {
            "lineup_player": "Benatia M.",
            "lineup_number": "4",
            "lineup_position": ""
          },
          {
            "lineup_player": "Bernardeschi F.",
            "lineup_number": "33",
            "lineup_position": ""
          },
          {
            "lineup_player": "Cuadrado J.",
            "lineup_number": "7",
            "lineup_position": ""
          },
          {
            "lineup_player": "Dybala P.",
            "lineup_number": "10",
            "lineup_position": ""
          },
          {
            "lineup_player": "Pinsoglio C. (G)",
            "lineup_number": "16",
            "lineup_position": ""
          },
          {
            "lineup_player": "Rugani D.",
            "lineup_number": "24",
            "lineup_position": ""
          },
          {
            "lineup_player": "Sturaro S.",
            "lineup_number": "27",
            "lineup_position": ""
          },
          {
            "lineup_player": "Szczesny W. (G)",
            "lineup_number": "23",
            "lineup_position": ""
          }
        ],
        "coach": [
          {
            "lineup_player": "Allegri M.",
            "lineup_number": "-1",
            "lineup_position": ""
          }
        ],
        "missing_players": [
          {
            "lineup_player": "De Sciglio M.",
            "lineup_number": "-1",
            "lineup_position": ""
          },
          {
            "lineup_player": "Howedes B.",
            "lineup_number": "-1",
            "lineup_position": ""
          }
        ]
      },
      "away": {
        "starting_lineups": [
          {
            "lineup_player": "Alberto L.",
            "lineup_number": "18",
            "lineup_position": "10"
          },
          {
            "lineup_player": "de Vrij S.",
            "lineup_number": "3",
            "lineup_position": "3"
          },
          {
            "lineup_player": "Immobile C.",
            "lineup_number": "17",
            "lineup_position": "11"
          },
          {
            "lineup_player": "Lucas Leiva",
            "lineup_number": "6",
            "lineup_position": "7"
          },
          {
            "lineup_player": "Lulic S. (C)",
            "lineup_number": "19",
            "lineup_position": "9"
          },
          {
            "lineup_player": "Marusic A.",
            "lineup_number": "77",
            "lineup_position": "5"
          },
          {
            "lineup_player": "Milinkovic-Savic S.",
            "lineup_number": "21",
            "lineup_position": "8"
          },
          {
            "lineup_player": "Parolo M.",
            "lineup_number": "16",
            "lineup_position": "6"
          },
          {
            "lineup_player": "Bastos",
            "lineup_number": "15",
            "lineup_position": "2"
          },
          {
            "lineup_player": "Radu S.",
            "lineup_number": "26",
            "lineup_position": "4"
          },
          {
            "lineup_player": "Strakosha T. (G)",
            "lineup_number": "1",
            "lineup_position": "1"
          }
        ],
        "substitutes": [
          {
            "lineup_player": "Nani",
            "lineup_number": "7",
            "lineup_position": ""
          },
          {
            "lineup_player": "Caicedo F.",
            "lineup_number": "20",
            "lineup_position": ""
          },
          {
            "lineup_player": "Di Gennaro D.",
            "lineup_number": "88",
            "lineup_position": ""
          },
          {
            "lineup_player": "Mauricio",
            "lineup_number": "33",
            "lineup_position": ""
          },
          {
            "lineup_player": "Patric",
            "lineup_number": "4",
            "lineup_position": ""
          },
          {
            "lineup_player": "Guerrieri G. (G)",
            "lineup_number": "23",
            "lineup_position": ""
          },
          {
            "lineup_player": "Jordao B.",
            "lineup_number": "66",
            "lineup_position": ""
          },
          {
            "lineup_player": "Murgia A.",
            "lineup_number": "96",
            "lineup_position": ""
          },
          {
            "lineup_player": "Ramos Marchi L. F.",
            "lineup_number": "27",
            "lineup_position": ""
          },
          {
            "lineup_player": "Vargic I. (G)",
            "lineup_number": "25",
            "lineup_position": ""
          }
        ],
        "coach": [
          {
            "lineup_player": "Inzaghi S.",
            "lineup_number": "-1",
            "lineup_position": ""
          }
        ],
        "missing_players": [
          {
            "lineup_player": "Anderson F.",
            "lineup_number": "-1",
            "lineup_position": ""
          },
          {
            "lineup_player": "Basta D.",
            "lineup_number": "-1",
            "lineup_position": ""
          },
          {
            "lineup_player": "Lukaku J.",
            "lineup_number": "-1",
            "lineup_position": ""
          },
          {
            "lineup_player": "Marchetti F.",
            "lineup_number": "-1",
            "lineup_position": ""
          },
          {
            "lineup_player": "Wallace",
            "lineup_number": "-1",
            "lineup_position": ""
          }
        ]
      }
    }
  }
}
            

PHP call example


$APIkey='xxxxxxxxxxxxxx';
$match_id = 24562;

$curl_options = array(
  CURLOPT_URL => "https://apiv2.apifootball.com/?action=get_lineups&match_id=$match_id&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);
?>

            

Statistics


Method

GET apiv2.apifootball.com/?action=get_statistics

Returns statistics of one event


Parameters

Parameter Description
action API method name
APIkey Authorization code generated from your apifootball account
match_id Match ID

Request URL


JSON Response

{
  "24562": {
    "statistics": [
      {
        "type": "Ball Possession",
        "home": "60%",
        "away": "40%"
      },
      {
        "type": "Goal Attempts",
        "home": "18",
        "away": "10"
      },
      {
        "type": "Shots on Goal",
        "home": "6",
        "away": "5"
      },
      {
        "type": "Shots off Goal",
        "home": "5",
        "away": "1"
      },
      {
        "type": "Blocked Shots",
        "home": "7",
        "away": "4"
      },
      {
        "type": "Free Kicks",
        "home": "15",
        "away": "11"
      },
      {
        "type": "Corner Kicks",
        "home": "4",
        "away": "2"
      },
      {
        "type": "Offsides",
        "home": "2",
        "away": "1"
      },
      {
        "type": "Goalkeeper Saves",
        "home": "3",
        "away": "5"
      },
      {
        "type": "Fouls",
        "home": "10",
        "away": "14"
      },
      {
        "type": "Yellow Cards",
        "home": "2",
        "away": "1"
      }
    ]
  }
}
            

PHP call example


$APIkey='xxxxxxxxxxxxxx';
$match_id = 24562;

$curl_options = array(
  CURLOPT_URL => "https://apiv2.apifootball.com/?action=action=get_statistics&match_id=$match_id&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);
?>

            

Odds


Method

GET apiv2.apifootball.com/?action=get_odds

Returns odds (1x2, BTS, O/U, AH) for events included in your current subscription plan


Parameters

Parameter Description
action API method name
APIkey Authorization code generated from your apifootball account
from Start date (yyyy-mm-dd)
to Stop date (yyyy-mm-dd)
match_id Match ID - if set only odds from specific event will be returned (Optional)

Request URL


JSON Response

[
    {
        "match_id":"194200"
		,"odd_bookmakers": "William Hill"
		,"odd_date": "2019-04-04 09:18:10"
        ,"odd_1":"1.77"
        ,"odd_x":"3.74"
        ,"odd_2":"5.30"
        ,"ah-2.5_1":"6.25"
        ,"ah-2.5_2":"1.12"
        ,"ah-2_1":"5.50"
        ,"ah-2_2":"1.15"
        ,"ah-1.5_1":"3.00"
        ,"ah-1.5_2":"1.38"
        ,"ah-1_1":"2.44"
        ,"ah-1_2":"1.65"
        ,"ah0_1":"1.28"
        ,"ah0_2":"3.54"
        ,"o+0.5":"1.07"
        ,"u+0.5":"9.00"
        ,"o+1.5":"1.35"
        ,"u+1.5":"3.10"
        ,"o+2":"1.58"
        ,"u+2":"2.35"
        ,"o+2.5":"2.10"
        ,"u+2.5":"1.84"
        ,"o+3":"3.10"
        ,"u+3":"1.35"
        ,"o+3.5":"3.80"
        ,"u+3.5":"1.25"
        ,"o+4.5":"8.00"
        ,"u+4.5":"1.08"
        ,"o+5.5":"19.00"
        ,"u+5.5":"1.02"
        ,"bts_yes":"2.00"
        ,"bts_no":"1.80"
    }
]
            

PHP call example


$APIkey='xxxxxxxxxxxxxx';
$from = '2019-04-02';
$to = '2019-04-04';

$curl_options = array(
  CURLOPT_URL => "https://apiv2.apifootball.com/?action=get_odds&from=$from&to=$to&APIkey=$APIkey",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HEADER => false,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_CONNECTTIMEOUT => 5
);

$curl = curl_init();
curl_setopt_array( $curl, $curl_options );
$result = curl_exec( $curl );

$result = (array) json_decode($result);

var_dump($result);
?>

            

H2H


Method

GET apiv2.apifootball.com/?action=get_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 apifootball account
timezone Default timezone: Europe/Berlin. With this filter you can set the timezone where you want to receive the data. Timezone is in TZ format (exemple: America/New_York). (Optional)
firstTeam First team name
secondTeam Second team name

Request URL


JSON Response

[
	{
	  "firstTeam_VS_secondTeam": [
		{
		  "match_id": "218349",
		  "country_id": "165",
		  "country_name": "Europe",
		  "league_id": "590",
		  "league_name": "Europa League",
		  "match_date": "2019-05-29",
		  "match_status": "Finished",
		  "match_time": "21:00",
		  "match_hometeam_id": "2616",
		  "match_hometeam_name": "Chelsea",
		  "match_hometeam_score": "4 ",
		  "match_awayteam_id": "2617",
		  "match_awayteam_name": "Arsenal",
		  "match_awayteam_score": " 1",
		  "match_hometeam_halftime_score": "0",
		  "match_awayteam_halftime_score": "0",
		  "match_live": "0"
		},
		{
		  "match_id": "167631",
		  "country_id": "41",
		  "country_name": "ENGLAND",
		  "league_id": "148",
		  "league_name": "Premier League",
		  "match_date": "2019-01-19",
		  "match_status": "Finished",
		  "match_time": "18:30",
		  "match_hometeam_id": "2617",
		  "match_hometeam_name": "Arsenal",
		  "match_hometeam_score": "2",
		  "match_awayteam_id": "2616",
		  "match_awayteam_name": "Chelsea",
		  "match_awayteam_score": "0",
		  "match_hometeam_halftime_score": "2",
		  "match_awayteam_halftime_score": "0",
		  "match_live": "0"
		},
	.....
	  ],
	  "firstTeam_lastResults": [
		{
		  "match_id": "218349",
		  "country_id": "165",
		  "country_name": "Europe",
		  "league_id": "590",
		  "league_name": "Europa League",
		  "match_date": "2019-05-29",
		  "match_status": "Finished",
		  "match_time": "21:00",
		  "match_hometeam_id": "2616",
		  "match_hometeam_name": "Chelsea",
		  "match_hometeam_score": "4 ",
		  "match_awayteam_id": "2617",
		  "match_awayteam_name": "Arsenal",
		  "match_awayteam_score": " 1",
		  "match_hometeam_halftime_score": "0",
		  "match_awayteam_halftime_score": "0",
		  "match_live": "0"
		},
		{
		  "match_id": "212425",
		  "country_id": "41",
		  "country_name": "England",
		  "league_id": "148",
		  "league_name": "Premier League",
		  "match_date": "2019-05-12",
		  "match_status": "Finished",
		  "match_time": "16:00",
		  "match_hometeam_id": "2611",
		  "match_hometeam_name": "Leicester",
		  "match_hometeam_score": "0 ",
		  "match_awayteam_id": "2616",
		  "match_awayteam_name": "Chelsea",
		  "match_awayteam_score": " 0",
		  "match_hometeam_halftime_score": "0",
		  "match_awayteam_halftime_score": "0",
		  "match_live": "0"
		},
	.....
	  ],
	  "secondTeam_lastResults": [
		{
		  "match_id": "218349",
		  "country_id": "165",
		  "country_name": "Europe",
		  "league_id": "590",
		  "league_name": "Europa League",
		  "match_date": "2019-05-29",
		  "match_status": "Finished",
		  "match_time": "21:00",
		  "match_hometeam_id": "2616",
		  "match_hometeam_name": "Chelsea",
		  "match_hometeam_score": "4 ",
		  "match_awayteam_id": "2617",
		  "match_awayteam_name": "Arsenal",
		  "match_awayteam_score": " 1",
		  "match_hometeam_halftime_score": "0",
		  "match_awayteam_halftime_score": "0",
		  "match_live": "0"
		},
		{
		  "match_id": "212422",
		  "country_id": "41",
		  "country_name": "England",
		  "league_id": "148",
		  "league_name": "Premier League",
		  "match_date": "2019-05-12",
		  "match_status": "Finished",
		  "match_time": "16:00",
		  "match_hometeam_id": "2629",
		  "match_hometeam_name": "Burnley",
		  "match_hometeam_score": "1 ",
		  "match_awayteam_id": "2617",
		  "match_awayteam_name": "Arsenal",
		  "match_awayteam_score": " 3",
		  "match_hometeam_halftime_score": "0",
		  "match_awayteam_halftime_score": "0",
		  "match_live": "0"
		},
	.....
]
            

PHP call example


$APIkey='xxxxxxxxxxxxxx';

$curl_options = array(
  CURLOPT_URL => "https://apiv2.apifootball.com/?action=get_H2H&firstTeam=$firstTeam&secondTeam=$secondTeam&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);
?>

            

Predictions


Method

GET apiv2.apifootball.com/?action=get_predictions

Returns mathematical calculated predictions for the events included in your current subscription plan


Parameters

Parameter Description
action API method name
APIkey Authorization code generated from your apifootball account
from Start date (yyyy-mm-dd)
to Stop date (yyyy-mm-dd)
country_id Country ID - if set only leagues from specific country will be returned (Optional)
league_id League ID - if set events from specific league will be returned (Optional)
match_id Match ID - if set only details from specific match will be returned (Optional)

Request URL


JSON Response

[
  {
    "match_id": "220064",
    "country_id": "154",
    "country_name": "USA",
    "league_id": "537",
    "league_name": "MLS",
    "match_date": "2019-06-06",
    "match_status": "Finished",
    "match_time": "01:30",
    "match_hometeam_id": "1764",
    "match_hometeam_name": "Montreal Impact",
    "match_hometeam_score": "2 ",
    "match_awayteam_name": "Seattle Sounders",
    "match_awayteam_id": "7875",
    "match_awayteam_score": " 1",
    "match_hometeam_halftime_score": "0",
    "match_awayteam_halftime_score": "0",
    "match_hometeam_extra_score": "0",
    "match_awayteam_extra_score": "0",
    "match_hometeam_penalty_score": "",
    "match_awayteam_penalty_score": "",
    "match_hometeam_system": "3 - 4 - 3",
    "match_awayteam_system": "4 - 2 - 3 - 1",
    "match_live": "0",
    "prob_HW": "41.00",
    "prob_D": "18.00",
    "prob_AW": "40.00",
    "prob_HW_D": "60.00",
    "prob_AW_D": "59.00",
    "prob_HW_AW": "82.00",
    "prob_O": "88.00",
    "prob_U": "12.00",
    "prob_O_1": "96.00",
    "prob_U_1": "4.00",
    "prob_O_3": "74.00",
    "prob_U_3": "26.00",
    "prob_bts": "84.00",
    "prob_ots": "16.00",
    "prob_ah_h_45": "98.00",
    "prob_ah_a_45": "2.00",
    "prob_ah_h_35": "94.00",
    "prob_ah_a_35": "6.00",
    "prob_ah_h_25": "88.00",
    "prob_ah_a_25": "12.00",
    "prob_ah_h_15": "76.00",
    "prob_ah_a_15": "24.00",
    "prob_ah_h_05": "60.00",
    "prob_ah_a_05": "40.00",
    "prob_ah_h_-05": "41.00",
    "prob_ah_a_-05": "59.00",
    "prob_ah_h_-15": "25.00",
    "prob_ah_a_-15": "75.00",
    "prob_ah_h_-25": "13.00",
    "prob_ah_a_-25": "87.00",
    "prob_ah_h_-35": "6.00",
    "prob_ah_a_-35": "94.00",
    "prob_ah_h_-45": "2.00",
    "prob_ah_a_-45": "98.00"
  },
  ........
 ]
            

PHP call example


$APIkey='xxxxxxxxxxxxxx';
$from = '2019-06-01';
$to = '2019-06-08';

$curl_options = array(
  CURLOPT_URL => "https://apiv2.apifootball.com/?action=get_predictions&from=$from&to=$to&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);
?>

            

TopScorers


Method

GET apiv2.apifootball.com/?action=get_topscorers

Returns topsorers for leagues


Parameters

Parameter Description
action API method name
APIkey Authorization code generated from your apifootball account
league_id League ID - topscorers from specific league will be returned

Request URL


JSON Response

              [{
                  "player_place": "1",
                  "player_name": "Salah M.",
                  "player_key": 2551806565,
                  "team_name": "Liverpool",
                  "team_key": "2621",
                  "goals": "13"
              }, {
                  "player_place": "2",
                  "player_name": "Son Heung-Min",
                  "player_key": 2551806565,
                  "team_name": "Tottenham",
                  "team_key": "2628",
                  "goals": "12"
              },
              .....
              ]
            

PHP call example


$APIkey='xxxxxxxxxxxxxx';
$league_id = 148;

$curl_options = array(
  CURLOPT_URL => "https://apiv2.apifootball.com/?action=get_topscorers&league_id=$league_id&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);
?>

            

Livescore


Widgets


Wordpress Plugin