Overview
The Have I Been Drained? API provides REST endpoints for checking wallet security and querying the on-chain drainer registry. All endpoints are documented below with interactive playgrounds for testing.OpenAPI Specification
View the complete OpenAPI specification source code
Base URLs
- Production:
https://api.haveibeendrained.org - Development:
http://localhost:3001
Authentication
Most endpoints are public and don’t require authentication. For enterprise tier with higher rate limits, API keys are available. API keys can be provided via:X-API-KeyheaderUser-Agentheader (for programmatic access)
Rate Limits
Rate limits are tier-based and tracked via User-Agent headers:
Rate limit headers are included in all responses:
RateLimit-Limit: Maximum requests per windowRateLimit-Remaining: Requests remainingRateLimit-Reset: Unix timestamp when limit resetsRetry-After: Seconds until limit resets (when exceeded)
Cached responses do not count toward rate limits. See the Rate Limits guide for more details.
Response Formats
All responses follow a consistent format:Success Response
Error Response
Detection Patterns
The API detects the following security threats:-
SetAuthority Attacks (CRITICAL)
- Account ownership transfers
- 95% confidence
-
Unlimited Approvals (HIGH)
- Max uint64 token approvals
- 90% confidence
-
Known Drainers (CRITICAL)
- Addresses in on-chain registry
- 100% confidence
Endpoints
All API endpoints are documented below with interactive playgrounds. Click on any endpoint to view detailed documentation, try requests, and see example responses.The endpoints below are automatically generated from our OpenAPI specification. Use the interactive playgrounds to test requests directly in your browser.
Getting Started
Quickstart
Get started with your first API call
API Integration
Learn how to integrate the API
Authentication
Understand authentication and API keys
Rate Limits
Manage rate limits effectively