atreadw1492 / yahoo_fin

Scrape stock price history from new (Spring 2017) Yahoo Finance layout
MIT License
292 stars 125 forks source link

get_quote_data() - Invalid response from server #107

Open pinnockm opened 1 year ago

pinnockm commented 1 year ago

It appears that the get_quote_data function from the stock_info module stopped working recently. Running it for any ticker yields the following AssertionError.

958 
    959     if not resp.ok:
--> 960         raise AssertionError("""Invalid response from server.  Check if ticker is
    961                               valid.""")
    962 

AssertionError: Invalid response from server.  Check if ticker is valid.

I'm thinking that this might be an issue with the Yahoo Finance API. Going through the yahoo_fin docs leads me to this endpoint https://query1.finance.yahoo.com/v7/finance/quote?symbols=NFLX. Which gives the following message.

{"finance":{"result":null,"error":{"code":"Unauthorized","description":"Invalid Crumb"}}}

Are there any work-arounds to this issue? Because get_quote_table doesn't give me the same amount of data that I was previously working with while using get_quote_data. Thanks

eriknh commented 1 year ago

Looks like Yahoo is moving to a paid model for Finance API access: https://docs.google.com/forms/d/e/1FAIpQLSeyb7xMtZFjoNYI7XG1rjlhUopKAxdLAfSRcaPxg9p-9ii-_g/viewform