Overview
The Have I Been Drained API uses User-Agent headers for authentication and rate limiting. No API keys are required for basic usage, but they’re available for higher rate limits.User-Agent Format
Unregistered Tier (Default)
Rate Limit: 10 requests/hour No User-Agent header required, but you’ll have the lowest rate limit.Registered Tier
Rate Limit: 100 requests/hour Include your app information in the User-Agent:Enterprise Tier
Rate Limit: 1000+ requests/hour Include your API key in the User-Agent or as a header: Option 1: User-Agent (Recommended)Getting an API Key
API keys are available for enterprise tier users. Contact [email protected] to request an API key.
- Legitimate use case
- Higher rate limit needs (1000+ req/hour)
- Contact information for support
- Email [email protected]
- Describe your use case
- Provide contact information
- Receive API key via email
Rate Limit Headers
All responses include rate limit information:RateLimit-Limit- Maximum requests per windowRateLimit-Remaining- Requests remaining in current windowRateLimit-Reset- Unix timestamp when limit resetsRetry-After- Seconds until limit resets (when exceeded)
Rate Limit Exceeded
When rate limit is exceeded: Status Code:429 Too Many Requests
Response:
- Check
Retry-Afterheader for wait time - Implement exponential backoff
- Consider upgrading to enterprise tier
- Use cached responses when possible
Best Practices
User-Agent Formatting
✅ Good:Rate Limit Management
- Monitor headers - Track remaining requests
- Implement caching - Cache responses when possible
- Use exponential backoff - When rate limited
- Request appropriate tier - Match your usage needs
Security
- Server-side only - Keep API keys on your backend
- Environment variables - Store keys securely
- Rotate keys - Change keys if compromised
- Monitor usage - Watch for unusual activity
Code Examples
JavaScript/Node.js
Python
cURL
Troubleshooting
Rate limit too low
Rate limit too low
- Upgrade to registered tier (add User-Agent)
- Request enterprise tier API key
- Implement response caching
- Optimize request frequency
API key not working
API key not working
- Verify key format (starts with
hibd_) - Check User-Agent format
- Ensure key is included in header
- Contact support if issues persist
Authentication errors
Authentication errors
- Verify User-Agent format
- Check API key validity
- Ensure headers are set correctly
- Review error message details