Get your cryptocurrency exchange balances
curl --request POST \
--url https://api.coinstats.app/v1/exchange/balance \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"connectionFields": {
"apiKey": "<your-exchange-api-key>",
"apiSecret": "<your-exchange-api-secret>"
},
"connectionId": "binance",
"name": "My Binance Portfolio"
}
'import requests
url = "https://api.coinstats.app/v1/exchange/balance"
payload = {
"connectionFields": {
"apiKey": "<your-exchange-api-key>",
"apiSecret": "<your-exchange-api-secret>"
},
"connectionId": "binance",
"name": "My Binance Portfolio"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connectionFields: {apiKey: '<your-exchange-api-key>', apiSecret: '<your-exchange-api-secret>'},
connectionId: 'binance',
name: 'My Binance Portfolio'
})
};
fetch('https://api.coinstats.app/v1/exchange/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.coinstats.app/v1/exchange/balance",
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([
'connectionFields' => [
'apiKey' => '<your-exchange-api-key>',
'apiSecret' => '<your-exchange-api-secret>'
],
'connectionId' => 'binance',
'name' => 'My Binance Portfolio'
]),
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.coinstats.app/v1/exchange/balance"
payload := strings.NewReader("{\n \"connectionFields\": {\n \"apiKey\": \"<your-exchange-api-key>\",\n \"apiSecret\": \"<your-exchange-api-secret>\"\n },\n \"connectionId\": \"binance\",\n \"name\": \"My Binance Portfolio\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.coinstats.app/v1/exchange/balance")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"connectionFields\": {\n \"apiKey\": \"<your-exchange-api-key>\",\n \"apiSecret\": \"<your-exchange-api-secret>\"\n },\n \"connectionId\": \"binance\",\n \"name\": \"My Binance Portfolio\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinstats.app/v1/exchange/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connectionFields\": {\n \"apiKey\": \"<your-exchange-api-key>\",\n \"apiSecret\": \"<your-exchange-api-secret>\"\n },\n \"connectionId\": \"binance\",\n \"name\": \"My Binance Portfolio\"\n}"
response = http.request(request)
puts response.read_body{
"balances": [
{
"coinId": "popcat",
"amount": 0.00342,
"price": 0.25946,
"priceBtc": 0.0000023571544854315866
}
],
"portfolio": {
"id": "618f0bb0f2cf07dce25bc5007750bf1646825509bb63519bd491ab6a56daa419",
"status": "syncing",
"connectionId": "bybit",
"name": "My Binance Portfolio"
}
}{
"statusCode": 400,
"message": "Bad Request",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 401,
"message": "Unauthorized",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 403,
"message": "Forbidden",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 404,
"message": "Not Found",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 409,
"message": "Transactions not synced",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 429,
"message": "Rate limit exceeded",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 503,
"message": "Service Unavailable. Please Contact Support"
}Exchange Connection
Get Exchange Balance
Get your cryptocurrency exchange balances
POST
/
v1
/
exchange
/
balance
Get your cryptocurrency exchange balances
curl --request POST \
--url https://api.coinstats.app/v1/exchange/balance \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"connectionFields": {
"apiKey": "<your-exchange-api-key>",
"apiSecret": "<your-exchange-api-secret>"
},
"connectionId": "binance",
"name": "My Binance Portfolio"
}
'import requests
url = "https://api.coinstats.app/v1/exchange/balance"
payload = {
"connectionFields": {
"apiKey": "<your-exchange-api-key>",
"apiSecret": "<your-exchange-api-secret>"
},
"connectionId": "binance",
"name": "My Binance Portfolio"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connectionFields: {apiKey: '<your-exchange-api-key>', apiSecret: '<your-exchange-api-secret>'},
connectionId: 'binance',
name: 'My Binance Portfolio'
})
};
fetch('https://api.coinstats.app/v1/exchange/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.coinstats.app/v1/exchange/balance",
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([
'connectionFields' => [
'apiKey' => '<your-exchange-api-key>',
'apiSecret' => '<your-exchange-api-secret>'
],
'connectionId' => 'binance',
'name' => 'My Binance Portfolio'
]),
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.coinstats.app/v1/exchange/balance"
payload := strings.NewReader("{\n \"connectionFields\": {\n \"apiKey\": \"<your-exchange-api-key>\",\n \"apiSecret\": \"<your-exchange-api-secret>\"\n },\n \"connectionId\": \"binance\",\n \"name\": \"My Binance Portfolio\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.coinstats.app/v1/exchange/balance")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"connectionFields\": {\n \"apiKey\": \"<your-exchange-api-key>\",\n \"apiSecret\": \"<your-exchange-api-secret>\"\n },\n \"connectionId\": \"binance\",\n \"name\": \"My Binance Portfolio\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinstats.app/v1/exchange/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connectionFields\": {\n \"apiKey\": \"<your-exchange-api-key>\",\n \"apiSecret\": \"<your-exchange-api-secret>\"\n },\n \"connectionId\": \"binance\",\n \"name\": \"My Binance Portfolio\"\n}"
response = http.request(request)
puts response.read_body{
"balances": [
{
"coinId": "popcat",
"amount": 0.00342,
"price": 0.25946,
"priceBtc": 0.0000023571544854315866
}
],
"portfolio": {
"id": "618f0bb0f2cf07dce25bc5007750bf1646825509bb63519bd491ab6a56daa419",
"status": "syncing",
"connectionId": "bybit",
"name": "My Binance Portfolio"
}
}{
"statusCode": 400,
"message": "Bad Request",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 401,
"message": "Unauthorized",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 403,
"message": "Forbidden",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 404,
"message": "Not Found",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 409,
"message": "Transactions not synced",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 429,
"message": "Rate limit exceeded",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 503,
"message": "Service Unavailable. Please Contact Support"
}10 credits per request
You will get
You will get
- Real-time balance information
- All coins and tokens in your account
- Current value in USD and BTC
- Available and locked amounts
Required
Required
- connectionId: Exchange identifier (e.g., “binance”, “coinbase”)
- connectionFields: Exchange API credentials
- apiKey: Your exchange API key
- apiSecret: Your exchange API secret
Optional
Optional
- name: Custom name for the portfolio
Security Note
Security Note
- Use read-only API keys when possible
- Keep your API credentials secure
- Enable IP restrictions on exchange side
Authorizations
API key required to access the endpoints. Generate one from your dashboard at https://openapi.coinstats.app and pass it in the X-API-KEY request header. Never expose your key in client-side code.
Body
application/json
Authentication credentials required to connect to the exchange. This object should contain the API key, secret, and any additional authentication fields from Exchanges request
Show child attributes
Show child attributes
Example:
{
"apiKey": "<your-exchange-api-key>",
"apiSecret": "<your-exchange-api-secret>"
}
The connectionId for the cryptocurrency exchange platform from Exchanges request
Example:
"binance"
Name for the portfolio
Example:
"My Binance Portfolio"
Was this page helpful?
⌘I