Ljupch0 / yfinance

Tidy Financial Statement Data in R. Via the Yahoo Finance API.
31 stars 7 forks source link

Yahoo Finance API issue #12

Open cjtexas opened 1 year ago

cjtexas commented 1 year ago

I'm experiencing what seems to be an issue with the Yahoo Finance Endpoint behind get_price() :

> yfinance::get_price("SPY")
# A tibble: 0 x 0
Warning messages:
1: In open.connection(con, "rb") :
  cannot open URL 'https://query2.finance.yahoo.com/v10/finance/quoteSummary/SPY?modules=price': HTTP status was '401 Unauthorized'
2: In safe_download(vector = ticker, proto_function = get_price_proto) :
  There were ERRORS while downloading data for these items: SPY.
Please check if you have the correct ticker. The vector of errored items and error messages can be accessed as attributes of the returned dataframe - attributes(df).

It seems like quantmod package authors have dealt with** a very similar issue in a certain way (although it is with a different endpoint and API version etc...)

**https://github.com/joshuaulrich/quantmod/pull/383/files/554af1b9f35bff83afb700f1f98281be785e56d3

Ljupch0 commented 1 year ago

Do you know an API endpoint that works? If we find an alternative one it should be relatively straightforward, as the json parsing are separate functions.