Can anyone speak to the reliability of the Alpha Vantage (AV) api for fundamental stock data? I have tried for a couple of stocks to get balance sheet data, and it seems close to accurate but I feel like I either don't clearly understand the data dictionary or it is unreliable.
Here is a sample code to pull balance sheet data for XOM using R:
library(tidyverse)
library(httr)
library(jsonlite)
library(lubridate)
# Download Data ------------------------------------------------------------
my_api_key <- 'my_api_key'
url <- 'https://www.alphavantage.co/query?'
query <- list('function' = 'BALANCE_SHEET',
symbol = 'XOM',
apikey = my_api_key)
r <- GET(url = url,
query = query,
accept_json())
j <- content(r, type = 'text', encoding = 'UTF-8')
d <- fromJSON(j)
# Clean the data ----------------------------------------------------------
bs_quarterly <- d[[3]]
bs_quarterly <- tibble(bs_quarterly)
bs_quarterly <-
bs_quarterly %>%
mutate(fiscalDateEnding = ymd(fiscalDateEnding)) %>%
mutate_at(.vars = -(1:2), .f = as.numeric)
# Review the data ---------------------------------------------------------
bs_quarterly %>%
filter(fiscalDateEnding %in%
ymd(c('2020-12-31', '2019-12-31'))) %>%
select(fiscalDateEnding,
currentDebt,
shortTermDebt,
longTermDebt,
shortLongTermDebtTotal)
Here is the output from that code:
Now if I go to the sec.gov website and look at the XOM 10-K report at this site: https://www.sec.gov/ix?doc=/Archives/edgar/data/34088/000003408821000012/xom-20201231.htm
This is what I see from the balance sheet (column 1 is 2020-12-31, and column 2 is 2019-12-31):
The long term debt for 12-31-2019 is listed as 24,672 in AV compared to 26,342 from the 10-k. I have no idea what the AV value of short term debt as 1,701 represents. The shortLongTermDebtTotal of 26,273 is the sum of these two AV values, but this seems to grossly understate the company's debt.
My findings are the AV fundamental data is arbitrarily close to accurate but not reliable to do any real analysis with. Please let me know if I am missing something, or what other users think of this api data quality.
If AV is unreliable, is there a free or reasonably priced alternative that is reliable?