Getting live events beta

This livescore api endpoint allows you to get goal times, goal scorers as well as yellow and red cards information for football matches.


Endpoint

In order to get the events of currently football matches being played (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 api endpoint. To make this API call you will need the id of the football match. Our livescores 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

GET:

Response


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

  • id - the id of the event.
  • match_id - the id of the match in which the event occured.
  • player - the name of the player who is connected to the event.
  • time - the minute since the kick-off when the event occured.
  • event - the type of the event.
  • sort - the order in which the events occurred starting from 0 and growing in positive numbers direction.
  • home_away - 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": "1",
                "match_id": "11",
                "player": "SAAVEDRA MATIAS",
                "time": "26",
                "event": "GOAL",
                "sort": "0",
                "home_away": "a"
            },
            {
                "id": "2",
                "match_id": "11",
                "player": "MARTINEZ WILLIAMS",
                "time": "29",
                "event": "GOAL",
                "sort": "1",
                "home_away": "a"
            },
            {
                "id": "3",
                "match_id": "11",
                "player": "SAAVEDRA MATIAS",
                "time": "59",
                "event": "GOAL",
                "sort": "2",
                "home_away": "a"
            },
            {
                "id": "4",
                "match_id": "11",
                "player": "LOPEZ RENZO",
                "time": "91",
                "event": "GOAL",
                "sort": "3",
                "home_away": "h"
            },
            {
                "id": "5",
                "match_id": "11",
                "player": "LOPEZ RENZO",
                "time": "94",
                "event": "GOAL_PENALTY",
                "sort": "4",
                "home_away": "h"
            }
        ]
    }
}

Type of events


TypeMeaing
GOALA goal was scored
GOAL_PENALTYA goal was scored from a penalty
OWN_GOALAn own goal was scored
YELLOW_CARDA player has been cautioned by the referee
RED_CARDA player was sent off by the referee
YELLOW_RED_CARDA player has received their second yellow card and they have been sent off.

Code examples


cUrl
curl -XGET http://livescore-api.com/api-client/scores/events.json?key=demo_key\&secret=demo_secret\&id=11
PHP
file_get_contents('http://livescore-api.com/api-client/scores/events.json?key=demo_key&secret=demo_secret&id=11');
Python
import urllib2
req = urllib2.Request('http://livescore-api.com/api-client/scores/events.json?key=demo_key&secret=demo_secret&id=11')
response = urllib2.urlopen(req)
print response.read()

Copied
Feedback