Match events

  1. Endpoint
  2. Parameters
  3. Response
  4. Code Examples

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.

ENDPOINT


In order, to get the events of live football matches or finished games from our history database (if we provide such for this game), the only thing you need to do is call the URL bellow. At the beginning of the match, the data array will be empty as there will be no events that have happened. As the football match progresses, the events will appear in the result from the football API endpoint. To make this API call you will need the id of the football match.


GET:

Parameters


NameTypeRequiredExampleDescription
idNumber1129180The id of the match for which we want the events
langStringarThe 2 letter code of one of the supported languages. This is only available for selected packages.

RESPONSE


The response contains the following information, for every event element in the list. In addition to the list with the events, this football API endpoint also provides general match information.


NameTypeExampleDescription
eventStringYELLOW_CARDThe type of the event. Check the reference table below.
info.idNumber2961The ID of the second player who is connected to the event (substitution). The value could be null
info.nameStringMarcus ThuramThe name of the second player who is connected to the event (assist). The value could be null
is_awayBooleanfalseIndicator whether the player or event is related to the away team
is_homeBooleantrueIndicator whether the player or event is related to the home team
labelStringGoalThe human readable label of the event
player.idNumber2170The ID of the player who is connected to the event. The value could be null
player.nameStringPaul PogbaThe name of the player who is connected to the event.
sortNumber8The 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.
timeNumber38The minute since the kick-off when the event occurred.

{
    "success": true,
    "data": {
        "match": {
            "id": "385735",
            "date": "2022-12-18",
            "time": "AP",
            "status": "FINISHED",
            "added": "2022-12-18 14:45:12",
            "last_changed": "2022-12-18 18:54:06",
            "location": "Lusail Stadium, Lusail",
            "fixture_id": "1581460",
            "scheduled": "15:00",
            "odds": {
                "pre": {
                    "1": 2.7,
                    "2": 2.88,
                    "X": 3.1
                },
                "live": {
                    "1": 26,
                    "2": 26,
                    "X": 1.01
                }
            },
            "outcomes": {
                "half_time": "1",
                "full_time": "X",
                "extra_time": "X",
                "penalty_shootout": "1"
            },
            "scores": {
                "score": "3 - 3",
                "ht_score": "2 - 0",
                "ft_score": "2 - 2",
                "et_score": "3 - 3",
                "ps_score": "4 - 2"
            },
            "home": {
                "id": 1443,
                "name": "Argentina",
                "stadium": "Estadio Monumental Antonio Vespucio Liberti",
                "country_id": 117,
                "logo": "https:\/\/cdn.live-score-api.com\/teams\/5362652dcc4f7738ae87703f69a2fa42.png"
            },
            "away": {
                "id": 1439,
                "name": "France",
                "stadium": "Stade de France",
                "country_id": 115,
                "logo": "https:\/\/cdn.live-score-api.com\/teams\/53e68d80e106b1910b234291b1fa8eca.png"
            },
            "competition": {
                "id": 362,
                "name": "FIFA World Cup",
                "is_league": false,
                "is_cup": true,
                "tier": 0,
                "has_groups": true,
                "active": true,
                "national_teams_only": true
            },
            "country": null,
            "federation": {
                "id": 1,
                "name": "FIFA"
            }
        },
        "event": [
            {
                "id": 310426483,
                "player": {
                    "id": 2170,
                    "name": "Lionel Messi"
                },
                "time": 23,
                "event": "GOAL",
                "sort": 0,
                "info": null,
                "is_home": true,
                "is_away": false,
                "label": "Goal"
            },
            {
                "id": 310426484,
                "player": {
                    "id": 13884,
                    "name": "Angel Di Maria"
                },
                "time": 36,
                "event": "GOAL",
                "sort": 1,
                "info": {
                    "id": 3257,
                    "name": "Alexis MacAllister"
                },
                "is_home": true,
                "is_away": false,
                "label": "Goal"
            },
            {
                "id": 310426485,
                "player": {
                    "id": 2961,
                    "name": "Marcus Thuram"
                },
                "time": 41,
                "event": "SUBSTITUTION",
                "sort": 2,
                "info": {
                    "id": 4336,
                    "name": "Olivier Giroud"
                },
                "is_home": false,
                "is_away": true,
                "label": "Substitution"
            },
            {
                "id": 310426487,
                "player": {
                    "id": 86149,
                    "name": "Enzo Fernandez"
                },
                "time": 45,
                "event": "YELLOW_CARD",
                "sort": 4,
                "info": null,
                "is_home": true,
                "is_away": false,
                "label": "Yellow card"
            }
        ]
    }
}


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.
SUBSTITUTIONA player coming on the pitch instead of someone of his teammates
MISSED_PENALTYWhen a player misses a penalty


CODE EXAMPLES


To get the events from any match that has events: cUrl:

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


To get the events with translations, you need to have the correct package purchased. Otherwise, the player names will be listed in English. Calling the URL with the additional lang parameter will also translate the labels of the event as well as other match information in the respective language. cUrl:

curl -XGET "https://livescore-api.com/api-client/matches/events.json?key=demo_key&secret=demo_secret&id=385735&lang=ar"
PHP:
file_get_contents('https://livescore-api.com/api-client/matches/events.json?key=demo_key\&secret=demo_secret\id=385735\&lang=ar');
Python:
import urllib2
req = urllib2.Request('https://livescore-api.com/api-client/matches/events.json?key=demo_key\&secret=demo_secret\&id=385735&lang=ar')
response = urllib2.urlopen(req)
print response.read()


Didn't find what you need?

Do no hesitate to contact us. We will get back to you as soon as possible.