Get user balances
curl --request GET \
--url https://tag.alfa-bot.com/api/prod/v1/user-balances \
--header 'token: <api-key>'import requests
url = "https://tag.alfa-bot.com/api/prod/v1/user-balances"
headers = {"token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {token: '<api-key>'}};
fetch('https://tag.alfa-bot.com/api/prod/v1/user-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://tag.alfa-bot.com/api/prod/v1/user-balances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"token: <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://tag.alfa-bot.com/api/prod/v1/user-balances"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("token", "<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://tag.alfa-bot.com/api/prod/v1/user-balances")
.header("token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://tag.alfa-bot.com/api/prod/v1/user-balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": "200",
"error_code": null,
"error_message": null,
"data": {
"user_id": "12345",
"balances": {
"accounting": {
"eth": {
"ETH": {
"available": 0
},
"USDC": {
"available": 0
}
},
"trx": {
"TRX": {
"available": 0
}
},
"trx_eth": {
"USDT": {
"available": 0,
"transit": 0,
"blockchain": 0
}
}
},
"user": {
"trx": {
"TRX": {
"available": 0
},
"USDT": {
"available": 0
}
}
}
},
"result": "success"
}
}Wallets & Balances
Get user balances
GET
/
user-balances
Get user balances
curl --request GET \
--url https://tag.alfa-bot.com/api/prod/v1/user-balances \
--header 'token: <api-key>'import requests
url = "https://tag.alfa-bot.com/api/prod/v1/user-balances"
headers = {"token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {token: '<api-key>'}};
fetch('https://tag.alfa-bot.com/api/prod/v1/user-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://tag.alfa-bot.com/api/prod/v1/user-balances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"token: <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://tag.alfa-bot.com/api/prod/v1/user-balances"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("token", "<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://tag.alfa-bot.com/api/prod/v1/user-balances")
.header("token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://tag.alfa-bot.com/api/prod/v1/user-balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": "200",
"error_code": null,
"error_message": null,
"data": {
"user_id": "12345",
"balances": {
"accounting": {
"eth": {
"ETH": {
"available": 0
},
"USDC": {
"available": 0
}
},
"trx": {
"TRX": {
"available": 0
}
},
"trx_eth": {
"USDT": {
"available": 0,
"transit": 0,
"blockchain": 0
}
}
},
"user": {
"trx": {
"TRX": {
"available": 0
},
"USDT": {
"available": 0
}
}
}
},
"result": "success"
}
}Authorizations
Pass your API token in the token request header.
Response
OK - user balances were returned successfully
⌘I