Your API key works across all SportsAPI Pro endpoints — Football, Basketball, Tennis, Baseball, and every other sport. One key, all sports.
API Key Authentication
All API requests require thex-api-key header:
Getting Your API Key
- Sign up at sportsapipro.com/register
- Go to your Dashboard
- Copy your API key from the API Credentials section
Regenerating Your Key
If your API key is compromised:- Go to your Dashboard
- Click Regenerate Token
- Update all applications with the new key
Security Best Practices
Use Environment Variables
Use Environment Variables
Store your API key in environment variables:
Server-Side Only
Server-Side Only
Always make API requests from your backend. Never expose your API key in client-side JavaScript or mobile apps.
Monitor Usage
Monitor Usage
Check your usage regularly via the
/status endpoint or your Dashboard. Unexpected spikes may indicate a compromised key.Authentication Errors
| Status | Error | Description |
|---|---|---|
401 | Missing API Key | No x-api-key header provided |
401 | Invalid API Key | The key is invalid or revoked |
403 | Account Suspended | Your account has been suspended |
429 | Rate Limit Exceeded | Daily quota exceeded |
Error Response
V1 vs V2 vs V3 Authentication
All three API versions use the samex-api-key header. The same API key works across all versions:
| Version | Auth Header | WebSocket Auth |
|---|---|---|
| V1 | x-api-key: KEY | wss://v1.{sport}.sportsapipro.com/ws?x-api-key=KEY |
| V2 | x-api-key: KEY | wss://v2.{sport}.sportsapipro.com/ws?x-api-key=KEY |
| V3 | x-api-key: KEY | N/A (REST only) |
WebSocket Authentication
WebSocket connections authenticate via thex-api-key query parameter:
V2 WebSocket requires a JSON subscription message after connecting. V1 WebSocket streams updates automatically upon connection. See the WebSocket Guide for full details.