Getting list of countries

In this reference we will show you how you can the list of all countries that our livescore api data support feed supports and how to interpret it.


Endpoint

In order to get the list of all countries that our livescore data feed supports the only thing you need to do is the 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:

Response

The response contains the following information, for every country element in the list. The same rules apply for the JSON objects and the CSV columns.

  • id - the id of the country which you can use in sub sequential requests.
  • name - the name of the country.
  • is_real - this is flag that shows whether the country is real. What does this mean is that sometimes the livescores that we provide in order feed could be related to a real country like England. Then the is_real flag will have the value of "1". Other times we will provide football live scores for FIFA World Cup. In this case the country like South America or FIFA will have is_real value of "0" because it is not a real country.
  • leagues - this is an API link to the list of all leagues that we have in this country. For example, if you follow this link for England you will see a list of the leagues for which we provide livescores like: Premiership, Championship, FA Cup and more. You can find out more about the leagues endpoint in the leagues endpoint reference
  • scores - this is an API link to the list of all livescores that we have for this country right now.
{
    "success": true,
    "data": {
        "country": [
            {
                "id": "82",
                "name": "Africa",
                "is_real": "0",
                "leagues": "http:\/\/livescore-api.com/api-client\/leagues\/list.json?key=demo_key&secret=demo_secret&country=82",
                "scores": "http:\/\/livescore-api.com/api-client\/scores\/live.json?key=demo_key&secret=demo_secret&country=82"
            },
            {
                "id": "67",
                "name": "Algeria",
                "is_real": "1",
                "leagues": "http:\/\/livescore-api.com/api-client\/leagues\/list.json?key=demo_key&secret=demo_secret&country=67",
                "scores": "http:\/\/livescore-api.com/api-client\/scores\/live.json?key=demo_key&secret=demo_secret&country=67"
            },
            {
                "id": "65",
                "name": "Argentina",
                "is_real": "1",
                "leagues": "http:\/\/livescore-api.com/api-client\/leagues\/list.json?key=demo_key&secret=demo_secret&country=65",
                "scores": "http:\/\/livescore-api.com/api-client\/scores\/live.json?key=demo_key&secret=demo_secret&country=65"
            }
        ]
    }
}

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 http://livescore-api.com/api-client/countries/list.json?key=demo_key\&secret=demo_secret
PHP <?php
file_get_contents('http://livescore-api.com/api-client/countries/list.json?key=demo_key&secret=demo_secret')
?>

Python import urllib2
req = urllib2.Request('http://livescore-api.com/api-client/countries/list.json?key=demo_key&secret=demo_secret')
response = urllib2.urlopen(req)
print response.read()

Copied
Feedback