Hi all!
I am integrating binance api for an exchange service. And I had a problem with getting data for exchange pairs.
For example, such a pair returns the course:
https://api.binance.com/api/v3/ticker/price?symbol=BNBBTC
But it doesn’t work the other way around:
https://api.binance.com/api/v3/ticker/price?symbol=BTCBNB
(but on the website such conversion is available)
I also tried using the secret key from my account, that behavior is the same.
Tell me please. what is the problem?
GGy1005
September 27, 2022, 6:13am
2
Hi!
The endpoints mentioned are only showing you the price with the given symbol name and the 2nd one does not work, because there is no BTCBNB symbol on the exchange.
What exactly do you want the API to do? Maybe there is another endpoint for that task.
Kind regards
biba
October 3, 2022, 12:50pm
3
If I understand correctly, you want to get the amount of BNB that can be bought for 1 BTC. In this case, you can get data from
https://api.binance.com/api/v3/ticker/price?symbol=BNBBTC
and then divide 1 by the resulting value.