Get balances Binance Exchange PHP

Gerson Morales
Sep 2, 2018 · 1 min read

Binance is a cryptocurrency exchange that offers an api to obtain information about the status of our account, there is also the possibility of making requests to trade within its platform. The documentation can be found at https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md.

In this opportunity we will check the balances of an account using php.
Following the documentation we will use GET /api/v3/account (HMAC SHA256), request that returns a json with the information of the account and the balance sheets.

We will use two files:

Response

{
"makerCommission": 15,
"takerCommission": 15,
"buyerCommission": 0,
"sellerCommission": 0,
"canTrade": true,
"canWithdraw": true,
"canDeposit": true,
"updateTime": 123456789,
"balances": [
{
"asset": "BTC",
"free": "4723846.89208129",
"locked": "0.00000000"
},
{
"asset": "LTC",
"free": "4763368.68006011",
"locked": "0.00000000"
}
]
}

I only write about programming and technology. I’m in linkedin.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade