API Keys
All API requests require authentication via API key.
Generating an API Key
- Log in to your dashboard
- Go to Profile → API Settings
- Click Generate API Key
- Copy and securely store your key
Your API key grants full access to your account’s API. Keep it secret and never share it publicly.
Using Your API Key
Include your API key in the Authorization header of every request:
Authorization: Bearer YOUR_API_KEY
Example with cURL
curl -X GET "https://api.alpessniper.com/v1/signals" \
-H "Authorization: Bearer YOUR_API_KEY"
Example with JavaScript
const response = await fetch('https://api.alpessniper.com/v1/signals', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
});
Example with Python
import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
response = requests.get(
'https://api.alpessniper.com/v1/signals',
headers=headers
)
API Key Security
Do
- Store keys in environment variables
- Use different keys for dev/prod
- Rotate keys periodically
- Monitor for unusual usage
Don't
- Commit keys to version control
- Share keys in public channels
- Expose keys in client-side code
- Use the same key everywhere
Revoking Keys
If your API key is compromised:
- Go to Profile → API Settings
- Click Revoke next to the compromised key
- Generate a new key
- Update your applications
Revoking a key takes effect immediately. All requests using that key will fail.
Error Responses
Invalid API Key
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}
Expired API Key
{
"success": false,
"error": {
"code": "KEY_EXPIRED",
"message": "Your API key has expired. Please generate a new one."
}
}