⚽
API 3.0
OddsCoreFootball APIAPI 2 (Deprecated)WidgetsContact
Football API 3.0
Football API 3.0
  • Welcome
    • 🛬Welcome
    • 🙋‍♂️Getting Started
    • 🤓What can you do with Sportmonks' data?
    • 🆕Differences between API 2 and API 3
      • API Changes
      • Syntax and filters
      • New endpoints and data features
    • 🔐Authentication
    • 👶Making your first request
    • 🔧Best Practices
  • API coach (BETA)
  • Changelog
    • 📄Changelog
    • 📁Changelog (BETA)
  • API
    • 💡Request options
      • Includes
        • Nested includes
      • Selecting fields
      • Filtering
      • Selecting and filtering
      • Ordering and sorting
    • 🔤Syntax
    • ♾️Rate limit
    • 👀Meta description
    • 📔Error codes
      • Include Exceptions
      • Filtering and Complexity Exceptions
      • Other Exceptions
    • 📚Code libraries
    • Translations (beta)
    • Demo response files
    • Data corrections
    • API 2.0 (Deprecated)
  • Endpoints and Entities
    • Endpoints
      • 📡Livescores
        • GET Inplay Livescores
        • GET All Livescores
        • GET Latest Updated Livescores
      • 🥅Fixtures
        • GET All Fixtures
        • GET Fixture by ID
        • GET Fixtures by Multiple IDs
        • GET Fixtures by Date
        • GET Fixtures by Date Range
        • GET Fixtures by Date Range for Team
        • GET Fixtures by Head To Head
        • GET Fixtures by Search by Name
        • GET Upcoming Fixtures by Market ID
        • GET Upcoming Fixtures by TV Station ID
        • GET Past Fixtures by TV Station ID
        • GET Latest Updated Fixtures
      • 🛰️States
        • GET All States
        • GET State by ID
      • ⌨️Types
        • GET All Types
        • GET Type by ID
        • GET Type by Entity
      • 🏆Leagues
        • GET All Leagues
        • GET League by ID
        • GET Leagues by Live
        • GET Leagues by Fixture Date
        • GET Leagues by Country ID
        • GET Leagues Search by Name
        • GET All Leagues by Team ID
        • GET Current Leagues by Team ID
      • 🗓️Seasons
        • GET All Seasons
        • GET Seasons by ID
        • GET Seasons by Team ID
        • GET Seasons by Search by Name
      • 📊Statistics
        • GET Season Statistics by Participant
        • GET Stage Statistics by ID
        • GET Round Statistics by ID
      • 📅Schedules
        • GET Schedules by Season ID
        • GET Schedules by Team ID
        • GET Schedules by Season ID and Team ID
      • 🪜Stages
        • GET All Stages
        • GET Stage by ID
        • GET Stages by Season ID
        • GET Stages by Search by Name
      • 🔂Rounds
        • GET All Rounds
        • GET Round by ID
        • GET Rounds by Season ID
        • GET Rounds by Search by Name
      • 🔢Standings
        • GET All Standings
        • GET Standings by Season ID
        • GET Standings by Round ID
        • GET Standing Correction by Season ID
        • Get Live Standings by League ID
      • 🥇Topscorers
        • GET Topscorers by Season ID
        • GET Topscorers by Stage ID
      • 🏃Teams
        • GET All Teams
        • GET Team by ID
        • GET Teams by Country ID
        • GET Teams by Season ID
        • GET Teams by Search by Name
      • 🧑Players
        • GET All Players
        • GET Player by ID
        • GET Players by Country ID
        • GET Players by Search by Name
        • GET Last Updated Players
      • 🧑‍🦱Team Squads
        • GET Team Squad by Team ID
        • GET Extended Team Squad by Team ID
        • GET Team Squad by Team and Season ID
      • 👨‍🏫Coaches
        • GET All Coaches
        • GET Coach by ID
        • GET Coaches by Country ID
        • GET Coaches Search by Name
        • GET Last Updated Coaches
      • 🕴️Referees
        • GET All Referees
        • GET Referee by ID
        • GET Referees by Country ID
        • GET Referees by Season ID
        • GET Referees Search by Name
      • ↔️Transfers
        • GET All Transfers
        • GET Transfer by ID
        • GET Latest Transfers
        • GET Transfers Between Date Range
        • GET Transfers by Team ID
        • GET Transfers by Player ID
      • 🏟️Venues
        • GET All Venues
        • GET Venue by ID
        • GET Venues by Season ID
        • GET Venues by Search by Name
      • 📺TV Stations
        • GET All TV Stations
        • GET TV Station by ID
        • GET TV Stations by Fixture ID
      • 🔮Expected (xG)
        • GET Expected by Team
        • GET Expected by Player
      • 🔭Predictions
        • GET Probabilities
        • GET Predictability by League ID
        • GET Probabilities by Fixture ID
        • GET Value Bets
        • GET Value Bets by Fixture ID
      • 🧙Standard Odds Feed
        • 👓Pre-match Odds
          • GET All Odds
          • Get Odds by Fixture ID
          • GET Odds by Fixture ID and Bookmaker ID
          • GET Odds by Fixture ID and Market ID
          • GET Last Updated Odds
        • 🧠Inplay Odds
          • GET All Inplay Odds
          • GET Inplay Odds by Fixture ID
          • GET Inplay Odds by Fixture ID and Bookmaker ID
          • GET Inplay Odds by Fixture ID and Market ID
          • GET Last Updated Inplay Odds
      • 🧙‍♂️Premium Odds Feed
        • 🕶️Premium Pre-match Odds
          • GET All Premium Odds
          • Get Premium Odds by Fixture ID
          • GET Premium Odds by Fixture ID and Bookmaker ID
          • GET Premium Odds by Fixture ID and Market ID
          • GET Updated Premium Odds Between Time Range
          • GET Updated Historical Odds Between Time Range
          • GET All Historical Odds
      • 🛒Markets
        • GET All Markets
        • GET All Premium Markets
        • GET Market by ID
        • GET Market by Search
      • 📑Bookmakers
        • GET All Bookmakers
        • GET All Premium Bookmakers
        • GET Bookmaker by ID
        • GET Bookmaker by Search
        • GET Bookmaker by Fixture ID
      • 📰News
        • GET Pre-Match News
        • GET Pre-Match News by Season ID
        • GET Pre-Match News for Upcoming Fixtures
        • GET Post-Match News
        • GET Post-Match News by Season ID
      • ⚔️Rivals
        • GET All Rivals
        • GET Rivals by Team ID
      • 🎙️Commentaries
        • GET All Commentaries
        • GET Commentaries by Fixture ID
    • Entities
      • 🥅Fixture
      • 🏆League, Season, Schedule, Stage and Round
      • 🧑‍🤝‍🧑Team, Player, Squad, Coach and Referee
      • 🔢Statistic
      • 🔮Expected
      • 🥇Standing and Topscorer
      • 🔭Odd and Prediction
      • Other
  • Tutorials and Guides
    • Tutorials
      • Introduction
        • Make your first request
        • Set your time zone
        • Pagination
      • Enrich your response
        • Nested includes
          • Syntax and relations
      • Includes
        • Events
        • States
        • Periods
        • Scores
        • Participants
        • Lineups
        • ballCoordinates
        • Pressure Index
        • Tips and tricks
      • Filter and select fields
        • Selecting fields
        • Filtering
        • Selecting and filtering
      • Leagues and seasons
        • Leagues
        • Seasons
      • Season schedule
        • Schedules
        • Stages
        • Rounds
      • Livescores and fixtures
        • Livescores
        • Fixtures
      • Lineups and formations
      • Statistics
        • Statistics types
        • Season statistics
        • Fixture statistics
        • Team statistics
        • Players statistics
      • Teams, players, coaches and referees
        • Teams
        • Players
        • Coaches
        • Referees
      • Standings
        • Season standings
        • Topscorer standings
      • Odds and predictions
        • Bookmakers
        • Markets
        • Pre-match odds
        • Live(Inplay) odds
        • hasOdds
        • Predictions
          • Probabilities
          • Value Bet
      • Expected
        • Endpoints
        • Includes
        • Coverage
      • News
        • Pre-match News
        • Post-match News
      • Placeholders
      • Timezone parameters on different endpoints
    • Guides
      • How-to use components
      • How-to use the Football API with Postman
      • How-to use the Football API tester
      • How-to use the Football API ID finder
      • How-to build a livescore website
      • How-to use the Predictions API
      • How-to build a match page
      • How-to build a custom plan
      • How-to build a match page with odds
      • How-to use xG data
      • How-to build a news website
      • How-to build a fantasy game guide
      • How-to use the new Champions League data
      • How-to build your World Cup application
      • How-to build a team page
      • How-to keep your database in SYNC
      • How-to use team mode in MySportmonks
    • Programming languages
      • A developers guide: Unleashing the power of the football API with JSON
      • A developers guide: Unleashing the power of the football API with PHP
      • A developers guide: Unleashing the power of the football API with Python
  • Definitions
    • 📔Response Codes
    • 🛰️States
    • ⌨️Types
      • Lineups, positions and formations
      • Events
      • Statistics
        • Coach statistics
        • Referee statistics
        • Stage statistics
        • Season statistics
        • Fixture statistics
        • Team statistics
        • Player statistics
      • Expected
      • Leagues and stages
      • Standings
      • Transfers
      • Highlights
      • Weather and pitch
  • FAQ
    • API 3.0
    • Odds
    • Integration
    • Sportmonks
  • Quicklinks
    • Postman
    • ID Finder
    • Sportmonks
    • MySportmonks
    • Football widgets
    • Plans and Pricing
    • Data features
    • FAQ
