Getting Started with DeFiStream API

This guide gets you from zero to your first query in under 2 minutes.


Get Your API Key

  1. Sign up at defistream.dev
  2. Open your Dashboard
  3. Click Create API Key
  4. 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_numbertimetokensenderreceiveramount
240000002025-12-01T00:06:11ZUSDT0x2158…a6a90x8b07…1d4d28.0
240000002025-12-01T00:06:11ZUSDT0x5050…2edf0x11b8…7f67638.83
240000002025-12-01T00:06:11ZUSDT0xae71…4bc60x1c01…06bd320.86

Key parameters:

  • network — blockchain to query (ETH, ARB, BASE, OP, POLYGON, …)
  • token — token symbol or contract address
  • since / until — time range in ISO 8601 format (you can also use block_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
timecounttotal_amount
2025-12-01T00:00:00Z184248520371.56
2025-12-01T01:00:00Z175635283910.24
2025-12-01T02:00:00Z169841092558.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