Standings
Standings are a vital part of the football data that people are interested in. It is no longer that only the live-scores, fixtures, or history data matters. We provide our subscribers with the possibility to get the current standings of any competition using this dedicated endpoint.
SEASONS
Before you are able to get the data for a specific competition you have to know the ID
of the season for which you want the standings. As we know, every season there is a new table with new and new standings in it. Below we have outlined the seasons that we have and what are their respective ids as well as some example competitions that might have standings for this season.
In our football API, there are 2 kinds of seasons. Whole calendar year season e.g. 2020 or an autumn/spring season e.g. 2018/2019. The season that a competition might have depends on the period during which it takes place. Let's take for example, the English Premier League (ID 2
). Since it starts in the autumn and ends in the spring will use the second type of season (2021/2022). Competitions like the Swedish Allsvenskan (ID 14
) and the Brazileiro (ID 24
) which start at the beginning of the calendar year and are completed towards the end of the same year get the first type of season format (2022). When it comes to qualifiers for international tournaments involving national teams the season for the qualification group standings is the same as the season in which the final tournament will take place. For example, the season for the UEFA EURO Qualifiers Groups is (2020)!
You can find more about our seasons and their IDs on the seasons list documentation page.
ENDPOINT
In order, to get the standings table for a football competition from our football API the only thing you need to do is the call the URL bellow. We are supporting table standings data for 400+ competitions from all over the globe. 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 standings table football API endpoint supports several parameters that you can use to filter the football data and traverse through it at your convenience. The parameters are listed in the table below. You can use the parameters together as well as separately.
Name | Type | Required | Example | Description |
---|---|---|---|---|
competition_id | Number | 1 | 2 | The ID of the competition which standings you need |
group | String | C | The name of the specific group which standings you need in case the competition has more than one groups like the UEFA Champions League | |
group_id | Number | 11 | The ID of the group for which we would like to get the standings | |
include_form | integer | 1 | Includes the last 6 matches team form to the response data | |
lang | String | ar | The ISO alpha2 code of the language in which you want the team names. | |
season | Number | 11 | The ID of the season for which you need the standings. This parameter is useful if you want the standings for past seasons. If this parameter is not provided the football API endpoint will return the standings for the most current season of the competition. |
RESPONSE
A response to a request will contain all the teams in the table standings with their relevant information. There is a JSON example below. Its a table with just a fraction of the teams participating in the English Premier League. An actual response will contain all 20 teams, it is just too big for us to put all of the data in this page.
{
"success": true,
"data": {
"table": [
{
"league_id": "0",
"season_id": "14",
"name": "Arsenal",
"rank": "1",
"points": "18",
"matches": "7",
"goal_diff": "10",
"goals_scored": "17",
"goals_conceded": "7",
"lost": "1",
"drawn": "0",
"won": "6",
"team_id": "18",
"competition_id": "2",
"group_id": "1938",
"group_name": "1",
"stage_name": "Regular Season",
"stage_id": "2130",
"form": [
"W",
"W",
"L",
"L",
"W",
"W"
]
},
{
"league_id": "0",
"season_id": "14",
"name": "Manchester City",
"rank": "2",
"points": "17",
"matches": "7",
"goal_diff": "17",
"goals_scored": "23",
"goals_conceded": "6",
"lost": "0",
"drawn": "2",
"won": "5",
"team_id": "12",
"competition_id": "2",
"group_id": "1938",
"group_name": "1",
"stage_name": "Regular Season",
"stage_id": "2130",
"form": [
"W",
"D",
"D",
"W",
"W",
"D"
]
}
]
}
}
Name | Type | Example | Description |
---|---|---|---|
competition_id | Number | 2 | the id of the competition which standings we are getting |
drawn | Number | 7 | the number of drawn matches |
form | Array | W, L, D | The for of the team in the last 6 matches from the competition |
goal_diff | Number | 52 | the goal difference of the team, if it is negative, it will be a negative number e.g. -6 |
goals_conceded | Number | 18 | the number of goals the team conceded in their own goal |
goals_scored | Number | 70 | the number of goals the team scored in their opponents goals |
group_id | Number | 1681 | The ID of the group in which the standings are |
group_name | String | A | The name of the group where the standings are |
lost | Number | 1 | the number of games the team lost |
matches | Number | 31 | the number of matches that the team has played |
name | String | Manchester United | The name of the team in the requested language. |
points | Number | 76 | number of points accumulated |
rank | Number | 1 | the rank in the standings table that the team occupies |
season_id | Number | 2 | The id of the season for which you have requested the table standings |
stage_id | Number | 1675 | The id of the stage in which the group is located |
stage_name | String | Regular Season | The name of the stage in which the group is located in |
team_id | Number | 19 | the id of the team in our database |
won | Number | 23 | the number of matches the team won |
The following examples show you how to use this football API endpoint in various programming languages. In the examples, bellow we have used the English Premier League as an example, but it could be any other competition that has standings. 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
EXAMPLES
cUrl:
curl -XGET "https://livescore-api.com/api-client/leagues/table.json?competition_id=2&key=demo_key&secret=demo_secret"
PHP:
file_get_contents('https://livescore-api.com/api-client/leagues/table.json?competition_id=2\&key=demo_key\&secret=demo_secret');
Python:
import urllib2
req = urllib2.Request('https://livescore-api.com/api-client/leagues/table.json?competition_id=2\&key=demo_key\&secret=demo_secret')
response = urllib2.urlopen(req)
print response.read()
In the examples bellow you can see how you can request the team form trough your request. To do that you need to add the following query parameter to your football API request. &include_form=1
. Here are some examples:
cUrl:
curl -XGET "https://livescore-api.com/api-client/leagues/table.json?competition_id=2&key=demo_key&secret=demo_secret&include_form=1"
PHP:
file_get_contents('https://livescore-api.com/api-client/leagues/table.json?competition_id=2\&key=demo_key\&secret=demo_secret\&include_form=1');
Python:
import urllib2
req = urllib2.Request('https://livescore-api.com/api-client/leagues/table.json?competition_id=2\&key=demo_key\&secret=demo_secret\&include_form=1')
response = urllib2.urlopen(req)
print response.read()