Response formats

In this reference page, we show all the possible response formats that you can get from our api endpoints.


In your requests to us you can choose the type of response that you want to get. In the making request reference page you can see how you form a url and how you can choose the format of the response that you want.

JSON

In the JSON format every response has two elements the success flag that lets you know if your requests was successful or not. if it is successful then there will be also a data element that will contain the important piece of information that you are trying to get. In case there is an error you will get an error element instead of data. You can read more on errors in our standard error reference page. Bellow is an example of JSON response. {
    "success":true,
    "data":{
        "match":[
            {
                "id":"28171",
                "home_name":"Belgrano",
                "away_name":"Coritiba",
                "score":"1 - 0",
                "time":"34",
                "league_id":"65",
                "status":"IN PLAY"
            },
            {
                "id":"28172",
                "home_name":"Flamengo",
                "away_name":"Palestino",
                "score":"0 - 1",
                "time":"36",
                "league_id":"65",
                "status":"IN PLAY"
            },
            {
                "id":"28173",
                "home_name":"Santa Cruz",
                "away_name":"Independiente Medellin",
                "score":"2 - 0",
                "time":"36",
                "league_id":"65",
                "status":"IN PLAY"
            },
            {
                "id":"28174",
                "home_name":"Union de Sunchales",
                "away_name":"Gimnasia y Esgrima de Concepcion",
                "score":"0 - 0",
                "time":"58",
                "league_id":"166",
                "status":"IN PLAY"
            },
            {
                "id":"28175",
                "home_name":"Corinthians",
                "away_name":"Cruzeiro",
                "score":"0 - 0",
                "time":"34",
                "league_id":"128",
                "status":"IN PLAY"
            },
            {
                "id":"28176",
                "home_name":"Gremio",
                "away_name":"Palmeiras",
                "score":"1 - 0",
                "time":"36",
                "league_id":"128",
                "status":"IN PLAY"
            },
            {
                "id":"28177",
                "home_name":"Real Potosi",
                "away_name":"Bolivar",
                "score":"2 - 1",
                "time":"61",
                "league_id":"91",
                "status":"IN PLAY"
            },
            {
                "id":"28178",
                "home_name":"Blooming",
                "away_name":"San Jose",
                "score":"3 - 0",
                "time":"HT",
                "league_id":"91",
                "status":"HALF TIME BREAK"
            },
            {
                "id":"28179",
                "home_name":"Tachira",
                "away_name":"Llaneros Guanare",
                "score":"2 - 0",
                "time":"84",
                "league_id":"66",
                "status":"IN PLAY"
            },
            {
                "id":"28180",
                "home_name":"DC United",
                "away_name":"Columbus Crew",
                "score":"2 - 0",
                "time":"86",
                "league_id":"94",
                "status":"IN PLAY"
            },
            {
                "id":"28181",
                "home_name":"Montreal Impact",
                "away_name":"San Jose Earthquakes",
                "score":"2 - 1",
                "time":"84",
                "league_id":"94",
                "status":"IN PLAY"
            },
            {
                "id":"28182",
                "home_name":"Toronto FC",
                "away_name":"Orlando City",
                "score":"0 - 0",
                "time":"77",
                "league_id":"94",
                "status":"IN PLAY"
            },
            {
                "id":"28183",
                "home_name":"Carolina RailHawks",
                "away_name":"New York Cosmos",
                "score":"0 - 2",
                "time":"75",
                "league_id":"67",
                "status":"IN PLAY"
            },
            {
                "id":"28184",
                "home_name":"Puerto Rico FC",
                "away_name":"Fort Lauderdale Strikers",
                "score":"2 - 1",
                "time":"83",
                "league_id":"67",
                "status":"IN PLAY"
            },
            {
                "id":"28186",
                "home_name":"Miami FC",
                "away_name":"Ottawa Fury",
                "score":"1 - 1",
                "time":"54",
                "league_id":"67",
                "status":"IN PLAY"
            }
        ]
    }
}

XML

In the XML data format you will either get an object information or a list with lots of elements from the same time. In the case of an error there will be an error tag as well. You can find more about error messages on our standard error reference page. We do not put any attributes in the XML tags which should make parsing the XML response easier for you.

{
    "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"
            }
        ]
    }
}

CSV

In the Comma Separated Value (CSV) type of response format we use , as separators. You can also specify your own delimiter character which will be put on the place of the commas. Lets say that you want to use the information in Excel or other spreadsheet program, then you might want to choose tabs \t as your delimiter. You specify the delimiter as a $_GET query variable called delimiter. You can find out more about structuring your request on our making request reference page. Since the there is no implicit structure in the CSV files we put the names of the columns on the first row in the response, again separated with the chosen or default delimiter.

id,home_name,away_name,score,time,league_id,status
28171,Belgrano,Coritiba,1 - 0,34,65,IN PLAY
id,home_name,away_name,score,time,league_id,status
28172,Flamengo,Palestino,0 - 1,36,65,IN PLAY
id,home_name,away_name,score,time,league_id,status
28173,Santa Cruz,Independiente Medellin,2 - 0,36,65,IN PLAY
id,home_name,away_name,score,time,league_id,status
28174,Union de Sunchales,Gimnasia y Esgrima de Concepcion,0 - 0,58,166,IN PLAY
id,home_name,away_name,score,time,league_id,status
28175,Corinthians,Cruzeiro,0 - 0,34,128,IN PLAY
id,home_name,away_name,score,time,league_id,status
28176,Gremio,Palmeiras,1 - 0,36,128,IN PLAY
id,home_name,away_name,score,time,league_id,status
28177,Real Potosi,Bolivar,2 - 1,61,91,IN PLAY
id,home_name,away_name,score,time,league_id,status
28178,Blooming,San Jose,3 - 0,HT,91,HALF TIME BREAK
id,home_name,away_name,score,time,league_id,status
28179,Tachira,Llaneros Guanare,2 - 0,84,66,IN PLAY
id,home_name,away_name,score,time,league_id,status
28180,DC United,Columbus Crew,2 - 0,86,94,IN PLAY
id,home_name,away_name,score,time,league_id,status
28181,Montreal Impact,San Jose Earthquakes,2 - 1,84,94,IN PLAY
id,home_name,away_name,score,time,league_id,status
28182,Toronto FC,Orlando City,0 - 0,77,94,IN PLAY
id,home_name,away_name,score,time,league_id,status
28183,Carolina RailHawks,New York Cosmos,0 - 2,75,67,IN PLAY
id,home_name,away_name,score,time,league_id,status
28184,Puerto Rico FC,Fort Lauderdale Strikers,2 - 1,83,67,IN PLAY
id,home_name,away_name,score,time,league_id,status
28186,Miami FC,Ottawa Fury,1 - 1,54,67,IN PLAY

Copied
Feedback