DeBank API integration

We design and develop full-cycle blockchain solutions: from smart contract architecture to launching DeFi protocols, NFT marketplaces and crypto exchanges. Security audits, tokenomics, integration with existing infrastructure.
Showing 1 of 1 servicesAll 1306 services
DeBank API integration
Simple
from 1 business day to 3 business days
FAQ
Blockchain Development Services
Blockchain Development Stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1214
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_logo-advance_0.png
    B2B Advance company logo design
    561
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    823

DeBank API Integration

DeBank aggregates DeFi portfolios from 100+ protocols and 30+ chains. Instead of independently indexing positions in Aave, Uniswap, Compound and two dozen other protocols on Ethereum, Arbitrum, Polygon and BNB Chain simultaneously—one API call suffices. This is DeBank's value: ready-made aggregated portfolio view without custom indexing infrastructure.

DeBank API structure

DeBank OpenAPI provides several endpoint groups:

Token balances/v1/user/token_list: all ERC-20 tokens on all supported chains with current USD price and position value.

Protocol positions/v1/user/protocol: specific protocol and its positions (LP, staking, lending). /v1/user/complex_protocol_list—all protocols at once.

Transaction history/v1/user/history_list with pagination.

NFT/v1/user/nft_list.

const headers = { AccessKey: process.env.DEBANK_API_KEY }

// All user tokens on all chains
const tokens = await axios.get(
  `https://pro-openapi.debank.com/v1/user/all_token_list?id=${userAddress}&is_all=true`,
  { headers }
)

// Positions in specific protocol
const aavePositions = await axios.get(
  `https://pro-openapi.debank.com/v1/user/protocol?id=${userAddress}&protocol_id=aave3`,
  { headers }
)

Data model: what API returns

Each token in response contains: chain (chain identifier), id (contract address), amount (quantity), price (current USD price), usd_value (sum). For LP positions and protocol positions structure is more complex—nested objects with detail_types describing position type (lending, staking, vesting, etc.).

Important nuance: DeBank returns price: 0 for tokens without liquidity or below price threshold. Don't interpret this as error—normal for tail tokens.

Rate limiting and caching

DeBank Pro API has request rate limits per second. For applications with many users—mandatory server-side caching. Balance data changes rarely relative to RPC request time. Cache with TTL 60-300 seconds suits most use-cases.

Pattern: when requesting user data—return cached data immediately, run background update. User sees fresh data on next request.

async function getUserPortfolio(address: string) {
  const cacheKey = `portfolio:${address}`
  const cached = await redis.get(cacheKey)
  
  if (cached) {
    // Run background update
    updateInBackground(address, cacheKey)
    return JSON.parse(cached)
  }
  
  const fresh = await fetchFromDeBank(address)
  await redis.setex(cacheKey, 120, JSON.stringify(fresh))
  return fresh
}

Error handling and fallback

DeBank API—external service, it becomes unavailable. Application must correctly handle 503, 429 (rate limit) and timeout. On timeout—return cached data with mark about last update time, not show empty screen.

For critical functions (e.g., calculating collateral ratio for credit product)—don't rely only on DeBank. Backup channel: direct RPC calls to contracts via wagmi/viem for most important positions.

Timeline estimates

Basic DeBank API integration (tokens + protocol positions + history)—1-2 days. With caching, error handling and portfolio UI components—up to 5 days.

Cost calculated individually.