Overview
The Have I Been Drained API provides REST endpoints for checking wallet security. This guide shows you how to integrate it into your application.Endpoints
Unified Check Endpoint (Recommended)
Endpoint:GET /api/v1/check
Use case: Most common use case - checks drainer status first, then performs full analysis if needed.
The unified check endpoint follows this flow:
Parameters:
address(required) - Solana wallet addresslimit(optional) - Transaction limit (default: 50, max: 200)experimental(optional) - Include experimental detections (default: false)
Drainer Check Only
Endpoint:GET /api/v1/drainer/:address
Use case: Quick check if address is a known drainer (faster, no analysis).
Example:
Full Analysis Only
Endpoint:GET /api/v1/analyze/:address
Use case: Perform full wallet analysis (skips drainer check).
Parameters:
limit(optional) - Transaction limitexperimental(optional) - Include experimental detections
Response Formats
Drainer Response
Wallet Analysis Response
Error Response
Integration Examples
JavaScript/Node.js
Python
Go
Use Cases
Pre-Transaction Check
Check wallet before allowing transactions:Wallet Connection Warning
Warn users when connecting risky wallets:Security Dashboard
Display wallet security status:Error Handling
Best Practices
- Cache responses - Don’t check the same address repeatedly
- Handle rate limits - Implement exponential backoff
- Validate addresses - Check format before API calls
- Use appropriate endpoints - Choose the right endpoint for your use case
- Monitor usage - Track rate limit headers
Next Steps
Widget Integration
Embed our widget into your website.
API Reference
Complete API documentation.