Skip to main content

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:
Format:
Example:

Enterprise Tier

Rate Limit: 1000+ requests/hour Include your API key in the User-Agent or as a header: Option 1: User-Agent (Recommended)
Option 2: X-API-Key Header
Example:

Getting an API Key

API keys are available for enterprise tier users. Contact [email protected] to request an API key.
Requirements:
  • Legitimate use case
  • Higher rate limit needs (1000+ req/hour)
  • Contact information for support
Process:
  1. Email [email protected]
  2. Describe your use case
  3. Provide contact information
  4. Receive API key via email

Rate Limit Headers

All responses include rate limit information:
Headers:
  • RateLimit-Limit - Maximum requests per window
  • RateLimit-Remaining - Requests remaining in current window
  • RateLimit-Reset - Unix timestamp when limit resets
  • Retry-After - Seconds until limit resets (when exceeded)

Rate Limit Exceeded

When rate limit is exceeded: Status Code: 429 Too Many Requests Response:
Handling:
  • Check Retry-After header for wait time
  • Implement exponential backoff
  • Consider upgrading to enterprise tier
  • Use cached responses when possible

Best Practices

User-Agent Formatting

✅ Good:
❌ Bad:

Rate Limit Management

  1. Monitor headers - Track remaining requests
  2. Implement caching - Cache responses when possible
  3. Use exponential backoff - When rate limited
  4. Request appropriate tier - Match your usage needs

Security

Never expose API keys in client-side code. Use server-side proxies for web applications.
  • 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

  • Upgrade to registered tier (add User-Agent)
  • Request enterprise tier API key
  • Implement response caching
  • Optimize request frequency
  • Verify key format (starts with hibd_)
  • Check User-Agent format
  • Ensure key is included in header
  • Contact support if issues persist
  • Verify User-Agent format
  • Check API key validity
  • Ensure headers are set correctly
  • Review error message details