I am encountering an error when attempting to download historical data for any stock symbol from Yahoo Finance. For instance, when requesting data for the symbol AAPL, the request is made to the following URL:
https://query2.finance.yahoo.com/v7/finance/download/AAPL?period1=1735599600&period2=1735686000&interval=1d&events=history
The response received is:
Error fetching data for symbol AAPL: Client error: GET https://query2.finance.yahoo.com/v7/finance/download/AAPL?period1=1735599600&period2=1735686000&interval=1d&events=history` resulted in a 401 Unauthorized response: {"finance":{"result":null,"error":{"code":"unauthorized","description":"User is not logged in"}}}
`
An alternative url could be:
https://query2.finance.yahoo.com/v8/finance/chart/AAPL?period1=1735599600&period2=1735686000&interval=1d&events=history
I am encountering an error when attempting to download historical data for any stock symbol from Yahoo Finance. For instance, when requesting data for the symbol AAPL, the request is made to the following URL:
https://query2.finance.yahoo.com/v7/finance/download/AAPL?period1=1735599600&period2=1735686000&interval=1d&events=historyThe response received is:
Error fetching data for symbol AAPL: Client error:GET https://query2.finance.yahoo.com/v7/finance/download/AAPL?period1=1735599600&period2=1735686000&interval=1d&events=history` resulted in a401 Unauthorizedresponse: {"finance":{"result":null,"error":{"code":"unauthorized","description":"User is not logged in"}}}`
An alternative url could be:
https://query2.finance.yahoo.com/v8/finance/chart/AAPL?period1=1735599600&period2=1735686000&interval=1d&events=history