Skip to main content
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.
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

  1. Log in to your dashboard
  2. Find the API Credentials section
  3. 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:
  1. Go to your dashboard
  2. Click Regenerate Token
  3. 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

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 } }
);
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 CodeErrorDescription
401Missing API KeyNo x-api-key header provided
401Invalid API KeyThe provided API key is not valid
403Account SuspendedYour account has been suspended
429Rate Limit ExceededYou’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);