Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for binance.us #453

Closed
wolfinch opened this issue Nov 14, 2019 · 10 comments
Closed

add support for binance.us #453

wolfinch opened this issue Nov 14, 2019 · 10 comments

Comments

@wolfinch
Copy link

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

@jiwoongim
Copy link

jiwoongim commented Nov 19, 2019

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)?

@wolfinch
Copy link
Author

i have made some changes and got it working. I will raise a PR soon.

@NSSmithPortfolio
Copy link

Joshith lets see it!

@Taur1ne
Copy link

Taur1ne commented Jan 27, 2020

@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'

@oliver-zehentleitner
Copy link
Contributor

@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

@shawnzhan
Copy link

you update the initialization parameter as follows
client = Client("key", "secret",tld="us")

@ZENALC
Copy link

ZENALC commented Sep 8, 2020

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.

@NSSmithPortfolio
Copy link

@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
Copy link

ZENALC commented Sep 8, 2020

@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.

@rafgehrke1
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants