Competitions list

Competitions are the current way of working with leagues and cups. Our old leagues are now deprecated. In this guide, we show how to get the full list of competitions that our football API provides.

THE NEW KID IN TOWN


Before we start explaining how to work with competitions, we need to clarify some terms used in our football API:


Competitions: is our new way of referring to any kind of football tournament that exists and that we support they include: national leagues (e.g. Premier League, LigaMX), international leagues (e.g. UEFA Champions League, UEFA Nations League), as well as national cups (e.g. Copa Del Rey, Coppa Italia, Copa Do Brasil) and international cups (e.g. UEFA Super Cup, FIFA World Cup). This includes both national teams (e.g. Brazil, France) and club teams (e.g. Real Madrid, Juventus, Manchester United).


Leagues: is our old term to refer to the football tournaments that our API supports. They are now deprecated and there will be less and less support for them in terms of data and functionality. All new data and features coming up will be supported primarily with competitions!


ENDPOINT


In order, to get the list of all competitions that our football API provides and supports you need to call the URL bellow. In this example, we have used the demo api key and secret pair. If you login in, you will see all examples with your own api key and api secret


GET:

PARAMETERS


This football API endpoint supports several parameters that help you filter the football competitions based on countries or federations. By countries, we mean a sovereign country that can be found on the map (e.g. Russia, Italy, South Africa), and by federation we mean international football association (like: FIFA, CONMEBOL, CAF, AFC). You can read more on getting to know the countries in the getting countries list documentation page. To find out how federations work in the context of our football API refer to the federations specific page.


NameTypeRequiredExampleDescription
country_idNumber1Will show the competitions from that specific country only
federation_idNumber1Will show the competitions from that specific federation only

NOTE: If you provide both a country_id and a federation_id the country will take precedence and you will see only football competitions from that country!


RESPONSE


If you call the URL in the box above, our football API will return a response similar to what is show in this section. First, in the table we explain what fields are there, and the follows a JSON example. Review our data formats page for more information on data formats that our football API supports.


NameTypeExampleDescription
countrieslistList with all the countries to which the competition belongs to.
federationslistList with all the federations to which the competition belongs to.
idNumber5The id of the competition which you can use as filters in other sequential requests.
nameStringSerie AThe name of the competition.
seasonobjectThe season of the current competition edition. The dates of the season are the start and end date of the season in relation to the world calendar and not the competition one.

{
    "success": true,
    "data": {
        "competition": [
            {
                "id": "244",
                "name": "Champions League",
                "is_league": "0",
                "is_cup": "1",
                "tier": "0",
                "has_groups": "1",
                "active": "1",
                "national_teams_only": "0",
                "countries": [],
                "federations": [
                    {
                        "id": "2",
                        "name": "UEFA"
                    }
                ],
                "season": {
                    "id": "13",
                    "name": "2021\/2022",
                    "start": "2021-07-01",
                    "end": "2022-06-30"
                }
            },
            {
                "id": "317",
                "name": "Championship",
                "is_league": "1",
                "is_cup": "0",
                "tier": "2",
                "has_groups": "1",
                "active": "1",
                "national_teams_only": "0",
                "countries": [
                    {
                        "id": "3",
                        "name": "Scotland",
                        "flag": "SCO.png",
                        "fifa_code": "SCO",
                        "uefa_code": "SCO",
                        "is_real": "1"
                    }
                ],
                "federations": [],
                "season": {
                    "id": "13",
                    "name": "2021\/2022",
                    "start": "2021-07-01",
                    "end": "2022-06-30"
                }
            }
        ]
    }
}


EXAMPLES


The following examples show you how to use this endpoint in various programming languages. In this example, we have used the demo api key and secret pair. If you login in, you will see all examples with your own api key and api secret cUrl:

curl -XGET "https://livescore-api.com/api-client/competitions/list.json?key=demo_key&secret=demo_secret"
PHP:
file_get_contents('https://livescore-api.com/api-client/competitions/list.json?key=demo_key\&secret=demo_secret');
Python:
import urllib2
req = urllib2.Request('https://livescore-api.com/api-client/competitions/list.json?key=demo_key\&secret=demo_secret')
response = urllib2.urlopen(req)
print response.read()


GETTING COMPETITIONS BY COUNTRY


To get the list of competitions for a certain country, you have to provide the id of the country as a get query parameter in the api endpoint URL. The parameter is country_id. In the example bellow we show you how to get all the competitions for Germany. To find our more about the countries and their ids visit the countries list documentation page. cUrl:

curl -XGET "https://livescore-api.com/api-client/competitions/list.json?key=demo_key&secret=demo_secret&country_id=1"
PHP:
file_get_contents('https://livescore-api.com/api-client/competitions/list.json?key=demo_key\&secret=demo_secret\&country_id=1');
Python:
import urllib2
req = urllib2.Request('https://livescore-api.com/api-client/competitions/list.json?key=demo_key\&secret=demo_secret\&country_id=1')
response = urllib2.urlopen(req)
print response.read()


GETTING COMPETITIONS BY FEDERATION


To get the list of competitions for a certain football federation, you have to provide the id of the federation as an http GET query parameter in the same api endpoint URL. The parameter is called federation_id. In the example bellow we show you how to get all the competitions for UEFA. You can find our more about the federations and their ids in the federations list documentation page. cUrl:

curl -XGET "https://livescore-api.com/api-client/competitions/list.json?key=demo_key&secret=demo_secret&federation_id=2"
PHP:
file_get_contents('https://livescore-api.com/api-client/competitions/list.json?key=demo_key\&secret=demo_secret\&federation_id=2');
Python:
import urllib2
req = urllib2.Request('https://livescore-api.com/api-client/competitions/list.json?key=demo_key\&secret=demo_secret\&federation_id=2')
response = urllib2.urlopen(req)
print response.read()


Didn't find what you need?

Do no hesitate to contact us. We will get back to you as soon as possible.