Getting Started with DeFiStream API
This guide gets you from zero to your first query in under 2 minutes.
Get Your API Key
- Sign up at defistream.dev
- Open your Dashboard
- Click Create API Key
- Copy the key (starts with
dsk_) — you won’t see it again
Keep your API key secret. Never commit it to git or share it publicly. See Authentication for details.
Use with AI Agents
DeFiStream has a remote MCP server — no install needed. Add it to Claude Code with one command:
claude mcp add defistream --transport http https://mcp.defistream.dev/mcp Then query blockchain data conversationally:
You: Get all USDT transfers to Binance in the last week
Claude: [builds and executes the query using DeFiStream tools] Also works with Claude Web, ChatGPT Desktop, and Codex CLI. See the full Agents docs for setup details.
Your First Query
Let’s fetch 24 hours of USDT transfers on Ethereum:
curl -H "X-API-Key: YOUR_API_KEY"
"https://api.defistream.dev/v1/erc20/events/transfer?network=ETH&since=2025-12-01T00:00:00Z&until=2025-12-02T00:00:00Z&token=USDT"
-o usdt_transfers.csv The API returns CSV by default. Open the file and you’ll see:
| block_number | time | token | sender | receiver | amount |
|---|---|---|---|---|---|
| 24000000 | 2025-12-01T00:06:11Z | USDT | 0x2158…a6a9 | 0x8b07…1d4d | 28.0 |
| 24000000 | 2025-12-01T00:06:11Z | USDT | 0x5050…2edf | 0x11b8…7f6 | 7638.83 |
| 24000000 | 2025-12-01T00:06:11Z | USDT | 0xae71…4bc6 | 0x1c01…06bd | 320.86 |
Key parameters:
network— blockchain to query (ETH, ARB, BASE, OP, POLYGON, …)token— token symbol or contract addresssince/until— time range in ISO 8601 format (you can also useblock_start/block_end)
Try More Protocols
AAVE V3 deposits on Ethereum:
curl -H "X-API-Key: YOUR_API_KEY"
"https://api.defistream.dev/v1/aave_v3/events/deposit?network=ETH&since=2025-12-01T00:00:00Z&until=2025-12-02T00:00:00Z"
-o aave_deposits.csv Uniswap V3 WETH/USDC swaps (0.3% fee tier):
curl -H "X-API-Key: YOUR_API_KEY"
"https://api.defistream.dev/v1/uniswap_v3/events/swap?network=ETH&since=2025-12-01T00:00:00Z&until=2025-12-02T00:00:00Z&symbol0=WETH&symbol1=USDC&fee=3000"
-o weth_usdc_swaps.csv Large native ETH transfers (> 100 ETH):
curl -H "X-API-Key: YOUR_API_KEY"
"https://api.defistream.dev/v1/native_token/events/transfer?network=ETH&since=2025-12-01T00:00:00Z&until=2025-12-02T00:00:00Z&min_amount=100"
-o large_eth_transfers.csv See the full API Reference for all protocols, parameters, and filtering options.
Aggregate Data
Get hourly USDT transfer volume instead of individual events:
curl -H "X-API-Key: YOUR_API_KEY"
"https://api.defistream.dev/v1/erc20/aggregate/transfer?network=ETH&since=2025-12-01T00:00:00Z&until=2025-12-02T00:00:00Z&token=USDT&group_by=time&period=1h"
-o usdt_hourly_volume.csv | time | count | total_amount |
|---|---|---|
| 2025-12-01T00:00:00Z | 1842 | 48520371.56 |
| 2025-12-01T01:00:00Z | 1756 | 35283910.24 |
| 2025-12-01T02:00:00Z | 1698 | 41092558.73 |
You can aggregate by time (with periods like 1h, 1d, 30m) or by block_number.
Use the Python Client
Install from PyPI:
pip install defistream from defistream import DeFiStream
client = DeFiStream(api_key="dsk_your_api_key")
df = (
client.erc20.transfers("USDT")
.network("ETH")
.since("2025-12-01")
.until("2025-12-02")
.min_amount(10000)
.as_df()
)
print(df.head()) See the full Python Client docs for all protocols, output formats, async usage, and more.
Next Steps
- API Reference — all endpoints, parameters, and filtering options
- Python Client — installation, output formats, and advanced usage
- AI Agents — connect DeFiStream to Claude, ChatGPT, or Codex
- Best Practices — optimize queries and manage quota
- Rate Limits — understand quotas and rate limit headers