-
Notifications
You must be signed in to change notification settings - Fork 5
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
Ally Invest returning HTML with response.ok #4
Comments
Hi, thanks for submitting this issue. First and foremost, I'm 100% OK with Pull Requests (apologies in advance if I don't get to them right away) I would really like to see this project grow and develop into something highly applicable. As for the error, I believe I have seen this before. If I recall correctly, in my case Ally was throttling my API calls since I was submitting too many requests or something along those lines (I could be wrong as it's been a while). Do you know what errors you're getting in the HTML are? From this project's perspective, I don't think there's much we can do besides check if we're getting JSON back and return an error (and the HTML) if not since it's unpredictable what Ally might send back from a request. |
So with the HTML, the contents are the "Site is experiencing issues" page that shows up if you go to Ally Invest with an internet browser and things are down. I reported it to them a while back because it wasn't JSON, and got the typical "We'll look into it" without follow-up. I agree the only thing we can do is a check to make sure that it's in JSON format, even if it's just a try/except on JSONDecodeError. They did do some adjustments over the weekend (probably from all the API call rejections happening last week, even the first request), so I want to see if the issue is OBE before making any changes. I know there's a 60 call per minute limit. Also, on my interpretation, I'm using another source for prices because it's real-time, whereas Ally is on the delay. It's Yahoo so who knows what will happen; I still remember the whole debacle about people figuring out what the letter codes meant for the quote URL calls, and they went crazy and destroyed everything. |
I have been noticing an issue with the return of JSON data with Ally. Be aware I've been running a home-brew API, but noticed your code would return the same issue, so I'm adding it to help out.
Lately, I have been receiving intermittent responses from Ally where the status_code is 200, but the content is HTML webpage code stating an error on their end, instead of JSON stating something similar. As a result, when attempting to run response.json(), I get the following traceback in a 500 error:
See if something similar is happening to you; I'd love to collaborate with you on this.
AllyInvest.py/ally/ally.py
Line 122 in e3824e7
Also as an aside (but unrelated), let me know if you're OK with pull requests on this code, as my work has done some things with orders and order previews; I'm in the process of making something for orders POST to automate trades, but this issue has been slowing my progress.
The text was updated successfully, but these errors were encountered: