Yahoo Finance cannot get historical data in ruby โ€‹โ€‹after API change

My apps pull historical data from yahoo finance using HTTParty.get in ruby โ€‹โ€‹on rails.

previously i used the following url

data_source = "http://chart.finance.yahoo.com/table.csv?s=#{ticker}&a=5&b=15&c=2001&d=#{end_date.month - 1}&e=#{end_date.day}&f=#{end_date.year}&g=1d&ignore=.csv"

      

I found that it hasn't been working since a couple of days and haven't found an error. So I checked Yahoo finances and updated it accordingly.

data_source = "https://query1.finance.yahoo.com/v7/finance/download/#{ticker}?period1=#{start_date}&period2=#{end_date}&interval=1d&events=history&crumb=.zG6G1yJSmP"

      

I am getting an unauthorized error after updating. Can anyone help me with this.

Hello,

Sreeraj

+3


source to share





All Articles