In this reference page we will show you how you can the list of all leagues, or leagues only for a certain country, that our live-score api supports and how to interpret it.
In order, to get the list of all leagues that our live-score data feed supports the only thing you need to do is the call the url bellow. It is possible for you to get the list of all leagues or only the leagues for a specific country. In the first part of the reference we write about the full list and in the second part we talk about the "by country" list. 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
The response of our league
element in the list. The same rules apply for the JSON objects and the CSV columns.
Name Type Example Description id integer 1 the id of the country which you can use in sub sequential requests. name string Premier League the name of the country. country_id integer 5 this is the id of the country to which the league belongs. To find out more about the countries soccer API endpoint you can read the countries reference page. scores url this is a soccer API link to the list of all live-scores that we have for this league right now. {
"success": true,
"data": {
"league": [
{
"id": "36",
"name": "1st Division",
"country_id": "23",
"scores": "http:\/\/livescore-api.com/api-client\/scores\/live.json?key=demo_key&secret=demo_secret&league=36"
},
{
"id": "298",
"name": "1st Division",
"country_id": "75",
"scores": "http:\/\/livescore-api.com/api-client\/scores\/live.json?key=demo_key&secret=demo_secret&league=298"
},
{
"id": "53",
"name": "1st Division",
"country_id": "12",
"scores": "http:\/\/livescore-api.com/api-client\/scores\/live.json?key=demo_key&secret=demo_secret&league=53"
}
]
}
}
cUrl
curl -XGET http://livescore-api.com/api-client/leagues/list.json?key=demo_key\\&secret=demo_secret
PHPfile_get_contents('http://livescore-api.com/api-client/leagues/list.json?key=demo_key\&secret=demo_secret');
Pythonimport urllib2
req = urllib2.Request('http://livescore-api.com/api-client/leagues/list.json?key=demo_key\&secret=demo_secret')
response = urllib2.urlopen(req)
print response.read()
GET
parameter in the URL. If you want to know more about how to get the id of the country you can read our page about the countries API endpoint. After you add the country in the URL you will receive the list with the leagues in that country that our live-score api data feed supports. Let's take an example with England. After going through the countries list, we have found out that England has an ID of 19. In order, to get the leagues for England, we provide the id as a country parameter as in the example below. 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
http://livescore-api.com/api-client/leagues/list.json?key=demo_key&secret=demo_secret&country=19
cUrl
curl -XGET http://livescore-api.com/api-client/leagues/list.json?key=demo_key\\&secret=demo_secret\\&country=19
PHPfile_get_contents('http://livescore-api.com/api-client/leagues/list.json?key=demo_key\&secret=demo_secret\&country=19');
Pythonimport urllib2
req = urllib2.Request('http://livescore-api.com/api-client/leagues/list.json?key=demo_key\&secret=demo_secret\&country=19')
response = urllib2.urlopen(req)
print response.read()