Live scores
On this reference page, we explain how you can obtain the score of the matches that are currently played around the world.
ENDPOINT
NOTE: In our football API endpoints there are 2 ids for each football match. First, it is the fixture id, it is solely for the purpose of keeping track of scheduled matches. The fixture id is different than the match id, which is the second ID that we use. Every match gets an ID when it is about to start. Once the match is over and it goes into the history database this match id persists and remains the same. The fixture id and match id for the same match are totally different. That's why we have the fixture_id
field both in the live-score api endpoint and in the history api endpoint.
You have several options for filtering the live scores when using this football API endpoint. 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 competition or certain country only, you will need to provide the ids of the country or competition. This functionality is explained in the second and third parts of this reference.
In order to get the live-scores of currently played football matches, the only thing you need to do is the call the url bellow. Once a game has finished, it will stay in the live-score feed for up to 3 hours more. For example, if the game has ended after the regular time of 90 minutes it will be available in the feed with a status of FINISHED for another hour and 15 minutes. If there is extra time, the game will be available for 45 minutes more after the extra time has ended.
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
PARAMETERS
The live-scores api endpoint supports several parameters that help you filter matches based on country, competition, competitions, or team. There is also a parameter that allow you to translate some of the data in different languages.
Name | Type | Required | Example | Description |
---|---|---|---|---|
competition_id | string | 16 | Filters the scores user their competition_id. Or multiple competitions separated with commas. | |
country | number | 2 | Filters the matches by country in which they are played, or the general competition in case of Champions league. | |
fixture_id | number | 1580503 | The id of the fixture from our fixtures calendar API endpoint, if you want to get the live match for that specific fixture, | |
lang | string | ar | 2 letter ISO 639-1 language code. | |
team_id | number | 19 | The id of a team, if we want only that teams live scores. |
REPONSE
The response contains the following information for every match element in the list. The response data and its types is the same both for the JSON and XML data responses.
Name | Type | Example | Description |
---|---|---|---|
added | datetime | 2018-03-23 14:27:02 | The date and time of when the match was added to our live-score api feed. |
away_id | integer | 12 | 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 |
away_name | string | Man City | The name of the away team. |
competition_id | number | 16 | The id of the competition in which the match takes places |
competition_name | string | Seria A | The name of the football competition in which the match takes places |
country.flag | string | CHN.png | The flag of the federation that organises the competition in which the match takes play in |
country.id | number | 26 | The id of the country that organises the competition in which the match takes play in |
country.name | string | China | The name of the federation that organises the competition in which the match takes play in |
et_score | string | 2 - 0 | The extra time score of the game, if the extra time has been reached. |
events | string,boolean | http://.... | 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 read our football api events documentation |
federation.id | number | 1 | The id of the federation that organises the competition in which the match takes play in |
federation.name | string | FIFA | The name of the federation that organises the competition in which the match takes play in |
fixture_id | number | 123456 | The id of the fixture for which the match is, it could be empty 0 or null, in this case there was no fixture added before the match started |
ft_score | string | 2 - 0 | The full time score of the game, if the full time has been reached. |
h2h | string,boolean | http://.... | The API endpoint that can be used to compare the 2 teams head 2 head |
has_lineups | boolean | true | Whether we have the team lineups for this match |
home_id | integer | 19 | 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 |
home_name | string | Man United | The name of the home team. |
ht_score | string | 2 - 0 | The half time score of the game, if the half time has been reached. |
id | number | 49 | The id of the match, this is not the fixture id |
last_changed | datetime | 2018-03-23 14:27:02 | The date and time of the last match data update. |
location | string | Old Trafford | The place where the match takes place, it can be the stadium name, the city name, both, or it can even include the country name |
odds.live.1 | number | 2.19 | The odds of the home team winning as the match is being played |
odds.live.2 | number | 2.55 | The odds of the away team winning as the match is being played |
odds.live.X | number | 4.13 | The odds of a draw as the match is being played |
odds.pre.1 | number | 2.20 | The odds of the home team winning before the start of the match |
odds.pre.2 | number | 2.50 | The odds of the away team winning before the start of the match |
odds.pre.X | number | 4.00 | The odds of a draw before the start of the match |
outcomes.extra_time | string | 2 | The outcome of match after the 2 halves of extra time have finished (120 minutes) 1, X, or 2 |
outcomes.full_time | string | X | The outcome of the of the match after the 90 minutes: 1, X, or 2 |
outcomes.half_time | string | 1 | The outcome of the first half of the match 1, X, or 2 |
ps_score | string | 4 - 5 | The score after the penalty shootout |
scheduled | string | 12:00 | The hour and minute for which the match was schedule to start |
score | string | 2 - 0 | 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. |
status | string | NOT STARTED | 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 football 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. |
time | integer | 67 | The number minutes that have passed since the kick-off. |
{
"success": true,
"data": {
"match": [
{
"home_id": 2143,
"home_name": "Shandong Luneng",
"id": 374599,
"location": "Jinan Olympic Sports Center Stadium",
"scheduled": "11:03",
"away_id": 2003,
"ht_score": "2 - 0",
"events": "https:\/\/livescore-api.com\/api-client\/scores\/events.json?key=demo_key&secret=demo_secret&id=374599",
"score": "3 - 0",
"has_lineups": true,
"country": {
"flag": "CHN.png",
"name": "China",
"id": 26
},
"added": "2022-10-24 10:48:08",
"competition_name": "Super League",
"competition_id": 26,
"time": "90+",
"away_name": "Guangzhou Evergrande",
"ps_score": "",
"last_changed": "2022-10-24 13:20:11",
"fixture_id": 1549870,
"ft_score": "",
"odds": {
"live": {
"2": 101,
"1": 1.01,
"X": 29
},
"pre": {
"2": 13,
"1": 1.22,
"X": 6
}
},
"league_id": 0,
"status": "ADDED TIME",
"et_score": "",
"federation": null,
"h2h": "https:\/\/livescore-api.com\/api-client\/teams\/head2head.json?key=demo_key&secret=demo_secret&team1_id=2143&team2_id=2003",
"league_name": "",
"outcomes": {
"half_time": "1",
"full_time": null,
"extra_time": null
}
},
{
"home_id": 2934,
"home_name": "Mbeya City FC",
"id": 374598,
"location": "Sokoine Stadium",
"scheduled": "11:00",
"away_id": 2936,
"ht_score": "",
"events": "https:\/\/livescore-api.com\/api-client\/scores\/events.json?key=demo_key&secret=demo_secret&id=374598",
"score": "0 - 0",
"has_lineups": true,
"country": {
"flag": "TAN.png",
"name": "Tanzania",
"id": 91
},
"added": "2022-10-24 10:45:12",
"competition_name": "Premier League",
"competition_id": 80,
"time": "8",
"away_name": "Coastal Union",
"ps_score": "",
"last_changed": "2022-10-24 11:08:05",
"fixture_id": 1560491,
"ft_score": "",
"odds": {
"live": {
"2": null,
"1": null,
"X": null
},
"pre": {
"2": null,
"1": null,
"X": null
}
},
"league_id": 0,
"status": "IN PLAY",
"et_score": "",
"federation": null,
"h2h": "https:\/\/livescore-api.com\/api-client\/teams\/head2head.json?key=demo_key&secret=demo_secret&team1_id=2934&team2_id=2936",
"league_name": "",
"outcomes": {
"half_time": null,
"full_time": null,
"extra_time": null
}
}
]
}
}
EXAMPLES
cUrl:
curl -XGET "https://livescore-api.com/api-client/scores/live.json?key=demo_key&secret=demo_secret"
PHP:
file_get_contents('https://livescore-api.com/api-client/scores/live.json?key=demo_key\&secret=demo_secret');
Python:
import urllib2
req = urllib2.Request('https://livescore-api.com/api-client/scores/live.json?key=demo_key\&secret=demo_secret')
response = urllib2.urlopen(req)
print response.read()
GETTING LIVE-SCORES BY COMPETITION
To get the live-scores only for a certain competition, you have to provide the id of the competition as a get parameter in the api endpoint URL. In the example below, we show you how to get all the live-scores for Italy's Seria A. cUrl:
curl -XGET "https://livescore-api.com/api-client/scores/live.json?key=demo_key&secret=demo_secret&competition_id=4"
PHP:
file_get_contents('https://livescore-api.com/api-client/scores/live.json?key=demo_key\&secret=demo_secret\&competition_id=4');
Python:
import urllib2
req = urllib2.Request('https://livescore-api.com/api-client/scores/live.json?key=demo_key\&secret=demo_secret\&competition_id=4')
response = urllib2.urlopen(req)
print response.read()