Structure
General strucure used for all apis
Base URL & Versioning
Base URL: https://api.defistream.dev/v1
All endpoints are prefixed with /v1/. The version prefix ensures backwards compatibility as the API evolves.
Request Format
All API endpoints use HTTP GET requests with query parameters.
Common Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
network | string | Yes | Network identifier (ETH, ARB, BASE, OP, POLYGON, BSC, AVAX, etc.). Case-insensitive — eth, Eth, and ETH are all valid. |
block_start | integer | Yes* | Starting block number (inclusive) |
block_end | integer | Yes* | Ending block number (inclusive) |
since | string | Yes* | Start timestamp (ISO 8601 or Unix timestamp) |
until | string | Yes* | End timestamp (ISO 8601 or Unix timestamp) |
format | string | No | Output format: json (default), csv, parquet |
verbose | boolean | No | Include all fields (default: false) |
with_value | boolean | No | Enrich events with USD value data. Adds value_usd column (default: false) |
with_time | boolean | No | Include block timestamp (default: true) |
link | boolean | No | When true, upload file and return JSON with download link (CSV/Parquet only, default: false) |
*Either block range (block_start + block_end) OR time range (since + until) is required, but not both.
Block Range vs Time Range
You must specify either a block range or a time range:
Block Range:
?network=ETH&block_start=24000000&block_end=24010000 Time Range:
?network=ETH&since=2024-01-01T00:00:00Z&until=2024-01-01T01:00:00Z Time range accepts:
- ISO 8601 format:
2024-01-15T10:30:00Z - Unix timestamp (seconds):
1705315800
Value Column
Pass with_value=true to add USD value to applicable events.
- Individual event endpoints: Adds
value_usd(amount × price) column to each event. - Aggregate endpoints: When a protocol’s aggregatable columns include
value_usd, the aggregation producesagg_value_usd(sum per bucket). Withoutwith_value=true, these columns are absent and aggregation skips them gracefully (no errors). - Supported protocols: aave_v3, uniswap_v3, lido, erc20, native_token
- Prices used are estimates and gathered primarily from Binance
Address Label & Category Filters
Filter events by known entity names or categories instead of raw addresses. This allows filtering blockchain addresses by their tagged labels (e.g., “Binance”) and categories (e.g., “exchange”, “whale”).
How Matching Works
- Labels use
involving_label(and sender_label and received_labels in relevant events) to filter addresses for labels (e.g.involving_label=Deposit) - Categories similar to label, you can use
involving_categoy(and sender and receiver varients) (e.g.involving_category=exchange) - Multi-value support: For most events, comma-separated values are accepted (e.g.,
sender_label=Binance,Coinbase) - Case Insensitive support: all the variations of coinbase, Coinbase returns same results
Mutual Exclusivity Rules
Within each slot (involving/sender/receiver), only one of address/label/category can be set:
involvingvsinvolving_labelvsinvolving_category— pick onesendervssender_labelvssender_category— pick onereceivervsreceiver_labelvsreceiver_category— pick one
Additionally, involving* filters cannot be combined with sender*/receiver* filters.
Output Formats
Per-Provider Range Limits
| Provider | Max Time Range | Max Block Range (CSV/Parquet) | Max Block Range (JSON) |
|---|---|---|---|
| ERC-20, Native Token | 7 days | 1,000,000 (10,000,000 for ARB) | 10,000 |
| Aave V3, Uniswap V3, Lido, Stader, Threshold | 31 days | 10,000,000 | 10,000 |
Time range limits apply to all output formats. Block range limits vary by format as shown above.
JSON (Default)
- Max block range: 10,000 blocks (all providers)
- Best for: Small queries, real-time applications
- Time fields are ISO 8601 formatted
curl -H "X-API-Key: $API_KEY"
"https://api.defistream.dev/v1/erc20/events/transfer?network=ETH&block_start=24000000&block_end=24010000&token=USDT&format=json" CSV
- Max block range: Per-provider (see table above)
- Best for: Spreadsheet analysis, data export
- Streams in chunks for memory efficiency
curl -H "X-API-Key: $API_KEY"
"https://api.defistream.dev/v1/erc20/events/transfer?network=ETH&block_start=24000000&block_end=24100000&token=USDT&format=csv"
-o transfers.csv Parquet
- Max block range: Per-provider (see table above)
- Best for: Large-scale analysis, data pipelines
- Columnar format with excellent compression
- Recommended for queries over 10K blocks
curl -H "X-API-Key: $API_KEY"
"https://api.defistream.dev/v1/erc20/events/transfer?network=ETH&block_start=24000000&block_end=24100000&token=USDT&format=parquet"
-o transfers.parquet Link Mode (File Sharing)
When link=true is combined with format=csv or format=parquet, the file is uploaded to a temporary file sharing service and a JSON response with the download link is returned instead of the file itself.
- Supported formats:
csv,parquetonly - File expiry: 1 hour
- Use case: Share data files with others without downloading first, or for programmatic access to large files
Example:
# Get a shareable link for CSV data
curl -H "X-API-Key: $API_KEY"
"https://api.defistream.dev/v1/erc20/events/transfer?network=ETH&block_start=24000000&block_end=24100000&token=USDT&format=csv&link=true" Response:
{
"filename": "erc20_transfer_ETH_24000000_24100000.csv",
"link": "https://dl.defistream.dev/dh/abc123/erc20_transfer_ETH_24000000_24100000.csv",
"expiry": "2026-02-03 14:30:00",
"size": "1.29 MB"
} Verbose Mode
When verbose=true, responses include additional fields:
name: Event type namenetwork: Network identifiertx_hash/tx_id: Transaction hashlog_index: Log index within the transaction
Default (verbose=false) omits these fields to reduce payload size.
Response Format
Success Response (JSON)
{
"status": "success",
"events": [
{
"block_number": 24000001,
"time": "2024-07-15T10:30:00Z",
"token": "USDT",
"sender": "0x1234...5678",
"receiver": "0xabcd...ef01",
"amount": 10000.0
}
],
"count": 1
} Error Response
{
"status": "error",
"events": [],
"count": 0,
"error": "Description of the error"
} HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad request (invalid parameters) |
| 401 | Unauthorized (missing or invalid API key) |
| 403 | Forbidden (quota exceeded, key revoked, or endpoint not allowed) |
| 429 | Too many requests (rate limit exceeded) |
| 500 | Internal server error |
| 503 | Service unavailable (IndexServer not available) |