Passer au contenu principal
GET
/
v1
/
wallets
/
{walletId}
/
balances
Get Balances
curl --request GET \
  --url https://api.blockradar.co/v1/wallets/{walletId}/balances \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "address": "0x46705dfff24256421A05D056c29E81Bdc09723B8",
  "asset_id": "e7ecb0d4-1acb-42a1-afa9-58b202fee07f"
}
'
import requests

url = "https://api.blockradar.co/v1/wallets/{walletId}/balances"

payload = {
    "address": "0x46705dfff24256421A05D056c29E81Bdc09723B8",
    "asset_id": "e7ecb0d4-1acb-42a1-afa9-58b202fee07f"
}
headers = {
    "x-api-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.get(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'GET',
  headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    address: '0x46705dfff24256421A05D056c29E81Bdc09723B8',
    asset_id: 'e7ecb0d4-1acb-42a1-afa9-58b202fee07f'
  })
};

fetch('https://api.blockradar.co/v1/wallets/{walletId}/balances', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.blockradar.co/v1/wallets/{walletId}/balances",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_POSTFIELDS => json_encode([
    'address' => '0x46705dfff24256421A05D056c29E81Bdc09723B8',
    'asset_id' => 'e7ecb0d4-1acb-42a1-afa9-58b202fee07f'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "x-api-key: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.blockradar.co/v1/wallets/{walletId}/balances"

	payload := strings.NewReader("{\n  \"address\": \"0x46705dfff24256421A05D056c29E81Bdc09723B8\",\n  \"asset_id\": \"e7ecb0d4-1acb-42a1-afa9-58b202fee07f\"\n}")

	req, _ := http.NewRequest("GET", url, payload)

	req.Header.Add("x-api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.blockradar.co/v1/wallets/{walletId}/balances")
  .header("x-api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"address\": \"0x46705dfff24256421A05D056c29E81Bdc09723B8\",\n  \"asset_id\": \"e7ecb0d4-1acb-42a1-afa9-58b202fee07f\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.blockradar.co/v1/wallets/{walletId}/balances")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"address\": \"0x46705dfff24256421A05D056c29E81Bdc09723B8\",\n  \"asset_id\": \"e7ecb0d4-1acb-42a1-afa9-58b202fee07f\"\n}"

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "asset": {
        "asset": {
          "address": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
          "blockchain": {
            "createdAt": "2024-05-27T08:31:14.966Z",
            "derivationPath": "m/44'/60'/0'/0",
            "id": "74733889-4ecd-403e-9840-94e87c043f24",
            "isActive": true,
            "isEvmCompatible": true,
            "logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/Base_Network_Logo_vqyh7r.png",
            "name": "base",
            "slug": "base",
            "symbol": "eth",
            "tokenStandard": null,
            "updatedAt": "2024-10-27T07:52:16.115Z"
          },
          "createdAt": "2024-05-27T08:31:19.442Z",
          "decimals": 6,
          "id": "0927dc05-7d4e-4c0a-82c6-98ceb170ab84",
          "isActive": true,
          "logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800083/crypto-assets/usd-coin-usdc-logo_fs9mhv.png",
          "name": "USD Coin",
          "network": "testnet",
          "standard": null,
          "symbol": "USDC",
          "updatedAt": "2024-05-27T09:24:11.963Z"
        },
        "createdAt": "2024-08-22T10:34:38.785Z",
        "id": "dde9b0ce-599d-4ee4-9a17-960f06aa50a8",
        "isActive": true,
        "updatedAt": "2024-08-22T10:34:38.785Z"
      },
      "balance": "0.049",
      "convertedBalance": "0.049"
    },
    {
      "asset": {
        "asset": {
          "address": "0x0000000000000000000000000000000000000000",
          "blockchain": {
            "createdAt": "2024-05-27T08:31:14.966Z",
            "derivationPath": "m/44'/60'/0'/0",
            "id": "74733889-4ecd-403e-9840-94e87c043f24",
            "isActive": true,
            "isEvmCompatible": true,
            "logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/Base_Network_Logo_vqyh7r.png",
            "name": "base",
            "slug": "base",
            "symbol": "eth",
            "tokenStandard": null,
            "updatedAt": "2024-10-27T07:52:16.115Z"
          },
          "createdAt": "2024-05-27T08:31:19.440Z",
          "decimals": 18,
          "id": "ec9c982f-5d83-46e7-bda5-386100e795fc",
          "isActive": true,
          "logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800081/crypto-assets/ethereum-eth-logo_idraq2.png",
          "name": "Ethereum",
          "network": "testnet",
          "standard": null,
          "symbol": "ETH",
          "updatedAt": "2024-05-27T09:24:11.962Z"
        },
        "createdAt": "2024-08-22T10:05:46.167Z",
        "id": "ff99a04e-b279-4933-9075-29f0ae12eea0",
        "isActive": true,
        "updatedAt": "2024-08-22T10:05:46.167Z"
      },
      "balance": "0.049883596942791242",
      "convertedBalance": "121.19120110057246661416"
    }
  ],
  "message": "Balances fetched successfully",
  "statusCode": 200
}