Powered by GitBook
On this page
  • Requesting leagues
  • GET All Leagues
  • GET League by ID
  • GET League by Country ID
  • GET League Search by Name
  • GET Leagues by Live
  • GET League by Fixture Date
  • Adding useful information
  • Selecting and filtering

Was this helpful?

  1. Tutorials and Guides
  2. Tutorials
  3. Leagues and seasons

Leagues

PreviousLeagues and seasonsNextSeasons

Last updated 10 months ago

Was this helpful?

Every continent has countries, every country has one or multiple leagues, and every league has one or more seasons. Therefore, for most customers, the leagues endpoint is the starting point. Via this endpoint, you can gather a complete overview of all the leagues available within your subscription.

You can retrieve basic league information or enrich your response with season and fixture information.

This section will briefly discuss all the options available to request leagues.

An overview of all the options available:

  • GET All Leagues: returns all the leagues that are accessible within your subscription.

  • Get League by ID: returns the single league you’ve requested by id.

  • GET League by Country ID: returns all the leagues from your requested country id.

  • GET League Live: returns the leagues with live fixtures.

  • GET League by Fixture Date: returns all the leagues with fixtures from your requested fixture date.

  • GET League Search by Name: returns all the leagues that match your search query.

For all the league endpoints the base URL is the same: URL:

