This page in the football API docs covers how to fetch the complete list of teams available. Filtering by country and federation id is supported too.
Here at football api, a large teams database is already in place, and new teams get added on a regular basis while existing entries get updated with modified and new information. That keeps the teams football data current. Through this football API endpoint developers can pull the team list along with extra details about each entry. Every team in the football data carries an id that is reused across other endpoints such as those for live scores, fixtures, history, head2head, standings, and many more.
ENDPOINT
To pull the full team list from the football API, or to filter teams based on specific needs, use the api endpoint below.
Check this Football API endpoint in our postman collection. Download it now!
PARAMETERS
This api endpoint accepts several parameters that help filter football teams by countries or federations. Countries include Russia, Italy, South Africa, and England. By federation, international football associations such as FIFA, CONMEBOL, CAF, and AFC are meant. More on getting to know the countries lives in the getting countries list documentation page. To understand how federations work inside the football API schema, refer to the federations specific page.
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| country_id | number|string | 1 | To filter the team list by a country. | |
| federation_id | number|string | 13 | To filter the team list by a federation. | |
| lang | string | ar | To specify which language is of interest. | |
| page | number | 5 | The consecutive number of the results page to retrieve. The default page number is 1. | |
| size | number | 100 | To control how many teams get returned, anywhere between 1 and 100. The default response size is 30. |
When the language parameter is used, team, country, and federation names get translated into the chosen language, based on the subscription package. This happens when the package supports that kind of translation and the names of the entities exist in the language passed through the lang parameter.
RESPONSE
The response from the teams football API endpoint carries the team data along with general information for the country or the :federation of that team. For more details, consult the standard response objects documentation page.
| Name | Type | Example | Description |
|---|---|---|---|
| country | object | {} | An object holding the information about the country the team belongs to, following the structure of the standard country object. |
| federation | object | {} | An object holding the information about the federation the team belongs to, following the structure of the standard federation object. |
| team | object | {} | An object holding the information about the team, following the structure of the standard team object. |
{
"success": true,
"data": {
"teams": [
{
"team": {
"id": 6336,
"name": "1. FC Rielasingen-Arlen",
"stadium": "Kunstrasenplatz Talwiese Rielasingen K",
"country_id": 1,
"logo": "https:\/\/cdn.football-api.com\/teams\/6336.png"
},
"country": {
"id": 1,
"name": "Germany",
"flag": "GER.png",
"fifa_code": "GER",
"uefa_code": "GER",
"is_real": true
},
"federation": null
},
{
"team": {
"id": 2331,
"name": "1. FC Saarbrucken",
"stadium": "Hermann-Neuberger-Stadion",
"country_id": 1,
"logo": "https:\/\/cdn.football-api.com\/teams\/2331.png"
},
"country": {
"id": 1,
"name": "Germany",
"flag": "GER.png",
"fifa_code": "GER",
"uefa_code": "GER",
"is_real": true
},
"federation": null
}
],
"total": 8627,
"next_page": "https:\/\/api.football-api.com\/teams\/listing.json?size=2&page=3",
"prev_page": "https:\/\/api.football-api.com\/teams\/listing.json?size=2&page=1"
}
}Getting teams by country
Say the goal is to get every team from Germany (country_id 1). The following football API link gets the job done. To pull teams for another country, only the country_id needs to change.
cUrl
curl -XGET https://api.football-api.com/teams/listing.json?key=demo_key\&secret=demo_secret\&country_id=1PHPfile_get_contents('https://api.football-api.com/teams/listing.json?key=demo_key&secret=demo_secret&country_id=1');Pythonimport urllib2
req = urllib2.Request('https://api.football-api.com/teams/listing.json?key=demo_key&secret=demo_secret&country_id=1')
response = urllib2.urlopen(req)
print response.read()
Getting teams by federation
Along the same lines, if every team from UEFA (federation_id 2) is needed, the following api link handles it. To pull teams for another federation, only the federation_id needs to change. For the full list of federations and their ids, visit the federations documentation page.
cUrl
curl -XGET https://api.football-api.com/teams/listing.json?key=demo_key\&secret=demo_secret\&federation_id=2PHPfile_get_contents('https://api.football-api.com/teams/listing.json?key=demo_key&secret=demo_secret&federation_id=2');Pythonimport urllib2
req = urllib2.Request('https://api.football-api.com/teams/listing.json?key=demo_key&secret=demo_secret&federation_id=2')
response = urllib2.urlopen(req)
print response.read()