Competition details
Returns one competition, including the id of its newest season and how many teams take part. Call it when you know the competition and need its current season.
https://api.soccer-data.co/v1/competitions/{competition_id}
- Read current_season_id from here instead of hard-coding a season, so your app moves on when a new season starts.
- current_season_id is null for competitions that are no longer played, so handle that case.
The competition's id, like competition_…. Find one with the ID guide.
The competition's id.
The competition's name.
Country name. Null for international competitions.
Two-letter ISO 3166 country code. Null for international competitions.
GB-ENG, GB-SCT, GB-WLS or GB-NIR for competitions in the UK nations. Null everywhere else.
UEFA, CONMEBOL, FIFA, CAF, AFC, CONCACAF or OFC for international competitions. Null for domestic ones.
The format: league, cup or tournament.
True when team statistics exist for this competition.
True when player statistics exist for this competition.
True when bookmaker odds exist for its matches, either pre-match prices or stored closing prices.
True when at least one of its matches has in-play odds right now.
True when expected goals (xG) data exists, with at least one non-zero value.
The id of the newest season. Null when the competition is dormant or has been discontinued.
How many teams take part.
curl "https://api.soccer-data.co/v1/competitions/competition_705uv6jm8myn" \ -H "X-Api-Key: $SOCCER_DATA_KEY"
const res = await fetch("https://api.soccer-data.co/v1/competitions/competition_705uv6jm8myn", {
headers: { "X-Api-Key": process.env.SOCCER_DATA_KEY },
});
const { data } = await res.json();
import os, requests
res = requests.get(
"https://api.soccer-data.co/v1/competitions/competition_705uv6jm8myn",
headers={"X-Api-Key": os.environ["SOCCER_DATA_KEY"]},
)
data = res.json()["data"]
$data = Http::withHeaders(['X-Api-Key' => env('SOCCER_DATA_KEY')])
->get('https://api.soccer-data.co/v1/competitions/competition_705uv6jm8myn')
->json('data');
{
"data": {
"id": "competition_705uv6jm8myn",
"name": "Premier League",
"country": "England",
"country_code": "GB",
"subdivision_code": "GB-ENG",
"confederation": null,
"type": "league",
"has_team_stats": true,
"has_player_stats": true,
"odds_available": true,
"live_odds_available": false,
"xg_available": true,
"current_season_id": "season_hr1ie7yrsdmt",
"total_teams": 20
}
}
### GET /competitions/{competition_id}
Competition details
Returns one competition, including the id of its newest season and how many teams take part. Call it when you know the competition and need its current season.
- Read current_season_id from here instead of hard-coding a season, so your app moves on when a new season starts.
- current_season_id is null for competitions that are no longer played, so handle that case.
Response fields:
- `data.id` (string): The competition's id.
- `data.name` (string): The competition's name.
- `data.country` (string): Country name. Null for international competitions.
- `data.country_code` (string): Two-letter ISO 3166 country code. Null for international competitions.
- `data.subdivision_code` (string): GB-ENG, GB-SCT, GB-WLS or GB-NIR for competitions in the UK nations. Null everywhere else.
- `data.confederation` (string): UEFA, CONMEBOL, FIFA, CAF, AFC, CONCACAF or OFC for international competitions. Null for domestic ones.
- `data.type` (string): The format: league, cup or tournament.
- `data.has_team_stats` (boolean): True when team statistics exist for this competition.
- `data.has_player_stats` (boolean): True when player statistics exist for this competition.
- `data.odds_available` (boolean): True when bookmaker odds exist for its matches, either pre-match prices or stored closing prices.
- `data.live_odds_available` (boolean): True when at least one of its matches has in-play odds right now.
- `data.xg_available` (boolean): True when expected goals (xG) data exists, with at least one non-zero value.
- `data.current_season_id` (string): The id of the newest season. Null when the competition is dormant or has been discontinued.
- `data.total_teams` (integer): How many teams take part.
Example: curl "https://api.soccer-data.co/v1/competitions/competition_705uv6jm8myn" -H "X-Api-Key: $SOCCER_DATA_KEY"