Skip to main content

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

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 address
  • limit (optional) - Transaction limit (default: 50, max: 200)
  • experimental (optional) - Include experimental detections (default: false)
Example:

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 limit
  • experimental (optional) - Include experimental detections
Example:

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

  1. Cache responses - Don’t check the same address repeatedly
  2. Handle rate limits - Implement exponential backoff
  3. Validate addresses - Check format before API calls
  4. Use appropriate endpoints - Choose the right endpoint for your use case
  5. Monitor usage - Track rate limit headers

Next Steps

Widget Integration

Embed our widget into your website.

API Reference

Complete API documentation.