Getting Country Flags

Using this soccer API endpoint you are able to get the country flags of the national football teams.

At this moment our soccer api contains country flags only for the teams participating in the UEFA EURO 2020 and Copa America 2020

Getting a country flag also counts as a request to our soccer api we suggest caching the images once your website/app is live in production. This will also improve your users' experience.

Supplementing the countries national football team names with the countries flags is a great way to improve the design of your website or mobile app, both from design and user experience perspectives. That is why we have introduced the country flag soccer api endpoint to our product. In the paragraphs below we explain how you can make the best out of it.


Endpoint


When using our soccer api endpoint for getting national teams flags all you need to know is the team_id or the country_id of the national football team. You can get a full list of all teams and their ids using our team listing api endpoint. Also, you can get the full list with all countries following the guidelines in our countries documentation page. The response of this soccer api endpoint contains the id field in which the team id is stored. You can use this value to retrieve the country flag, as it is shown in the example bellow for the flag of Australia.


GET:

NameTypeRequiredExampleDescription
country_idnumber71The id of the country which flag we want to get
team_idnumber1440The id of the team that is the national team for a country

Response


The response is a png image containing the flag of the country. The default image size is 300x200 pixels.