pilwon / node-yahoo-finance

Yahoo Finance historical quotes and snapshot data downloader written in Node.js
495 stars 123 forks source link

General Yahoo instability since 2018-04-18 #60

Open gadicc opened 6 years ago

gadicc commented 6 years ago

On 2018-04-18, Yahoo integrated further into the Oauth platform. You probably saw a new consent screen when going to yahoo-finance in your browser. There have been other changes too, including some general instability. We'll track them here and see what develops.

Error: Failed to download data (Error: socket hang up)

Probably due to the consent screen redirect mentioned above.

GET https://finance.yahoo.com/quote/FB?p=FB
307 to https://guce.yahoo.com/consent?brandType=nonEu&gcrumb=XXXXXXX&done=https%3A%2F%2Ffinance.yahoo.com%2Fquote%2FFB%3Fp%3DFB
Set-Cookie: GUC=XXX&s=XXX&g=XXX; Expires=Fri, 19 Apr 2019 00:05:00 GMT; Domain=yahoo.com; Path=/; Secure
302 back to https://finance.yahoo.com/quote/FB?p=FB

Seems to be working again without any changes on our side. Let's wait and see.

Error: Failed to download data (404 - {"quoteSummary":{"result":null,"error":{"code":"Not Found","description":"Quote not found for ticker symbol: SPY"}}})

General instability, totally random. E.g. at time of writing, the MA and SPY quote lookup may return the correct results, or not be found at all. You can keep refreshing and continually observe both behaviours. Probably a stale cache entry on one of their load balanced nodes when not all the data was available yet.

root.Api.main context.dispatcher.stores.CrumbStore.crumb structure no longer exists, please open an issue.

I think this happens when your first request hits an "invalid" symbol as per the issue above. Retry on a symbol that's known to always work, or just retry again on the same symbol a bit later.