Add support for binance.us.
binance-python currently doesn't provide a way to configure API endpoints. I don't know if it is just a matter of making that configurable or there is more to it to start supporting binance.US
I totally agree. any support for binance.us?
Do we need to change more than this file (https://github.com/sammchardy/python-binance/blob/master/binance/client.py)?
i have made some changes and got it working. I will raise a PR soon.
Joshith lets see it!
@joshith @NSSmithPortfolio @jiwoongim
Looks like #470 resolves this if/when it gets merged.
A workaround is to update the client's API URLs for each client instance or directly editing the file as @jiwoongim suggested :
binance_conn = Client(API_KEY, API_SECRET)
binance_conn.API_URL = 'https://api.binance.us/api'
binance_conn.WITHDRAW_API_URL = 'https://api.binance.us/wapi'
binance_conn.MARGIN_API_URL = 'https://api.binance.us/sapi'
binance_conn.WEBSITE_URL = 'https://www.binance.us'
@joshith @NSSmithPortfolio @jiwoongim
Looks like #470 resolves this if/when it gets merged.A workaround is to update the client's API URLs for each client instance or directly editing the file as @jiwoongim suggested :
binance_conn = Client(API_KEY, API_SECRET) binance_conn.API_URL = 'https://api.binance.us/api' binance_conn.WITHDRAW_API_URL = 'https://api.binance.us/wapi' binance_conn.MARGIN_API_URL = 'https://api.binance.us/sapi' binance_conn.WEBSITE_URL = 'https://www.binance.us'This resets only the urls for REST API!
If you guys need websockets on binanace.us you can use:
https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
you update the initialization parameter as follows
client = Client("key", "secret",tld="us")
you update the initialization parameter as follows
client = Client("key", "secret",tld="us")
This does not work. You get multiple errors when looking up ticker prices or retrieving account status.
@ZENALC I dunno, worked for me. Sure you got the latest version of code? And need a space in the above quoted text if you directly copy/pasted.
Mine: client = Client(pub, sec, tld='us')
@ZENALC I dunno, worked for me. Sure you got the latest version of code? And need a space in the above quoted text if you directly copy/pasted.
Mine: client = Client(pub, sec, tld='us')
The space does not matter. I am running the latest version of the code, but if you try to get the latest price ticker or retrieve account status, the code will not work.
Tested ->
client = Client(MB_TAPI_ID, MB_TAPI_SECRET, tld="us")
info = client.get_account()
<- now and it works, I guess it got fixed?
@ZENALC I dunno, worked for me. Sure you got the latest version of code? And need a space in the above quoted text if you directly copy/pasted.
Mine: client = Client(pub, sec, tld='us')The space does not matter. I am running the latest version of the code, but if you try to get the latest price ticker or retrieve account status, the code will not work.