-
Notifications
You must be signed in to change notification settings - Fork 732
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
Authenticated Client Will Sometimes Fail When Placing Order - JSON Error? #225
Comments
I've also run into this problem when making various requests to the API and it's quite frustrating. I thought that the thread #231 gave a nice answer. |
Thanks for the heads up. I actually decided to just connect to the API using requests package instead. It's still a bit buggy but is way less error-prone then this package, though it does take a bit more work. |
Hi stefanlopez, I appreciate you raising this point. Please can you provide some example code for placing orders with the requests package? Did you have this same issue with other API requests? Many thanks. |
Check out this link: https://cryptostag.com/basic-gdax-api-trading-with-python/ Ultimately whichever route you go down, you will need error handling whenever you connect to the GDAX api, so that should be your biggest focus moving forward. |
Thanks a lot stefanlopez. That's much appreciated. Out of interest, have you experimented with ccxt (https://github.com/ccxt/ccxt) ? It looks like a reliable alternative. |
Please follow PR #260 for error handling coming soon. |
I cannot replicate this error but it happens randomly when I am connecting to api via authenticated client, perhaps a couple times a day. I have run this code on my local computer and on a remote server and so far it has only occurred on the remote server, don't know if that matters or not. Here is the relevant traceback, the first line being my sell order:
File "/usr/local/lib/python3.4/site-packages/gdax/authenticated_client.py", line 80, in sell
return r.json()
File "/usr/local/lib/python3.4/site-packages/requests/models.py", line 866, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python3.4/json/init.py", line 318, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.4/json/decoder.py", line 343, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.4/json/decoder.py", line 361, in raw_decode
raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 1 column 1 (char 0)
The text was updated successfully, but these errors were encountered: