Get Account Balance

Retrieve all cash balances.

For all transactions related to the private endpoint, you must authorize before sending your request.

For more information you can check our Authentication V1 article.

All asset information can be viewed with the Account Balance endpoint.

You can use the /api/v1/users/balances enpoint for account balance information.

Response

{
    "data": [
        {
            "asset": "TRY",
            "assetname": "Türk Lirası",
            "balance": "27223,7283250757643288",
            "locked": "4874,3628685722294523",
            "free": "22349,3654565035348765",
            "orderFund": "4874,3628685722294523",
            "requestFund": "0",
            "precision": 2
        },
        {
            "asset": "BTC",
            "assetname": "Bitcoin",
            "balance": "9,7502186644553258",
            "locked": "3,3109771999999998",
            "free": "6,439241464455326",
            "orderFund": "3,3109771999999998",
            "requestFund": "0",
            "precision": 8
        },
    ...
  ],
  "success": true,
  "message": null,
  "code": 0
}

Get Account Balance

GET https://api.btcturk.com/api/v1/users/balances

Headers

NameTypeDescription

X-PCK*

string

API public key. You can create the API key from the Account > API Access page in your exchange account.

X-Stamp*

integer

Nonce must be current timestamp in milliseconds. It is a must to sync your current time with API server time which is in miliseconds format. Our servers are using UTC timezone.

X-Signature*

string

Signature is a HMAC-SHA256 encoded message. The HMAC-SHA256 code must be generated using a private key that contains a timestamp as nonce and your API key.

{
    "data": [
        {
            "asset": "TRY",
            "assetname": "Türk Lirası",
            "balance": "27223,7283250757643288",
            "locked": "4874,3628685722294523",
            "free": "22349,3654565035348765",
            "orderFund": "4874,3628685722294523",
            "requestFund": "0",
            "precision": 2
        },
        {
            "asset": "BTC",
            "assetname": "Bitcoin",
            "balance": "9,7502186644553258",
            "locked": "3,3109771999999998",
            "free": "6,439241464455326",
            "orderFund": "3,3109771999999998",
            "requestFund": "0",
            "precision": 8
        },
    ...
  ],
  "success": true,
  "message": null,
  "code": 0
}

Account Balance Code Example

// You can download ApiClient .net core complete library from github https://github.com/BTCTrader/broker-api-csharp-v2

var configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();

var publicKey = configuration["publicKey"];
var privateKey = configuration["privateKey"];
var resourceUrl = configuration["resourceUrl"];
var apiClientV1 = new ApiClientV1(publicKey, privateKey, resourceUrl);

 var balances = apiClientV1.GetBalances();

if (balances.Result != null && balances.Result.Success)
{
    foreach (var balance in balances.Result.Data)
    {
        Console.WriteLine(balance.ToString());
    }
}

Last updated