TheSportsDB Leagues API

The Leagues API from TheSportsDB — 5 operation(s) for leagues.

GitHub OpenAPI
Business capability
Sports, Betting & Fantasy AE-180.80

Operations 5

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /{apiKey}/lookuptable.php Get a league's standings for a season · Look up the league table (standings) for a league and season #
Ask an LLM
“Where can I find a league's table for a given season?”
“What positions did each team finish in last season?”
Tell an agent
Get the standings for league {l} in season {s} using API key {apiKey}.
Show the league table for league {l} and season {s} with key {apiKey}.
GET /{apiKey}/all_sports.php List all sports · List all sports #
Ask an LLM
“What sports does TheSportsDB cover?”
“Which sports can I browse in the database?”
Tell an agent
List every sport available in the database using API key {apiKey}.
Show me all the sport names with key {apiKey}.
GET /{apiKey}/all_countries.php List all countries · List all countries #
Ask an LLM
“Which countries are in the database?”
“Can I get a list of every country name the database covers?”
Tell an agent
List all countries in the database using API key {apiKey}.
Show every country name with key {apiKey}.
GET /{apiKey}/all_leagues.php List all leagues · List all leagues #
Ask an LLM
“What leagues are available across all sports?”
“Can I get a list of every league ID to look up a season?”
Tell an agent
List all leagues in the database using API key {apiKey}.
Show every league ID and name with key {apiKey}.
GET /{apiKey}/search_all_seasons.php List all seasons for a league · List all seasons for a league #
Ask an LLM
“Which seasons exist for a given league?”
“What seasons does one league have data for?”
Tell an agent
List all seasons for league {id} using API key {apiKey}.
Show every past season of league {id} with key {apiKey}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/sportsdb:sportsdb-leagues-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

sportsdb-leagues-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: TheSportsDB Leagues API
  description: REST API for TheSportsDB, an open, crowd-sourced database of sports artwork and metadata. The V1 API returns JSON for searches, lookups, leagues, players, teams, events, schedules, and video highlights, with the API key supplied as a path segment. The free test key is "3" (also documented as "123"). Premium V2 endpoints (livescores) authenticate with an API key in the X-API-KEY header.
  termsOfService: https://www.thesportsdb.com/
  contact:
    name: TheSportsDB
    url: https://www.thesportsdb.com/documentation
  version: '1.0'
servers:
- url: https://www.thesportsdb.com/api/v1/json
  description: V1 REST API; append the API key as the next path segment (e.g. /3/).
tags:
- name: Leagues
paths:
  /{apiKey}/lookuptable.php:
    get:
      operationId: lookupTable
      tags:
      - Leagues
      summary: Look up the league table (standings) for a league and season
      parameters:
      - $ref: '#/components/parameters/ApiKey'
      - name: l
        in: query
        required: true
        description: League ID (idLeague).
        schema:
          type: string
          example: '4328'
      - name: s
        in: query
        required: true
        description: Season.
        schema:
          type: string
          example: 2020-2021
      responses:
        '200':
          description: League standings.
          content:
            application/json:
              schema:
                type: object
  /{apiKey}/all_sports.php:
    get:
      operationId: allSports
      tags:
      - Leagues
      summary: List all sports
      parameters:
      - $ref: '#/components/parameters/ApiKey'
      responses:
        '200':
          description: List of sports.
          content:
            application/json:
              schema:
                type: object
  /{apiKey}/all_countries.php:
    get:
      operationId: allCountries
      tags:
      - Leagues
      summary: List all countries
      parameters:
      - $ref: '#/components/parameters/ApiKey'
      responses:
        '200':
          description: List of countries.
          content:
            application/json:
              schema:
                type: object
  /{apiKey}/all_leagues.php:
    get:
      operationId: allLeagues
      tags:
      - Leagues
      summary: List all leagues
      parameters:
      - $ref: '#/components/parameters/ApiKey'
      responses:
        '200':
          description: List of leagues.
          content:
            application/json:
              schema:
                type: object
  /{apiKey}/search_all_seasons.php:
    get:
      operationId: searchAllSeasons
      tags:
      - Leagues
      summary: List all seasons for a league
      parameters:
      - $ref: '#/components/parameters/ApiKey'
      - name: id
        in: query
        required: true
        description: League ID (idLeague).
        schema:
          type: string
          example: '4328'
      responses:
        '200':
          description: List of seasons.
          content:
            application/json:
              schema:
                type: object
components:
  parameters:
    ApiKey:
      name: apiKey
      in: path
      required: true
      description: API key path segment. The free test key is "3" (also documented as "123").
      schema:
        type: string
        default: '3'
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Premium V2 API key supplied in the X-API-KEY request header.