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

Polygon API outage causes API requests to hang? #37

Closed
bdowling opened this issue Nov 18, 2018 · 2 comments
Closed

Polygon API outage causes API requests to hang? #37

bdowling opened this issue Nov 18, 2018 · 2 comments

Comments

@bdowling
Copy link
Contributor

This is my first time trying the polygon API, so I may be doing something wrong, but I think perhaps the API is under maintenance this evening, as https://api.polygon.io is returning:

Error
Application not found or under maintenance.

While in this state, attempting to use api.polygon appears to just hang, haven't dug into why:

import alpaca_trade_api as tradeapi
api = tradeapi.REST()
aapl = api.polygon.historic_agg('day', 'AAPL', limit=10).df

print(aapl)

(never returns)

@bdowling
Copy link
Contributor Author

bdowling commented Nov 18, 2018

This particular issue may be an odd issue on my dev system. I identified that I can make polygon requests from a web browser to the API, but from this particular opensuse dev system the request hang, even with wget/curl. Hard to debug exactly what is happening with the SSL, not sure if it is SSL related.

(edited) So this is odd, why am I seeing a self-signed cert from linux, but not in a chrome browser?

$ openssl s_client -quiet -host api.polygon.io -port 443
depth=0 O = Acme Co, CN = Kubernetes Ingress Controller Fake Certificate
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 O = Acme Co, CN = Kubernetes Ingress Controller Fake Certificate
verify error:num=21:unable to verify the first certificate
verify return:1
GET /v1/historic/quotes/AAPL/2018-2-2?apiKey=XXX HTTP/1.1
Host: api.polygon.io

^C

Above appears to hang when I specify my API key, but does return Invalid / Missing if I specify the wrong one. Also fails to return even if I add a limit=10.

@bdowling
Copy link
Contributor Author

I'm closing this. It appears the dev system I was having problems with will not connect with TLSv1.2 properly, which the polygon API appears to require. Additionally, -servername api.polygon.io is required for the s_client test to support the SNI of your frontend.

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

1 participant