Getting Started

This guide will help you quickly get up and running with Blockdaemon's DeFi APIs.

Step 1: Sign Up for a Blockdaemon Account

  1. Go to the https://app.blockdaemon.com/.
  2. If you don’t have an account yet, create one by signing up with your email or using a supported SSO option.
  3. Verify your email if prompted to activate your account.

Step 2: Get Your Free Blockdaemon API Key

  1. After logging in, navigate to the DeFi APIs section on your dashboard.
  2. Here, you can either:
    1. Copy your free Blockdaemon API key, or
    2. Generate a new API key

❗️

Your API key is your unique access token. Keep it safe and do not share it to anyone.

Step 3: Make Your First API Request

  1. All requests to the Blockdaemon DeFi APIs require authentication using your API key. Learn more here.
  2. For example, to fetch a snapshot of a wallet’s asset portfolio:
    1. Replace YOUR_API_KEY with the actual key you obtained.
    2. Replace the Ethereum address with the address you want to query.
curl --request GET \
     --url 'https://svc.blockdaemon.com/defi/v1/balances?accountAddress=0xb8DC8a293fb4c6677dE0A29E505d33314eBB9161&tokenAddress=0x7F5c764cBc14f9669B88837ca1490cCa17c31607&chainIDs=eip155%3A1' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer YOUR_API_KEY'
  1. A sample response is shown below:
{
  "status": 200,
  "msg": "success",
  "data": {
    "native": "0",
    "evmTokens": [
      {
        "name": "Dai Stablecoin",
        "symbol": "DAI",
        "decimals": "18",
        "address": "0x6b175474e89094c44da98b954eedeac495271d0f",
        "balance": "1732207021824890025",
        "assetType": "ERC20",
        "USDPrice": "1.0001188795",
        "logoUrl": "https://assetlogo.expand.network/ethereum/DAI.png"
      },
      {
        "name": "USD Coin",
        "symbol": "USDC",
        "decimals": "6",
        "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "balance": "997568",
        "assetType": "ERC20",
        "USDPrice": "1.0001282756",
        "logoUrl": "https://assetlogo.expand.network/ethereum/USDC.png"
      },
      {
        "name": "SushiToken",
        "symbol": "SUSHI",
        "decimals": "18",
        "address": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
        "balance": "234925199478993887",
        "assetType": "ERC20",
        "USDPrice": "1.5005360210",
        "logoUrl": "https://assetlogo.expand.network/ethereum/SUSHI.png"
      },
      {
        "name": "Tether USD",
        "symbol": "USDT",
        "decimals": "6",
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "balance": "10007",
        "assetType": "ERC20",
        "USDPrice": "1.0001404515",
        "logoUrl": "https://assetlogo.expand.network/ethereum/USDT.png"
      },
      {
        "name": "Aave interest bearing DAI",
        "symbol": "aDAI",
        "decimals": "18",
        "address": "0x028171bca77440897b824ca71d1c56cac55b68a3",
        "balance": "54259196050366566",
        "assetType": "ERC20",
        "USDPrice": null,
        "logoUrl": "https://assetlogo.expand.network/ethereum/ADAI.png"
      },
      {
        "name": "Uniswap V2",
        "symbol": "UNI-V2",
        "decimals": "18",
        "address": "0xa478c2975ab1ea89e8196811f51a7b7ade33eb11",
        "balance": "2168376756249587",
        "assetType": "ERC20",
        "USDPrice": null,
        "logoUrl": "https://assetlogo.expand.network/ethereum/UNI-V2.png"
      }
    ]
  }
}

👍

References

  • Try the API live on our interactive documentation: here
  • See our supported protocols here
  • Learn how to swap assets with our guides: Guides - Asset Swap