Welcome to TheSportsDB API, your ultimate destination for seamless access to free, real-time sports data.
Whether you're building an app, running a fantasy league, or simply want to stay updated with live scores, player stats, team standings,
or match schedules, our powerful and easy-to-use API has you covered.
With support for a wide range of sports and leagues worldwide, TheSportsDB API is designed for developers, enthusiasts,
and startups looking to integrate reliable sports data without the hassle of expensive subscriptions.
Get started today and bring the game to life in your application!
Free vs Premium
We offer a free API that anyone can use. The site originally had all methods available to use under the free API with no limits,
but sadly it became too popular and was abused.
So over the years we have had to limit certain methods, while trying to keep the core functionality.
The Free API should work in many use cases, so please do test it out.
The current free API key is: 123
Premium API keys can be found on your user profile, once upgraded.
The Premium API includes all methods in V1 with larger limits as well as some extra stuff like livescores and video highlight links.
Premium also allows you to use the more modern V2 API. You can find your Premium API key on your user profile if you are a supporter.
API v1 vs v2
The v1 API was written over 10 years ago and has been addded to since with many extra features.
It uses basic PHP code to produce JSON objects that are returned to the user.
API users are authenticated with a simple numeric API key in the URL.
The naming is a little messy and the authentication is not great, as the key is visible to anyone who wants to poke around your web requests.
Saying that, it works and is simple to use and easy to test in any web browser. Ideal for beginners!
V2 API is more modern and verbous API.
This means it should be easier to understand in a logical way.
It also uses more modern authentication requiring the API key to be sent in the header.
When something goes wrong, the API will return standard HTTP response codes.
V2 is only for premium subscribers and will be the only version developed going forward.
Base URL
The Base URL is a crucial element for making API calls, enabling you to clearly specify the root URL(s) for API requests.
When making API calls, you combine the base URL with the specific endpoint path to form the complete request URL.
v1 Base URL = https://www.thesportsdb.com/api/v1/json
v2 Base URL = https://www.thesportsdb.com/api/v2/json
V1 Authentication
v1 of the API has a very simple authentication process.
Simply use the base URL above and append the number /123/ to the URL for the test key or replace with your premium API key.
You can see an example below using a simple web browser using the free '123' API key:
V2 Authentication
v2 takes a more secure, modern approach to Authentication.
When sending a request to the API base URL, you must include API key in the header using this attribute 'X-API-KEY'.
You can see an example below using the popular free API testing software: Httpie
Images
Our site has a huge amount of images for things like events, players and teams. Most are fan created.
There are 2 types of images available. JPEG fanart and transparent PNG mostly used for badges and logos.
You can see the different types of artwork and sizes on this page.
You can access any image from the front-end using the image URL from the returned JSON data.
Preview Images
Most of the time you won't want to download the original large image, just get a small preview.
This is possible simple by appending '/medium', '/small', '/tiny' onto the end URL. This will give you a smaller version.
The site has different rate limits for different levels of users.
You will recieve a "429" http header if you breach the limit, then you will need to wait another minute until requests will work again.
We enforce these not just to differentiate our tiers, but to keep the overall performance of the site stable.
Free users 30 requests per minute. Premium 100 per minute Business 120 per minute
V1 API Documentation
v1 API Search
Most API requests will start with a string search. Examples of this may be to find a team or player details.
All searches will return the entities data but also an ID number which can be used for later faster lookups.
Search Teams
Type:
Parameter:
Free Limit:
Premium Limit:
Example: JSON Data
Search for any sports team by its name. {strTeam}
Search Events:
Type:
Parameter:
Type:
Parameter:
Type:
Parameter:
Free Limit:
Premium Limit:
Example: JSON Data
Example with season: JSON Data
Example with date: JSON Data
Example with filename: JSON Data
Description: Search for any sports event by it's title with extra filters for season, date or filename: {strEvent}
Optional strings: {strSeason} {strDate} {strFilename}
Search Players:
Type:
Parameter:
Free Limit:
Premium Limit:
Example: JSON Data
Description: Search for any sports person by their main or alternate name. {strPlayer}
While the string search is useful above to find things, it is actually much quicker and simpler to retrieve data using the unique ID.
Lookups will return all data from that entity, you can find any ID by simply looking at the frontend websites URL usually.
For example the British Premier League's ID is 4328, or Formula 1's is 4370.
Lookup League:
Type:
Parameter:
Free Limit:
Premium Limit:
Example: JSON Data
Lookup a leagues details using its ID {idLeague}
Lookup League Table:
Type:
Parameter:
Free Limit:
Premium Limit:
Example: JSON Data
Lookup a current league points table using its ID: {idLeague}
Optional: {strSeason} (*Limited to featured soccer leagues ONLY)
Lookup Team Equipment
Type:
Parameter:
Free Limit:
Premium Limit:
Example: JSON Data
Lookup a teams historical and current equipment using its ID. {idTeam}
Lookup Player Former Teams
Type:
Parameter:
Free Limit:
Premium Limit:
Example: JSON Data
Lookup all former teams for a player using their ID. {idPlayer}
Lookup Event TV Broadcasts
Type:
Parameter:
Free Limit:
Premium Limit:
Example: JSON Data
Lookup all TV channels showing an event using its ID. {idEvent}
List Leagues:
Type:
Parameter:
The country name
Type:
Parameter:
The sport name
Free Limit: limit:
Premium Limit:
Example: JSON Data
List all the leagues in a country for a specific sport. {strCountry} {strSport}
List Seasons:
Type:
Parameter:
Free Limit:
Premium Limit:
Example: JSON Data
Example2: JSON Data
Example3: JSON Data
List all the seasons available for a specific league ID. {idLeague}
List Teams:
Type:
Parameter:
Type:
Parameter:
Type:
Parameter:
Free Limit:
Premium Limit:
Example: JSON Data
Example2: JSON Data
List all the teams in a specific league by the leagues name, country and sport or ID. {strLeague} {strCountry} {strSport}
The Schedule API allows you to look up past, present and future events.
It includes the ability to lookup entire seasons as well as the just a few of the next and past events.
Schedule Team Next:
Type:
Parameter:
Free Limit:
Premium Limit:
Example: JSON Data
See the next few upcoming events for a team using the Team ID.
Schedule League Previous:
Type:
Parameter:
Free Limit:
Premium Limit:
Example: JSON Data
See the next upcoming events for a team using the league ID. {idLeague}
Schedule Day:
Type:
Parameter:
Type:
Parameter (Optional):
Type:
Parameter (Optional):
Free Limit:
Premium Limit:
Example: JSON Data
Example2: JSON Data
Example3: JSON Data
See the events on a specific day in the future, past or present.
You can also add an optional filter for league ID. {dateEvent} {strSport} {strLeague}
Schedule Season:
Type:
Parameter:
Type:
Parameter:
Free Limit:
Premium Limit:
Example: JSON Data
See all the events for a particular season and filter by league ID. {idSeason} {strSeason}
Schedule TV:
Type:
Parameter:
Free Limit:
Premium Limit:
Example: JSON Data
Example2: JSON Data
Example3: JSON Data
Example4: JSON Data
See the TV schedual for a particular date. {dateEvent} {strSport} {strCountry} {strChannel}
The video API allows you to list any YouTube highlights associated with an event.
Please be aware that we have no control of YouTube and some videos may be geolocked to specific countries.
You can use various filters including date on its own or with a League ID or Sport.
Video Youtube Highlights:
Type:
Parameter:
Type:
Parameter (optional): {League ID}
Type:
Parameter (optional): {Sport_Name}
Free Limit:
Premium Limit:
Example: JSON Data
Example 2: JSON Data
Example 3: JSON Data
See the TV schedual for a particular date
All Countries
Type:
Limit:
Example: Static
/ Live
Show all the countries supported.
/api/v2/json/all/countries
All Sports
Type:
Limit:
Example: Static
/ Live
Show all the sports supported.
/api/v2/json/all/sports
All Leagues
Type:
Limit:
Example: Static
/ Live
Show all the leagues supported.
/api/v2/json/all/leagues
v2 API Schedule
Next 10 Events in League
Type:
Limit:
Example: Static
/ Live
List the next 5 events in a league using its unique ID {idLeague}
/api/v2/json/schedule/next/league/4328
Previous 10 Events in League
Type:
Limit:
Example: Static
/ Live
List the previous 5 events in a league using its unique ID {idLeague}
/api/v2/json/schedule/previous/league/4328
Next 10 Events in Team
Type:
Limit:
Example: Static
/ Live
List the next 5 events for a team using its unique ID {idTeam}
/api/v2/json/schedule/next/team/133612
Previous 10 Events in Team
Type:
Limit:
Example: Static
/ Live
List the previous 5 events for a team using its unique ID {idTeam}
/api/v2/json/schedule/previous/team/133612
Next 10 Events in Venue
Type:
Limit:
Example: Static
/ Live
List the next 5 events for a venue using its unique ID {idVenue}
/api/v2/json/schedule/next/venue/24413
Previous 10 Events in Venue
Type:
Limit:
Example: Static
/ Live
List the previous 5 events for a venue using its unique ID {idVenue}
/api/v2/json/schedule/previous/venue/24413
Full Team Season Schedule
Type:
Limit:
Example: Static
/ Live
List the full seasons schedule for a team using its unique ID {idTeam}
/api/v2/json/schedule/full/team/133612
Full League Season Schedule
Type:
Limit:
Example: Static
/ Live
List the full seasons schedule for a league using its unique ID {idLeague}
/api/v2/json/schedule/league/4328/2023-2024
v2 API Livescores
Livescore Sport
Type:
Limit:
Example: Static
/ Live
Show the current Livescores for a particular sport {strSport}
/api/v2/json/livescore/soccer
Livescore League
Type:
Limit:
Example: Static
/ Live
Show the current Livescores for a particular league by its unique ID {idLeague}
/api/v2/json/livescore/4399
Livescore All
Type:
Limit:
Example: Static
/ Live
Show the current Livescores for all sports.
/api/v2/json/livescore/all
Readme.io Documentation
Introduction
Readme.io is a great resource to check the documentation (a mirror of here) but also to test the API and see sample code in many different languages.
The sandbox feature with realtime logs and data is particularly useful for new developers.
OpenAPI / Swagger
Introduction
The OpenAPI Specification (OAS) defines a standard,
language-agnostic interface to HTTP APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code,
documentation, or through network traffic inspection. When properly defined, a consumer can understand and interact with the remote service with a
minimal amount of implementation logic.
An OpenAPI Description can then be used by documentation generation tools to display the API,
code generation tools to generate servers and clients in various programming languages, testing tools, and many other use cases.
Postman Collection
Introduction
Postman is the single platform for designing, building, and scaling APIs—together.
Join over 40 million users who have consolidated their workflows and leveled up their API game—all in one powerful platform.
Artificial Inteligence MCP
Introduction
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs.
Think of MCP like a USB-C port for AI applications.
Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories,
MCP provides a standardized way to connect AI models to different data sources and tools.