Open Bob12345 opened 3 years ago
Let me put it this way: is anyone reading this able to trade USD on Binance.US using this API or any other API?
I am having similar issue as you, you won't find BNBUSD listed when querying ExchangeInfo, however you can find it via Binance web, I'm not sure why. I'm finding similar case with other *USD cryptos. I was also looking at Bitsgap and was able to connect Binance exchange via API integrations, and there they had no problem pulling that info from Binance via API, I dont know how
found solution, by default its using Binance.com exchange, if you want to use .us pass this to client: client = Client(api_key, api_secret, tld='us')
found solution, by default its using Binance.com exchange, if you want to use .us pass this to client: client = Client(api_key, api_secret, tld='us')
I've been using tld='us' all along, because I only trade on .US now.
@gitsmash thank you sir. was getting api authentication issues for hours
@Bob12345 I have the same issue and I have also been using tld='us'. Does anyone know if this is an issue with the python-binance client library or with the binance.us API?
Alright, I found the solution to get sockets for USD pairs on binance.us:
client = Client(api_key, api_secret, tld='us')
socket_manager = BinanceSocketManager(client)
socket_manager.STREAM_URL = 'wss://stream.binance.us:9443/
...
I tried out a different binance python client (unicorn-binance-websocket-api
) and saw that it was correctly returning USD pair sockets. So after looking at the source code for python-binance
I realized that setting tld
in the Client
does not carry over to the BinanceSocketManager
. So one must do it manually.
Alright, I found the solution to get sockets for USD pairs on binance.us:
client = Client(api_key, api_secret, tld='us') socket_manager = BinanceSocketManager(client) socket_manager.STREAM_URL = 'wss://stream.binance.us:9443/ ...
I tried out a different binance python client (
unicorn-binance-websocket-api
) and saw that it was correctly returning USD pair sockets. So after looking at the source code forpython-binance
I realized that settingtld
in theClient
does not carry over to theBinanceSocketManager
. So one must do it manually.
Fantastic, that worked!!!! Thank you very much.
Describe the bug I do get the historical klines but the interval updates are not working -- complete silence conn_key = bm.start_kline_socket(pair, process_message, interval=my_interval)
To Reproduce use "BNBUSD" as your pair, 1 minute interval conn_key = bm.start_kline_socket(pair, process_message, interval=my_interval)
Expected behavior I should be getting inteval klines as with all the non-USD pairs
Environment (please complete the following information):
Logs or Additional context no logs, no errors.
Thanks! P.S. I'm fully verified for trading by Binance.US and can trade -USD pairs on Binance.US manually. My non-USD pairs work with python-binance just fine.