https://api.sportmonks.com/v3/football/leagues

Per endpoint the rest of the URL requires additional information. We will explain this per endpoint.

Requesting leagues

GET All Leagues

As mentioned before, a great starting point for your football application is to gather an overview of all the leagues available in your subscription. You can do this via the endpoint.

Your request:

https://api.sportmonks.com/v3/football/leagues?api_token=YOUR_TOKEN
Response
{
  "data": [
    {
      "id": 271,
      "sport_id": 1,
      "country_id": 320,
      "name": "Superliga",
      "active": true,
      "short_code": "DNK SL",
      "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/271.png",
      "type": "league",
      "sub_type": "domestic",
      "last_played_at": "2023-02-27 18:00:00",
      "has_jerseys": false
    },
    {
      "id": 501,
      "sport_id": 1,
      "country_id": 1161,
      "name": "Premiership",
      "active": true,
      "short_code": "SCO P",
      "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/501.png",
      "type": "league",
      "sub_type": "domestic",
      "last_played_at": "2023-02-25 15:00:00",
      "has_jerseys": false
    },
    {
      "id": 513,
      "sport_id": 1,
      "country_id": 1161,
      "name": "Premiership Play-Offs",
      "active": true,
      "short_code": "SCO P PO",
      "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/1/513.png",
      "type": "league",
      "sub_type": "play-offs",
      "last_played_at": "2021-05-24 20:35:36",
      "has_jerseys": false
    },
    {
      "id": 1659,
      "sport_id": 1,
      "country_id": 320,
      "name": "Superliga Play-offs",
      "active": true,
      "short_code": null,
      "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/27/1659.png",
      "type": "league",
      "sub_type": "play-offs",
      "last_played_at": "2019-05-19 14:00:00",
      "has_jerseys": false
    }
  ],

Let’s take a look together at what the API returns. As you can see, the API returns all the leagues available in the free plan.

You can see the name of the league, the unique league id, the league logo, and the type and sub_type of the leagues.

GET League by ID

This endpoint is useful if you only want information about one particular league. You need to add the league id to your request:

https://api.sportmonks.com/v3/football/leagues/{league_id}

For example, if you’re only interested in the Scottish Premier League, your request will be:

https://api.sportmonks.com/v3/football/leagues/501?api_token=YOUR_TOKEN
Response
{
  "data": {
    "id": 501,
    "sport_id": 1,
    "country_id": 1161,
    "name": "Premiership",
    "active": true,
    "short_code": "SCO P",
    "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/501.png",
    "type": "league",
    "sub_type": "domestic",
    "last_played_at": "2023-02-25 15:00:00",
    "has_jerseys": false
  },

GET League by Country ID

The leagues by country id only returns all the leagues from your requested country ID. To request this, you’ll need to add /countries/{country_id} to the leagues base URL:

https://api.sportmonks.com/v3/football/leagues/countries/{country_id}

Tip: You can request all countries with their unique id via the GET All Countries endpoint.

For example, if you’re only interested in Scottish leagues, your request will be:

https://api.sportmonks.com/v3/football/leagues/countries/1161?api_token=YOUR_TOKEN
Response
{
  "data": [
    {
      "id": 501,
      "sport_id": 1,
      "country_id": 1161,
      "name": "Premiership",
      "active": true,
      "short_code": "SCO P",
      "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/501.png",
      "type": "league",
      "sub_type": "domestic",
      "last_played_at": "2023-02-25 15:00:00",
      "has_jerseys": false
    },
    {
      "id": 513,
      "sport_id": 1,
      "country_id": 1161,
      "name": "Premiership Play-Offs",
      "active": true,
      "short_code": "SCO P PO",
      "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/1/513.png",
      "type": "league",
      "sub_type": "play-offs",
      "last_played_at": "2021-05-24 20:35:36",
      "has_jerseys": false
    }
  ],

GET League Search by Name

This endpoint returns all the leagues based on your search query. This might come in handy if you cannot find a league or want to group leagues by name. To search on league name, you’ll need to add /search/{search_query} to the leagues base URL:

https://api.sportmonks.com/v3/football/leagues/search/{search_query}

For example, if you’re only interested in leagues with “Premier” in the name, your request will be:

https://api.sportmonks.com/v3/football/leagues/search/premier?api_token=YOUR_TOKEN
Response
{
  "data": [
    {
      "id": 501,
      "sport_id": 1,
      "country_id": 1161,
      "name": "Premiership",
      "active": true,
      "short_code": "SCO P",
      "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/501.png",
      "type": "league",
      "sub_type": "domestic",
      "last_played_at": "2023-02-25 15:00:00",
      "has_jerseys": false
    },
    {
      "id": 513,
      "sport_id": 1,
      "country_id": 1161,
      "name": "Premiership Play-Offs",
      "active": true,
      "short_code": "SCO P PO",
      "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/1/513.png",
      "type": "league",
      "sub_type": "play-offs",
      "last_played_at": "2021-05-24 20:35:36",
      "has_jerseys": false
    }
  ],

The more complete your search query is, the more relevant response you’ll get.

There is also an option to get all the leagues that have live fixtures.

GET Leagues by Live

https://api.sportmonks.com/v3/football/leagues/live

https://api.sportmonks.com/v3/football/leagues/live/?api_token=YOUR_TOKEN

The response can be empty if there are no leagues in your subscription that have live matches at the time you’re making the request.

GET League by Fixture Date

This endpoint returns all the leagues from your requested fixture date. This could be interesting if you want to know all the leagues that had fixtures on a specific date. You’ll need to add /date/{date} to the leagues base URL:

https://api.sportmonks.com/v3/football/leagues/date/{date}

https://api.sportmonks.com/v3/football/leagues/date/2022-09-03?api_token=YOUR_TOKEN
Response
{
  "data": [
    {
      "id": 501,
      "sport_id": 1,
      "country_id": 1161,
      "name": "Premiership",
      "active": true,
      "short_code": "SCO P",
      "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/501.png",
      "type": "league",
      "sub_type": "domestic",
      "last_played_at": "2023-02-25 15:00:00",
      "has_jerseys": false
    },

Adding useful information

Tip: If you’re interested in historical seasons, you need to use the seasons include.

You can also request the upcoming fixtures or the latest fixture of one particular league with the upcoming and latest include:

https://api.sportmonks.com/v3/football/leagues/501?api_token=YOUR_TOKEN&include=currentSeason;upcoming;latest
Response
{
  "data": {
    "id": 501,
    "sport_id": 1,
    "country_id": 1161,
    "name": "Premiership",
    "active": true,
    "short_code": "SCO P",
    "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/501.png",
    "type": "league",
    "sub_type": "domestic",
    "last_played_at": "2023-02-25 15:00:00",
    "has_jerseys": false,
    "current_season": {
      "id": 19735,
      "sport_id": 1,
      "league_id": 501,
      "tie_breaker_rule_id": 171,
      "name": "2022/2023",
      "finished": false,
      "pending": false,
      "is_current": true,
      "starting_at": "2022-07-30",
      "ending_at": "2023-04-22",
      "standings_recalculated_at": "2023-03-02 00:07:24",
      "games_in_current_week": false
    },
    "upcoming": [
      {
        "id": 18538017,
        "sport_id": 1,
        "league_id": 501,
        "season_id": 19735,
        "stage_id": 77457866,
        "group_id": null,
        "aggregate_id": null,
        "round_id": 275098,
        "state_id": 1,
        "venue_id": 8928,
        "name": "Aberdeen vs Rangers",
        "starting_at": "2023-04-22 14:00:00",
        "result_info": null,
        "leg": "1/1",
        "details": null,
        "length": 90,
        "placeholder": false,
        "last_processed_at": null,
        "has_odds": false,
        "starting_at_timestamp": 1682172000
      },
      {
        "id": 18538018,
        "sport_id": 1,
        "league_id": 501,
        "season_id": 19735,
        "stage_id": 77457866,
        "group_id": null,
        "aggregate_id": null,
        "round_id": 275098,
        "state_id": 1,
        "venue_id": 8909,
        "name": "Celtic vs Motherwell",
        "starting_at": "2023-04-22 14:00:00",
        "result_info": null,
        "leg": "1/1",
        "details": null,
        "length": 90,
        "placeholder": false,
        "last_processed_at": null,
        "has_odds": false,
        "starting_at_timestamp": 1682172000
      },
      
    //and more

Selecting and filtering

https://api.sportmonks.com/v3/football/leagues?api_token=YOUR_TOKEN

You can add the &select= parameter followed by the fields you want. In our case: name,image_path. This results in the below request and response:

https://api.sportmonks.com/v3/football/leagues?api_token=YOUR_TOKEN&select=name,image_path
Response
{
  "data": [
    {
      "name": "Superliga",
      "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/271.png",
      "id": 271,
      "sport_id": 1,
      "country_id": 320
    },
    {
      "name": "Premiership",
      "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/501.png",
      "id": 501,
      "sport_id": 1,
      "country_id": 1161
    },
    {
      "name": "Premiership Play-Offs",
      "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/1/513.png",
      "id": 513,
      "sport_id": 1,
      "country_id": 1161
    },
    {
      "name": "Superliga Play-offs",
      "image_path": "https://cdn.sportmonks.com/images/soccer/leagues/27/1659.png",
      "id": 1659,
      "sport_id": 1,
      "country_id": 320
    }
  ],

The URL to get all your leagues is the same as the base URL for leagues. All you have to do is authorize the request with your API token. Check our for more info.

Now that you've requested all the leagues, you also know their unique league id. You can use this id in the second option: .

Easy isn’t it? You can now request information per league. Now let’s imagine you want an overview of all the leagues in a specific country. The option could be just the endpoint you’re looking for.

Besides the fact that you, maybe, want to group the leagues per country, it’s also an option to group the leagues per name. The endpoint is perfectly suited for this.

The returns the leagues that currently have live fixtures. It could be a nice option if you want an overview of all the leagues that currently have live matches. To request all the leagues that have live matches, you’ll need to add /live to the leagues base URL:

The last option to retrieve leagues is to .

As you’ve learnt in the , you can enrich your request with includes. This section will discuss some of the most common requests used on the league’s endpoints.

First of all, you can find a list of all available includes on the . For the leagues, the most commonly used include is currentSeason. This include returns the unique active season. This id can be used on the seasons endpoint or as a filter option. We’ll come back to this in the

In our you’ve learnt how to select specific fields or filter only on the data you’re interested in. By default, our API returns a set of data related to the league. We can imagine you’re not interested in all the league data the API returns. Let’s say you’re only interested in the league name and logo.

We’re going to use the endpoint for this example.

Tip: Check our for more information and tips.

GET All Leagues
authentication section
GET League by ID
GET Leagues by Country ID
GET Leagues by Name
GET Leagues by Live
GET League by Fixture Date
includes tutorial
endpoint pages
seasons section.
filtering tutorial
GET All Leagues
filtering tutorial