http-status-code-401yfinanceunauthorized

Is there a way around the yfinance Ticker method returning that I'm not authorized?


yfinance.Ticker (version 0.2.22) was working for my well for the past 2 months:

    hndl = yf.Ticker(symb)
    info = hndl.info

Today it fails immediately - returning:

HTTPError: 401 Client Error: Unauthorized for url: https://query2.finance.yahoo.com/v10/finance/quoteSummary/AAGIY?modules=summaryProfile%2CfinancialData%2CquoteType%2CdefaultKeyStatistics%2CassetProfile%2CsummaryDetail&ssl=true

Linked page shows:

enter image description here

I note that this has been a recurrent problem over the years. Is there anticipated to be a solution? Or, better to explore alternative ways of getting market data?

TIA


Solution

  • Try upgrading yfinance: pip install --upgrade yfinance