Get Wallet Balance
curl --request GET \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/balanceimport requests
url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/balance"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{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.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{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",
]);
$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.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/balance"
req, _ := http.NewRequest("GET", url, nil)
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.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/balance")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"balance": {
"symbol": "BTC",
"amount": "109.42",
"holds": "2",
"bonded_amount": "109.42",
"reserved_amount": "109.42",
"unbonding_amount": "109.42",
"unvested_amount": "109.42",
"pending_rewards_amount": "109.42",
"past_rewards_amount": "109.42",
"bondable_amount": "109.42",
"withdrawable_amount": "109.42",
"fiat_amount": "109.42",
"unbondable_amount": "109.42",
"claimable_rewards_amount": "0.241437903"
}
}Balances
Get Wallet Balance
Query balance for a specific wallet.
GET
/
v1
/
portfolios
/
{portfolio_id}
/
wallets
/
{wallet_id}
/
balance
Get Wallet Balance
curl --request GET \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/balanceimport requests
url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/balance"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{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.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{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",
]);
$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.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/balance"
req, _ := http.NewRequest("GET", url, nil)
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.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/balance")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"balance": {
"symbol": "BTC",
"amount": "109.42",
"holds": "2",
"bonded_amount": "109.42",
"reserved_amount": "109.42",
"unbonding_amount": "109.42",
"unvested_amount": "109.42",
"pending_rewards_amount": "109.42",
"past_rewards_amount": "109.42",
"bondable_amount": "109.42",
"withdrawable_amount": "109.42",
"fiat_amount": "109.42",
"unbondable_amount": "109.42",
"claimable_rewards_amount": "0.241437903"
}
}Use the Prime SDK or CLI to test this endpoint by following the quickstart guide and running with the following examples
For more information, please visit the Prime Java SDK.For more information, please visit the Prime .NET SDK.For more information, please visit the Prime Go SDK.For more information, please visit the Prime Python SDK.For more information, please visit the Prime CLI.For more information, please visit the Prime TS SDK.
- Java
- .NET
- Go
- Python
- CLI
- TS/JS
BalancesService balancesService = PrimeServiceFactory.createBalancesService(client);
GetWalletBalanceRequest request = new GetWalletBalanceRequest.Builder()
.portfolioId("PORTFOLIO_ID_HERE")
.walletId("WALLET_ID_HERE")
.build();
GetWalletBalanceResponse response = balancesService.getWalletBalance(request);
var balancesService = new BalancesService(client);
var request = new GetWalletBalanceRequest("PORTFOLIO_ID_HERE", "WALLET_ID_HERE");
var response = balancesService.GetWalletBalance(request);
balancesService := balances.NewBalancesService(client)
request := &balances.GetWalletBalance{
PortfolioId: "PORTFOLIO_ID_HERE",
WalletId: "WALLET_ID_HERE",
}
response, err := balancesService.GetWalletBalance(context.Background(), request)
prime_client = PrimeClient(credentials)
request = GetWalletBalanceRequest(
portfolio_id="PORTFOLIO_ID_HERE",
wallet_id="WALLET_ID_HERE",
)
response = prime_client.get_wallet_balance(request)
primectl get-wallet-balance --help
const balancesService = new BalancesService(client);
balancesService.getWalletBalance({
portfolioId: 'PORTFOLIO_ID_HERE',
walletId: 'WALLET_ID_HERE'
}).then(async (response) => {
console.log('Balances: ', response);
})
Was this page helpful?
⌘I