Authentication
Learn how to authenticate your API requests using API keys.
Getting an API Key
To use the Cappers API, you need an API key. You can get a free API key by creating an account.
Using Your API Key
Include your API key in the Authorization header of every request:
HTTP Header
Authorization: cap_your_api_key_herecURL Example
curl -X GET "https://api.cappersapi.com/v1/nba/teams" \
-H "Authorization: cap_xxxxxxxxxxxxxxxxxxxx"JavaScript
const response = await fetch('https://api.cappersapi.com/v1/nba/teams', {
headers: {
'Authorization': 'cap_xxxxxxxxxxxxxxxxxxxx'
}
});
const data = await response.json();Python
import requests
response = requests.get(
'https://api.cappersapi.com/v1/nba/teams',
headers={'Authorization': 'cap_xxxxxxxxxxxxxxxxxxxx'}
)
data = response.json()API Key Security
Keep Your API Key Secret
- Never expose your API key in client-side code
- Don't commit API keys to version control
- Use environment variables to store keys
- Rotate keys if you suspect they've been compromised
- Use different keys for development and production
Managing Your API Key
Each user gets one API key that you can manage from your dashboard:
View your key
Access your API key anytime from the dashboard
Monitor usage
Track how many requests you've made and your rate limit status
Regenerate your key
Create a new key if compromised (old key will be immediately invalidated)
View analytics (Pro+)
Pro and Elite plans include detailed usage analytics dashboard
Authentication Errors
| Status Code | Meaning |
|---|---|
| 401 | No API key provided or invalid API key |
| 403 | API key valid but doesn't have access to this endpoint (upgrade required) |
| 429 | Rate limit exceeded for your API key tier |