Closed Courvoisier13 closed 1 year ago
I don't know how to do this. It doesn't look like it's returned by the quote API. You can hit the API in your browser: https://query1.finance.yahoo.com/v7/finance/quote?symbols=SPY&fields=annualReportExpenseRatio
Here's the result:
{
"quoteResponse": {
"error": null,
"result": [
{
"esgPopulated": false,
"exchange": "PCX",
"exchangeDataDelayedBy": 0,
"exchangeTimezoneName": "America/New_York",
"exchangeTimezoneShortName": "EDT",
"firstTradeDateMilliseconds": 728317800000,
"fullExchangeName": "NYSEArca",
"gmtOffSetMilliseconds": -14400000,
"language": "en-US",
"market": "us_market",
"marketState": "CLOSED",
"priceHint": 2,
"quoteSourceName": "Delayed Quote",
"quoteType": "ETF",
"region": "US",
"sourceInterval": 15,
"symbol": "SPY",
"tradeable": false,
"triggerable": true
}
]
}
}
Ah I see. Where can I see the endpoints of this API? I went on Rapid API and found that it is on get-profile
endpoint. But that is a different API to the one you use.
Description
For a fund or ETF, SPY for example: I would like to add the Expense Ratio (net) (under Summary) or Annual Report Expense Ratio (net) (under profile) to the list of fields that can be scraped. Using my best guess and looking at the html, I added
to the end of the variable
.yahooQuoteFields
in the filegetQuote.R
. After building the package and try it out, unfortunately I get the following error:Is it possible to get some help on rules for
.yahooQuoteFields
and is it possible to add new fields to extract new info?Expected behavior
I expect to get the expense ratio for a fund, SPY for example.
Minimal, reproducible example
Session Info