Get BTC balances for a Bitcoin address or xpub
curl --request GET \
--url https://api.moralis.com/v1/wallets/{walletAddressOrPublicKey}/tokens \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.moralis.com/v1/wallets/{walletAddressOrPublicKey}/tokens"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.moralis.com/v1/wallets/{walletAddressOrPublicKey}/tokens', 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.moralis.com/v1/wallets/{walletAddressOrPublicKey}/tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.moralis.com/v1/wallets/{walletAddressOrPublicKey}/tokens"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
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.moralis.com/v1/wallets/{walletAddressOrPublicKey}/tokens")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moralis.com/v1/wallets/{walletAddressOrPublicKey}/tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"meta": {
"syncedAt": {
"bitcoin": "latest"
},
"unsupportedChains": [],
"failedChains": []
},
"address": "0xcb1c1fde09f811b294172696404e88e658659905",
"addressType": "evm",
"cursor": "eyJhbGciOi...VCaaw",
"result": [
{
"tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"balanceRaw": "8541786218567066193031597821",
"chainId": "bitcoin",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 6,
"logo": "https://logo.moralis.io/0x1_0xdac17f958d2ee523a2206206994597c13d831ec7_3b83ef2ba0dba0e3385a845032e48304.webp",
"possibleSpam": false,
"verifiedContract": true,
"balance": "8541786218567066193031.597821",
"securityScore": 99,
"portfolioPercentage": 100,
"usdPrice": 1,
"usdPrice24hrUsdChange": 0,
"usdPrice24hrPercentChange": 0,
"usdValue": 1,
"usdValue24hrUsdChange": 0,
"nativeToken": false,
"derivedAddress": "1EfgV2Hr5CDjXPavHDpDMjmU33BA2veHy6",
"derivedPath": "m/44'/0'/0'/0/0"
}
]
}Wallet API
BTC Balances
Get native BTC balances for a Bitcoin address or xpub. When an xpub is supplied, balances are aggregated across all derived addresses server-side.
GET
/
v1
/
wallets
/
{walletAddressOrPublicKey}
/
tokens
Get BTC balances for a Bitcoin address or xpub
curl --request GET \
--url https://api.moralis.com/v1/wallets/{walletAddressOrPublicKey}/tokens \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.moralis.com/v1/wallets/{walletAddressOrPublicKey}/tokens"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.moralis.com/v1/wallets/{walletAddressOrPublicKey}/tokens', 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.moralis.com/v1/wallets/{walletAddressOrPublicKey}/tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.moralis.com/v1/wallets/{walletAddressOrPublicKey}/tokens"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
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.moralis.com/v1/wallets/{walletAddressOrPublicKey}/tokens")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moralis.com/v1/wallets/{walletAddressOrPublicKey}/tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"meta": {
"syncedAt": {
"bitcoin": "latest"
},
"unsupportedChains": [],
"failedChains": []
},
"address": "0xcb1c1fde09f811b294172696404e88e658659905",
"addressType": "evm",
"cursor": "eyJhbGciOi...VCaaw",
"result": [
{
"tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"balanceRaw": "8541786218567066193031597821",
"chainId": "bitcoin",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 6,
"logo": "https://logo.moralis.io/0x1_0xdac17f958d2ee523a2206206994597c13d831ec7_3b83ef2ba0dba0e3385a845032e48304.webp",
"possibleSpam": false,
"verifiedContract": true,
"balance": "8541786218567066193031.597821",
"securityScore": 99,
"portfolioPercentage": 100,
"usdPrice": 1,
"usdPrice24hrUsdChange": 0,
"usdPrice24hrPercentChange": 0,
"usdValue": 1,
"usdValue24hrUsdChange": 0,
"nativeToken": false,
"derivedAddress": "1EfgV2Hr5CDjXPavHDpDMjmU33BA2veHy6",
"derivedPath": "m/44'/0'/0'/0/0"
}
]
}The
walletAddressOrPublicKey path parameter accepts either a Bitcoin address or an xpub — when an xpub is supplied, balances are aggregated across all derived addresses server-side.Address auto-detection: for a Bitcoin address or xpub, the
chains parameter is optional — Moralis detects the chain family from the address format. Passing chains=bitcoin explicitly still works.Path Parameters
Query Parameters
Response
200 - application/json

