list

List of all countries ⬜ 🟨 🟦 🟩

GET https://api.soccerfootball.info/v1/countries/list/

This endpoint returns with all countries and the relented entries. You can use this call to get country code and use it in another endpoints. The possible format of this call is json or csv (MS office compatible) Format CSV is in MS excel compatible mode (double click open without import!)

Query Parameters

Name
Type
Description

t

string

Your API Token DIRECT API ONLY

f

string

Format response can be "json" or "csv" (default "json")

Headers

Name
Type
Description

X-RapidAPI-Key

string

Your API token RAPIDAPI ONLY

X-RapidAPI-Host

string

soccerfootballinfo.rapidapi.com RAPIDAPI ONLY

{
   "status":200,
   "errors":[],
   "pagination":[],
   "result":[
      {
         "code":"AF",  // unique country code
         "name":"Afghanistan",
         "timezones":[
            "UTC+04:30"
         ],
         "championships":0, 
         "managers":2,
         "players":13,
         "referees":0,
         "stadiums": 0,
         "teams":4
      },
		...
   ]
}

Example of code for direct API

$url = 'https://api.soccerfootball.info/v1/countries/list/?t=TOKEN';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
	echo "cURL Error:" . $err;
}

Example of code for RapidAPI

$url = 'https://soccer-football-info.p.rapidapi.com/countries/list/';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_PROXY => null,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
		"X-RapidAPI-Host: soccer-football-info.p.rapidapi.com",
		"X-RapidAPI-Key: TOKEN"
	],
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if (!$err) {
  $result = json_decode($response);
  print_r($result);
} else {
	echo "cURL Error:" . $err;
}

More example of code on rapidAPI

Last updated