Getting livescores

In this reference page, we explain how you can obtain the score of the matches that are being currently played.


Endpoint

There are 3 options when retrieving the current livescores. You can get the list of all matches using the explanation in the first section of this page. To get the scores for a certain league or certain country only, you will need to provide the ids of these country or league. This functionality is explained in the second and third part of this reference.

In order to get the livescores of currently football being player, the only thing you need to do is the call the url bellow. Once the game is over it will stay in the livescore feed until 3 hours after the game has begun. For example if the game ended in 90 minutes it will be available in the feed as FINISHED for another hour and a 15 minutes. If there is extra time the game will be available for 45 minutes more after the extra time has been played. 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:

Reponse

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

  • id - the id of the match.
  • home_name - the name of the home team.
  • away_name - the name of the away team.
  • score - contains the latest score of the game. Depending on how the game progress this will be the field that will give you the most up to date score. If the game goes in extra time and there are goals scored this field will reflect that. If you need only the 90 minutes scores you can use the ft_score field.
  • ht_score - contains the half time score of the game if the half time has been reached.
  • ft_score - contains the full time score of the game if the full time has been reached.
  • et_score - contains the extra time score of the game if the extra time has been reached.
  • time - the number minutes that have passed since the beginning of the game.
  • league_id - the id of the league to which the game belongs.
  • league_name - the name of the league to which the game belongs to.
  • added - contains a date time of when the match was added to our livescore api feed.
  • last_changed - contains a date time of when the match data was checked or updated.
  • status - the status of the game. The possible statuses that you can see are:
    • NOT STARTED - The has not started yet, but it is about to start.
    • IN PLAY - The match is in play.
    • HALF TIME BREAK - The half time break is currently ongoing.
    • ADDED TIME - The soccer game is in added time of the first half or second half. This status is not to be confused with extra time when a winner could not be decided in regular time.
    • FINISHED - The game has finished its regular 2 halves of 30 minutes.
    • INSUFFICIENT DATA - Due to problems we cannot provide you with accurate data, but the game is underway.
  • home_id - as we are building our team database with teams and their ids for some matches there will be a team id provided for the home team
  • away_id - as we are building our team database with teams and their ids for some matches there will be a team id provided for the away team
  • events - this functionality is currently in beta testing. If we do not have the possibility to provide the events right now the value of this field will be false (This could be caused by the fact that we will not provide events at all, or currently there are no events that have happened). In the cases where we do have the events the value of the field will be a link to the API endpoint that will give you the list of the events that have happened in the event. To read more about the live match events you can follow this link.
{
    "success": true,
    "data": {
        "match": [
            {
                "id": "14",
                "home_name": "CSD Comunicaciones",
                "away_name": "Coban Imperial",
                "score": "0 - 0",
                "ht_score": "0 - 0",
                "ft_score": "",
                "et_score": "",
                "time": "36",
                "league_id": "90",
                "status": "IN PLAY",
                "added": "2017-11-16 00:40:21",
                "last_changed": "2017-11-16 00:40:21",
                "home_id": "0",
                "away_id": "188",
                "events": false,
                "league_name": "Liga Nacional:: apertura"
            },
            {
                "id": "9",
                "home_name": "Vasco da Gama",
                "away_name": "Atletico MG",
                "score": "? - ?",
                "ht_score": "",
                "ft_score": "",
                "et_score": "",
                "time": "23:45",
                "league_id": "21",
                "status": "NOT STARTED",
                "added": "2017-11-16 00:40:21",
                "last_changed": "2017-11-16 00:40:21",
                "home_id": "265",
                "away_id": "269",
                "events": "http:\/\/livescore-api.com\/api-client\/scores\/events.json?key=demo_key&secret=demo_secret&id=9",
                "league_name": "Serie A"
            }
        ]
    }
}

Examples

cUrl curl -XGET http://livescore-api.com/api-client/scores/live.json?key=demo_key\&secret=demo_secret
PHP <?php
file_get_contents('http://livescore-api.com/api-client/scores/live.json?key=demo_key&secret=demo_secret')
?>

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

Getting livescores by league

To get the livecsores only for a certain league, you have to provide the id of the league as a get parameter in the api endpoint URL. In the example bellow we show you how to get all the livescores for Italy's Seria A. http://livescore-api.com/api-client/scores/live.json?key=demo_key&secret=demo_secret&league=73

Getting livescores by country

To get the livecsores only for a certain league, you have to provide the id of the league as a get parameter in the api endpoint URL. In the example bellow we show you how to get all the livescores for all of Italy's this includes Seria A, Seria B, Pro Lega, Cup and more. http://livescore-api.com/api-client/scores/live.json?key=demo_key&secret=demo_secret&country=47

Copied
Feedback