DeBank APIdebank.com ↗
Access DeBank wallet portfolios via API. Retrieve DeFi protocol positions, idle token balances, asset exposure buckets, and wallet profile data for any address.
What is the DeBank API?
The DeBank API exposes 2 endpoints covering wallet-level DeFi portfolio data from debank.com. The get_full_portfolio_json endpoint returns protocol-level positions, idle token balances, asset exposure buckets, and a wallet overview in a single call. A companion get_wallet_profile endpoint provides summary figures — including total USD value and follower count — for any Ethereum-compatible wallet address.
curl -X GET 'https://api.parse.bot/scraper/b9d9f61a-6336-4f05-850e-3189194dbada/get_full_portfolio_json' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace debank-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""
DeBank Portfolio API Client using Parse.bot
Track wallet balances and DeFi positions across multiple chains and protocols.
Get your API key from: https://parse.bot/settings
"""
import os
import requests
from typing import Optional, Any
class ParseClient:
"""Client for interacting with DeBank Portfolio API via Parse.bot"""
def __init__(self, api_key: Optional[str] = None):
"""Initialize the Parse client with API credentials.
Args:
api_key: Parse API key. If not provided, reads from PARSE_API_KEY env var.
"""
self.base_url = "https://api.parse.bot"
self.scraper_id = "13747502-b591-4e2c-be8b-aebdd0d18362"
self.api_key = api_key or os.getenv("PARSE_API_KEY")
if not self.api_key:
raise ValueError("API key must be provided or set in PARSE_API_KEY environment variable")
def _call(self, endpoint: str, method: str = "POST", **params) -> dict[str, Any]:
"""Make a request to the Parse API.
Args:
endpoint: The endpoint name (e.g., 'get_full_portfolio_json')
method: HTTP method ('GET' or 'POST')
**params: Query/body parameters
Returns:
Response JSON as dictionary
"""
url = f"{self.base_url}/scraper/{self.scraper_id}/{endpoint}"
headers = {
"X-API-Key": self.api_key,
"Content-Type": "application/json"
}
if method == "GET":
response = requests.get(url, headers=headers, params=params)
else: # POST
response = requests.post(url, headers=headers, json=params)
response.raise_for_status()
return response.json()
def get_full_portfolio_json(
self,
address: str,
min_position_usd: float = 0
) -> dict[str, Any]:
"""Get full portfolio JSON for a wallet address.
Includes profile, DeFi positions, and idle tokens across all chains and protocols.
Args:
address: Wallet address to analyze (e.g., '0xd8...')
min_position_usd: Exclude positions below this USD value (default: 0)
Returns:
Portfolio data including wallet overview, protocols, and positions
"""
return self._call(
"get_full_portfolio_json",
method="GET",
address=address,
min_position_usd=min_position_usd
)
def get_wallet_profile(self, address: str) -> dict[str, Any]:
"""Get basic profile information for a wallet address.
Args:
address: Wallet address to analyze
Returns:
Profile data including USD value and follower count
"""
return self._call(
"get_wallet_profile",
method="GET",
address=address
)
def analyze_wallet_portfolio(client: ParseClient, wallet_address: str):
"""Analyze a wallet's portfolio with practical insights.
This demonstrates a real workflow:
1. Fetch wallet profile to get basic info
2. Get full portfolio to analyze positions
3. Process and display meaningful insights
"""
print(f"\n{'='*60}")
print(f"Analyzing Wallet: {wallet_address}")
print('='*60)
# Step 1: Get wallet profile
print("\n📊 Fetching wallet profile...")
profile = client.get_wallet_profile(wallet_address)
print(f" Portfolio Value: ${profile['usd_value']:,.2f}")
print(f" Followers: {profile['follower_count']:,}")
# Step 2: Get full portfolio with minimum position filter
print("\n🔍 Analyzing portfolio positions (minimum $100)...")
portfolio = client.get_full_portfolio_json(
address=wallet_address,
min_position_usd=100
)
# Step 3: Extract and process wallet overview
overview = portfolio.get('wallet_overview', {})
print(f"\n Chains Active: {overview.get('num_chains', 0)}")
print(f" Protocols Used: {overview.get('num_protocols', 0)}")
print(f" Total Net Value: ${overview.get('total_net_value_usd', 0):,.2f}")
# Step 4: Analyze protocols
protocols = portfolio.get('protocols', [])
if protocols:
print(f"\n📈 Top Protocols (by position count):")
for i, protocol in enumerate(protocols[:5], 1):
protocol_name = protocol.get('name', 'Unknown')
protocol_value = protocol.get('portfolio_item_list', [])
print(f" {i}. {protocol_name}: {len(protocol_value)} positions")
# Step 5: Analyze exposure buckets if available
buckets = portfolio.get('exposure_buckets', {})
if buckets:
print(f"\n💼 Exposure Distribution:")
for bucket_type, bucket_data in buckets.items():
if isinstance(bucket_data, dict):
bucket_value = bucket_data.get('usd_value', 0)
bucket_percentage = bucket_data.get('percentage', 0)
print(f" {bucket_type}: ${bucket_value:,.2f} ({bucket_percentage:.1f}%)")
# Step 6: Check idle wallet info
idle_wallet = portfolio.get('idle_wallet', {})
if idle_wallet:
idle_value = idle_wallet.get('usd_value', 0)
if idle_value > 0:
print(f"\n💤 Idle Assets: ${idle_value:,.2f}")
print(f"\n{'='*60}\n")
if __name__ == "__main__":
# Initialize client
client = ParseClient()
# Example wallet addresses to analyze (using common public addresses)
# You can replace these with actual addresses you want to analyze
wallet_addresses = [
"0x1234567890123456789012345678901234567890",
"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"
]
print("🚀 DeBank Portfolio Analysis Tool")
print("Powered by Parse.bot API")
for address in wallet_addresses:
try:
analyze_wallet_portfolio(client, address)
except requests.exceptions.HTTPError as e:
if e.response.status_code == 404:
print(f"⚠️ Wallet {address} not found or has no data")
else:
print(f"❌ Error analyzing {address}: {e}")
except Exception as e:
print(f"❌ Unexpected error: {e}")Returns the full portfolio JSON for a wallet address, including wallet profile, DeFi protocol positions, asset exposure buckets, and idle token balances.
| Param | Type | Description |
|---|---|---|
| addressrequired | string | Wallet address to retrieve portfolio data for. |
| min_position_usd | number | Exclude positions below this USD value |
{
"type": "object",
"fields": {
"protocols": "array",
"idle_wallet": "object",
"wallet_overview": "object",
"exposure_buckets": "object"
},
"sample": {
"wallet_overview": {
"address": "0xd8...",
"num_chains": 70,
"num_protocols": 20,
"total_net_value_usd": 1990862
}
}
}About the DeBank API
Portfolio Data
The get_full_portfolio_json endpoint accepts a required address parameter and an optional min_position_usd filter to exclude small positions from the response. It returns four top-level objects: protocols (an array of DeFi protocol positions), idle_wallet (tokens sitting in the wallet not deployed to any protocol), wallet_overview (aggregate balances and net worth), and exposure_buckets (categorical breakdown of asset exposure, such as stablecoins, native assets, or yield-bearing positions).
Wallet Profile
The get_wallet_profile endpoint retrieves lightweight identity and summary data for a given address. The response includes the wallet id, total usd_value, and follower_count — the last field reflecting DeBank's social layer, where addresses can be followed by other users on the platform.
Filtering and Scope
The min_position_usd parameter on get_full_portfolio_json is the primary way to reduce noise from dust positions. The filter applies across protocol positions, letting you focus on material holdings. Both endpoints key off a single address string, so multi-wallet aggregation requires multiple calls. There is no batch-address parameter in the current specification.
The DeBank API is a managed, monitored endpoint for debank.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when debank.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official debank.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Track a wallet's total DeFi net worth over time using
usd_valuefromget_wallet_profile - Build a protocol-exposure dashboard by parsing the
protocolsarray fromget_full_portfolio_json - Identify idle (undeployed) tokens in a wallet using the
idle_walletresponse field - Filter out dust positions in automated portfolio reports with the
min_position_usdparameter - Analyze asset category exposure (stablecoin vs. native vs. yield) via the
exposure_bucketsfield - Monitor whale wallets by combining
usd_valueandfollower_countfromget_wallet_profile
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does DeBank have an official developer API?+
What does the `exposure_buckets` field contain in `get_full_portfolio_json`?+
exposure_buckets object breaks down a wallet's holdings into asset categories — for example, stablecoins, native chain assets, and yield-bearing or LP positions. It gives a percentage or value distribution across those buckets rather than listing individual tokens.Can I retrieve historical portfolio snapshots or transaction history through this API?+
Does the API support querying multiple wallet addresses in a single request?+
address parameter per call. Batch queries are not supported in the current specification. You can fork this API on Parse and revise it to loop over multiple addresses or add a batch endpoint.What does `follower_count` in `get_wallet_profile` represent?+
follower_count field reflects how many DeBank users follow the queried address. It is a DeBank-specific metric and does not represent on-chain activity.