Get balance
curl --request GET \
--url https://api.onswitch.xyz/wallet/{wallet_id}/balance \
--header 'x-service-key: <api-key>'import requests
url = "https://api.onswitch.xyz/wallet/{wallet_id}/balance"
headers = {"x-service-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-service-key': '<api-key>'}};
fetch('https://api.onswitch.xyz/wallet/{wallet_id}/balance', 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.onswitch.xyz/wallet/{wallet_id}/balance",
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-service-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.onswitch.xyz/wallet/{wallet_id}/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-service-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.onswitch.xyz/wallet/{wallet_id}/balance")
.header("x-service-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onswitch.xyz/wallet/{wallet_id}/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-service-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Wallet balance fetched successfully",
"timestamp": "2026-04-18T14:22:08.631Z",
"data": {
"balance": 150.5,
"balance_in_usd": 150.5,
"breakdown": [
{
"id": "base:usdc",
"balance": 100,
"balance_in_usd": 100
},
{
"id": "solana:usdc",
"balance": 50.5,
"balance_in_usd": 50.5
}
]
}
}{
"success": false,
"message": "amount must be greater than 0 for the selected corridor",
"timestamp": "2026-04-18T14:22:08.631Z",
"data": null
}Get balance
Get unified spendable wallet balance and breakdown by chain.
GET
/
wallet
/
{wallet_id}
/
balance
Get balance
curl --request GET \
--url https://api.onswitch.xyz/wallet/{wallet_id}/balance \
--header 'x-service-key: <api-key>'import requests
url = "https://api.onswitch.xyz/wallet/{wallet_id}/balance"
headers = {"x-service-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-service-key': '<api-key>'}};
fetch('https://api.onswitch.xyz/wallet/{wallet_id}/balance', 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.onswitch.xyz/wallet/{wallet_id}/balance",
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-service-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.onswitch.xyz/wallet/{wallet_id}/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-service-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.onswitch.xyz/wallet/{wallet_id}/balance")
.header("x-service-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onswitch.xyz/wallet/{wallet_id}/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-service-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Wallet balance fetched successfully",
"timestamp": "2026-04-18T14:22:08.631Z",
"data": {
"balance": 150.5,
"balance_in_usd": 150.5,
"breakdown": [
{
"id": "base:usdc",
"balance": 100,
"balance_in_usd": 100
},
{
"id": "solana:usdc",
"balance": 50.5,
"balance_in_usd": 50.5
}
]
}
}{
"success": false,
"message": "amount must be greater than 0 for the selected corridor",
"timestamp": "2026-04-18T14:22:08.631Z",
"data": null
}Authorizations
Service key for API authentication
Path Parameters
Unique identifier for the wallet
Pattern:
^[a-f0-9]{24}$Response
Balance retrieved successfully
⌘I