Skip to main content
POST
/
balances
Get wallet balances
curl --request POST \
  --url https://api.leokit.dev/balances \
  --header 'Api-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
[
  {
    "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
    "chain": "ETH"
  },
  {
    "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
    "chain": "BTC"
  }
]
'
import requests

url = "https://api.leokit.dev/balances"

payload = [
{
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"chain": "ETH"
},
{
"address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
"chain": "BTC"
}
]
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{address: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb', chain: 'ETH'},
{address: 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh', chain: 'BTC'}
])
};

fetch('https://api.leokit.dev/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.leokit.dev/balances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'address' => '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'chain' => 'ETH'
],
[
'address' => 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh',
'chain' => 'BTC'
]
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"Content-Type: application/json"
],
]);

$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.leokit.dev/balances"

payload := strings.NewReader("[\n {\n \"address\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"chain\": \"ETH\"\n },\n {\n \"address\": \"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh\",\n \"chain\": \"BTC\"\n }\n]")

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

req.Header.Add("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.post("https://api.leokit.dev/balances")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"address\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"chain\": \"ETH\"\n },\n {\n \"address\": \"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh\",\n \"chain\": \"BTC\"\n }\n]")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.leokit.dev/balances")

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

request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"address\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"chain\": \"ETH\"\n },\n {\n \"address\": \"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh\",\n \"chain\": \"BTC\"\n }\n]"

response = http.request(request)
puts response.read_body
{
  "wallets": [
    {
      "chain": "ETH",
      "balances": [
        {
          "token_symbol": "ETH",
          "price": 3500.25,
          "balance": 2.5,
          "balance_usd": 8750.625,
          "icon": "https://static.leofinance.io/icons/eth.png"
        }
      ],
      "explorer": "https://etherscan.io/address/0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
      "balance_usd": 8750.625
    }
  ]
}
{
"message": "<string>",
"code": "<string>"
}

Authorizations

Api-Key
string
header
required

Demo API-Key (Sandbox): 7037d2b3-9c76-4f62-b730-c544f7570fa4

Body

application/json
address
string
required

Wallet address

chain
string
required

Blockchain short name

Response

Wallet balances across multiple chains

wallets
object[]