This documentation applies to all SportsAPI Pro endpoints . Your API key works across all 20+ sports — Football, Basketball, Tennis, Hockey, Cricket, MMA, and more.
API Key Authentication
All API requests require authentication using your API key. Include your key in the x-api-key header with every request.
Football API
Basketball API
Tennis API
curl -X GET "https://v2.football.sportsapipro.com/api/football/live" \
-H "x-api-key: YOUR_API_KEY"
Never share your API key publicly or commit it to version control. Treat it like a password.
Getting Your API Key
Log in to your dashboard
Find the API Credentials section
Copy your API key
Your API key is displayed on your dashboard with a copy button for easy access.
Regenerating Your Key
If your API key is compromised:
Go to your dashboard
Click Regenerate Token
Update your applications with the new key
Regenerating your key immediately invalidates the old key. All applications using the old key will stop working.
Security Best Practices
Use Environment Variables
Store your API key in environment variables, not in your code: # .env file
SPORTSAPI_KEY = your_api_key_here
const apiKey = process . env . SPORTSAPI_KEY ;
// Football API
const footballResponse = await fetch (
"https://v2.football.sportsapipro.com/api/football/live" ,
{ headers: { "x-api-key" : apiKey } }
);
// Basketball API (same key!)
const basketballResponse = await fetch (
"https://v2.basketball.sportsapipro.com/api/basketball/live" ,
{ headers: { "x-api-key" : apiKey } }
);
Server-Side Requests Only
Always make API requests from your backend server, never from client-side JavaScript. This prevents exposing your API key.
Consider rotating your API keys periodically as a security best practice.
Regularly check your dashboard for unusual activity. Unexpected spikes in usage could indicate a compromised key.
Authentication Errors
Status Code Error Description 401 Missing API Key No x-api-key header provided 401 Invalid API Key The provided API key is not valid 403 Account Suspended Your account has been suspended 429 Rate Limit Exceeded You’ve exceeded your quota
Error Response Example
{
"success" : false ,
"error" : {
"code" : "INVALID_API_KEY" ,
"message" : "The provided API key is invalid or has been revoked."
}
}
Cross-Sport Authentication
Your API key is universal across all 20+ sports. When you authenticate with one sport’s API, you’re automatically authenticated for all others. Rate limits are shared across all sports.
Example: Multi-Sport Application
const API_KEY = process . env . SPORTSAPI_KEY ;
const headers = { "x-api-key" : API_KEY };
// Fetch live games from multiple sports in parallel
const [ footballGames , basketballGames , tennisGames ] = await Promise . all ([
fetch ( "https://v2.football.sportsapipro.com/api/football/live" , { headers }),
fetch ( "https://v2.basketball.sportsapipro.com/api/basketball/live" , { headers }),
fetch ( "https://v2.tennis.sportsapipro.com/api/tennis/live" , { headers })
]);
const football = await footballGames . json ();
const basketball = await basketballGames . json ();
const tennis = await tennisGames . json ();
console . log ( "Live Football Matches:" , football . events ?. length );
console . log ( "Live Basketball Games:" , basketball . events ?. length );
console . log ( "Live Tennis Matches:" , tennis . events ?. length );