pilwon / node-yahoo-finance

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

Doesn't seem to work anymore #36

Closed Tarang closed 7 years ago

Tarang commented 7 years ago

The underlying URL seems to have changed today & the library returns no results instead of an expected error (this is an issue too):

var yahooFinance = require('yahoo-finance');

yahooFinance.historical({
  symbol: 'AAPL',
  from: '2015-01-01',
  to: '2015-01-02'
}, function (err, quotes) {

  console.log(quotes);

});

Returns []

The underlying URL gives an error too:

https://chart.finance.yahoo.com/table.csv?s=AAPL
sarjarapu commented 7 years ago

agreed! Looks like they changed the url about 6 hours ago; not sure where they are getting the crumb from. I tried curl on webpage and make use of the crumb from cookie, it didn't work

https://www.elitetrader.com/et/threads/yahoo-historical-data-did-they-change-the-url-recently.309554/#post-4457665

nemozny commented 7 years ago

I confirm.

gadicc commented 7 years ago

See above PR. Not 100% sure when I'll have time to finish it but hopefully within the next week. Comments welcome and appreciated. historical() is working. Haven't looked at snapshot() yet. Needs some more work for cache invalidation and resiliency.

On another note, @Tarang, @pilwon, hey guys, long time :)

gadicc commented 7 years ago

Oh, and @pilwon, I'd like to add some tests, are you ok with that? Do you have any preferences for test runtime? mocha, chai/should, sinon, all ok? Would you prefer it as a separate PR?

Lastly, do you have any views on upgrading to ES7 and shipping via babel?

seanlindo commented 7 years ago

If you need something sooner rather than later, I found Google Finance to be a drop-in replacement. Same API, same author, just replaced the import statement.

gadicc commented 7 years ago

@seanlindo, just note though that Google doesn't let you download historical data for all exchanges. You can see that even on the user facing page, e.g. NASDAQ:TSLA (see Export option under the chart) vs HKG:0700 (no such option). It's actually why I switched from node-google-finance to node-yahoo-finance.

pilwon commented 7 years ago

Follow the discussions on #37 and #41.