Authentication
How to authenticate with the PredictorBets API
Authentication is the first step to accessing PredictorBets' powerful prediction tools. Our API uses Bearer token authentication to ensure secure access to your betting data and predictions.
API Key Generation
To get started, you'll need to generate an API key from your PredictorBets dashboard. This key acts as your credential for all API requests.
Log In
Access your PredictorBets account at dashboard.predictorbets.com.
Navigate to API
Go to the API section in your account settings.
Generate Key
Click "Generate New Key" and copy the provided token.
Using Your API Key
Include your API key in the Authorization header of all requests using the Bearer scheme.
curl -X GET "https://api.predictorbets.com/predictions" \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"
const response = await fetch('https://api.predictorbets.com/predictions', {
headers: {
'Authorization': 'Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc'
}
});
const data = await response.json();
import requests
headers = {
'Authorization': 'Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc'
}
response = requests.get('https://api.predictorbets.com/predictions', headers=headers)
print(response.json())
Use test keys for development. They start with sk_test_.
Production keys start with sk_live_ and have higher rate limits.
Security Best Practices
Implement these practices to keep your account and data secure.
Troubleshooting
Common authentication issues and solutions.
| Issue | Solution |
|---|---|
| Invalid API Key | Check for typos and ensure you're using the correct key |
| Expired Token | Regenerate your API key from the dashboard |
| Rate Limit Exceeded | Upgrade your plan or implement request throttling |
Next Steps
Once authenticated, explore our predictions endpoint to start getting betting insights.
Last updated 1 week ago