Skip to content

API-Documentation

TheSportsDB provides a simple yet powerful REST-API for developers seeking access to sports-related information. Include a valid API key with every request. The API key can be obtained by signing up for an account on TheSportsDB.

Base URL:

https://www.thesportsdb.com/api/v1/json/<API_KEY>/

<API_KEY>: Your unique API key, required for making requests.

All API requests require a valid API key, which must be included as part of the URL in each request. The API returns an error if the key is missing or invalid. Example:

https://www.thesportsdb.com/api/v1/json/123/searchplayers.php?t=Arsenal

Search for players by team name. Endpoint

/searchplayers.php
ParametersTypeDescriptionRequired/Optional
tStringSearch term for team nameRequired
  • t stands for team
import fetch from "node-fetch";
const API_KEY = "<API_KEY>";
const url = `https://www.thesportsdb.com/api/v1/json/${API_KEY}/searchplayers.php?t=Arsenal`;
const response = await fetch(url);
const data = await response.json();
console.log(data);
{
"player": [
{
"idPlayer": "34146370",
"strPlayer": "Kai Havertz",
"strTeam": "Arsenal",
"strNationality": "Germany",
...
}
]
}
HTTP CodeDescription
200OK. Returns the data
202OK. Data is empty
400Bad Request. Double check request type.
404Not Found. Check that parameter is spelled correctly.
500Internal Server Error. Wait a few minutes and try again.