quantmod icon indicating copy to clipboard operation
quantmod copied to clipboard

add support for Tiingo financial statements API

Open ethanbsmith opened this issue 4 years ago • 9 comments

@tiingo is working on a financial statement API: https://api.tiingo.com/documentation/fundamentals

I think we should support this through the getFinancials function (which currently has no live implementations)

I'll get started on a PR, unless there are any objections

ethanbsmith avatar Mar 02 '20 15:03 ethanbsmith

Thanks for suggesting this! I 100% agree with adding it. My only recommendation is that we wait until it's out of beta before including it in a quantmod release. Feel free to start coding and testing though!

joshuaulrich avatar Mar 03 '20 11:03 joshuaulrich

Apologies to all. I have not had a chance to work on this and it just keeps getting bumped down in priority for me. I do hope to get to it at some point, but probably will not be for a good while longer

ethanbsmith avatar Apr 06 '21 23:04 ethanbsmith

No need to apologize! I mentioned this in 327 because it's an example of what needs to be done for getFinancials() to start working again.

joshuaulrich avatar Apr 06 '21 23:04 joshuaulrich

primitive baseline initial functionality. still very much a WIP. feedback welcome: https://github.com/ethanbsmith/quantmod/tree/301_tiingo_financial_statements

ethanbsmith avatar Dec 26 '21 01:12 ethanbsmith

Hi @tiingo, we have a working version of this. is this financial statement API still considered to be beta?

ethanbsmith avatar Dec 26 '21 17:12 ethanbsmith

ran into an issue today while and want to log it for posterity:

for Symbol SOFI, notice that items 3 is missing a cashFlow, and items 6 and 7 are missing a balanceSheet. Since the structure is irregular, you cannot use simplifyDataFrame = TRUE in jsonlite::fromJSON (which is the default).

image

ethanbsmith avatar Jan 16 '22 17:01 ethanbsmith

Thanks for the report Ethan!

@tiingo, is this expected behavior? Would it be possible to make the JSON always have the same fields, even if they're empty/null?

joshuaulrich avatar Jan 16 '22 17:01 joshuaulrich

fyi, already reached out to them. also, i realized the API supports CSV format, which is considerably easier to deal with

ethanbsmith avatar Jan 16 '22 18:01 ethanbsmith

Response from tiingo: "In general, pro forma statements issued by companies (statements a company issued prior to their IPO), are often incomplete. For pro forma statements, you can expect missing balance/income/cash flow statements". in this case, SOFI listed on 2020-11-30

needed changes have been pushed: https://github.com/ethanbsmith/quantmod/blob/301_tiingo_financial_statements/R/getFinancials.R

ethanbsmith avatar Jan 16 '22 20:01 ethanbsmith