Autorisations

x-api-key
string
header
requis

Paramètres de chemin

walletId
string
requis
Exemple:

"YOUR_WALLET_ID"

Corps

application/json
address
string
Exemple:

"0x46705dfff24256421A05D056c29E81Bdc09723B8"

asset_id
string
Exemple:

"e7ecb0d4-1acb-42a1-afa9-58b202fee07f"

Réponse

200 - application/json

200

data
object[]
Exemple:
[
  {
    "asset": {
      "asset": {
        "address": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
        "blockchain": {
          "createdAt": "2024-05-27T08:31:14.966Z",
          "derivationPath": "m/44'/60'/0'/0",
          "id": "74733889-4ecd-403e-9840-94e87c043f24",
          "isActive": true,
          "isEvmCompatible": true,
          "logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/Base_Network_Logo_vqyh7r.png",
          "name": "base",
          "slug": "base",
          "symbol": "eth",
          "tokenStandard": null,
          "updatedAt": "2024-10-27T07:52:16.115Z"
        },
        "createdAt": "2024-05-27T08:31:19.442Z",
        "decimals": 6,
        "id": "0927dc05-7d4e-4c0a-82c6-98ceb170ab84",
        "isActive": true,
        "logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800083/crypto-assets/usd-coin-usdc-logo_fs9mhv.png",
        "name": "USD Coin",
        "network": "testnet",
        "standard": null,
        "symbol": "USDC",
        "updatedAt": "2024-05-27T09:24:11.963Z"
      },
      "createdAt": "2024-08-22T10:34:38.785Z",
      "id": "dde9b0ce-599d-4ee4-9a17-960f06aa50a8",
      "isActive": true,
      "updatedAt": "2024-08-22T10:34:38.785Z"
    },
    "balance": "0.049",
    "convertedBalance": "0.049"
  },
  {
    "asset": {
      "asset": {
        "address": "0x0000000000000000000000000000000000000000",
        "blockchain": {
          "createdAt": "2024-05-27T08:31:14.966Z",
          "derivationPath": "m/44'/60'/0'/0",
          "id": "74733889-4ecd-403e-9840-94e87c043f24",
          "isActive": true,
          "isEvmCompatible": true,
          "logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/Base_Network_Logo_vqyh7r.png",
          "name": "base",
          "slug": "base",
          "symbol": "eth",
          "tokenStandard": null,
          "updatedAt": "2024-10-27T07:52:16.115Z"
        },
        "createdAt": "2024-05-27T08:31:19.440Z",
        "decimals": 18,
        "id": "ec9c982f-5d83-46e7-bda5-386100e795fc",
        "isActive": true,
        "logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800081/crypto-assets/ethereum-eth-logo_idraq2.png",
        "name": "Ethereum",
        "network": "testnet",
        "standard": null,
        "symbol": "ETH",
        "updatedAt": "2024-05-27T09:24:11.962Z"
      },
      "createdAt": "2024-08-22T10:05:46.167Z",
      "id": "ff99a04e-b279-4933-9075-29f0ae12eea0",
      "isActive": true,
      "updatedAt": "2024-08-22T10:05:46.167Z"
    },
    "balance": "0.049883596942791242",
    "convertedBalance": "121.19120110057246661416"
  }
]
message
string
Exemple:

"Balances fetched successfully"

statusCode
number
Exemple:

200