This live-score api endpoint allows you to get goal times, goal scorers as well as yellow and red cards information for live football matches as well as finished ones.
In order, to get the events of currently played football matches or finished games from our history database (if we provide such for this game), the only thing you need to do is the call the url bellow. In the beginning the data
array will be empty as there are no events that have happened. Once there are events, they will start appearing in the result from the soccer API endpoint. To make this API call you will need the id
of the football match. Our live-scores api endpoint provides information about the matches for which you can get data, by providing you with the link to the events api call.
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 contains the following information, for every event
element in the list. The same rules apply for the JSON objects and the XML tag elements. In addition to the list with the events, this soccer api endpoint also provides the general match information.
Name Type Example Description id integer 567 the id of the event. match_id integer 18098 the id of the match in which the event occurred. player string Paul Pogba the name of the player who is connected to the event. time integer 38 the minute since the kick-off when the event occurred. event string YELLOW_CARD the type of the event. sort integer 8 the order in which the events occurred starting from 0 and growing in positive numbers direction. Meaning the event number 2 happened before number 3. This will be helpful when 2 events in our real time match events data feed happen in the same minute. home_away character h/a indicator whether the player or event is related to the home team (value is h
) or the away team (values is a
).
{
"success": true,
"data": {
"event": [
{
"id": "10509914",
"match_id": "129180",
"player": "DEENEY TROY",
"time": "5",
"event": "GOAL",
"sort": "0",
"home_away": "h"
},
{
"id": "10509915",
"match_id": "129180",
"player": "MARIAPPA ADRIAN",
"time": "13",
"event": "YELLOW_CARD",
"sort": "1",
"home_away": "h"
},
{
"id": "10509916",
"match_id": "129180",
"player": "CAPOUE ETIENNE",
"time": "60",
"event": "YELLOW_CARD",
"sort": "2",
"home_away": "h"
},
{
"id": "10509917",
"match_id": "129180",
"player": "DOUCOURE ABDOULAYE",
"time": "61",
"event": "YELLOW_CARD",
"sort": "3",
"home_away": "h"
},
{
"id": "10509918",
"match_id": "129180",
"player": "DEENEY TROY",
"time": "62",
"event": "YELLOW_CARD",
"sort": "4",
"home_away": "h"
},
{
"id": "10510529",
"match_id": "129180",
"player": "VARDY JAMIE",
"time": "75",
"event": "GOAL",
"sort": "5",
"home_away": "a"
},
{
"id": "10510974",
"match_id": "129180",
"player": "PEREIRA RICARDO",
"time": "84",
"event": "YELLOW_CARD",
"sort": "6",
"home_away": "a"
},
{
"id": "10511398",
"match_id": "129180",
"player": "GRAY ANDRE",
"time": "90",
"event": "GOAL",
"sort": "7",
"home_away": "h"
},
{
"id": "10511625",
"match_id": "129180",
"player": "GRAY ANDRE",
"time": "90",
"event": "YELLOW_CARD",
"sort": "8",
"home_away": "h"
}
],
"match": {
"id": "129180",
"date": "2019-03-03",
"home_name": "Watford",
"away_name": "Leicester City",
"score": "2 - 1",
"ht_score": "1 - 0",
"ft_score": "2 - 1",
"et_score": "",
"time": "FT",
"league_id": "25",
"status": "FINISHED",
"added": "2019-03-03 11:55:12",
"last_changed": "2019-03-03 13:58:04",
"home_id": "11",
"away_id": "6",
"competition_id": "2",
"location": null,
"fixture_id": null,
"scheduled": null,
"home": {
"id": "11",
"name": "Watford",
"stadium": "Vicarage Road Stadium",
"location": "Vicarage Road Stadium"
},
"away": {
"id": "6",
"name": "Leicester City",
"stadium": "King Power Stadium",
"location": "King Power Stadium"
},
"competition": {
"id": "2",
"name": "Premier League"
}
}
}
}
Type | Meaing |
---|---|
GOAL | A goal was scored |
GOAL_PENALTY | A goal was scored from a penalty |
OWN_GOAL | An own goal was scored |
YELLOW_CARD | A player has been cautioned by the referee |
RED_CARD | A player was sent off by the referee |
YELLOW_RED_CARD | A player has received their second yellow card and they have been sent off. |
cUrl
curl -XGET http://livescore-api.com/api-client/scores/events.json?key=demo_key\&secret=demo_secret\&id=129180
PHPfile_get_contents('http://livescore-api.com/api-client/scores/events.json?key=demo_key&secret=demo_secret&id=129180');
Pythonimport urllib2
req = urllib2.Request('http://livescore-api.com/api-client/scores/events.json?key=demo_key&secret=demo_secret&id=129180')
response = urllib2.urlopen(req)
print response.read()