matthiasgomolka / simfinapi

Makes 'SimFin' data (https://simfin.com/) easily accessible in R.
19 stars 4 forks source link

Functions says the ticker or id is not correct but it is from simfin database #15

Closed MislavSag closed 3 years ago

MislavSag commented 3 years ago

I tried to use sfa_get_info function on all SimFin tickers/ids. I have got an error in both cases. First when I use ids:

library(simfinapi)

firms <- simfinapi::sfa_get_entities(api_key = "myapi")
firms_info <- simfinapi::sfa_get_info(SimFinId = firms$SimFinId, api_key = "myapi")

I got an error:

Error in check_inputs(Ticker = Ticker, SimFinId = SimFinId, api_key = api_key,  : 
  Assertion on 'SimFinId' failed: Element 76 is not <= 999999.

When I used tickers:

library(simfinapi)

firms <- simfinapi::sfa_get_entities(api_key = "myapi")
firms_info <- simfinapi::sfa_get_info(Ticker = firms$Ticker, api_key = "my_api")
head(firms)

I got an error:

Error in check_inputs(Ticker = Ticker, SimFinId = SimFinId, api_key = api_key,  : 
  Assertion on 'Ticker' failed: Must comply to pattern '^[A-Za-z0-9_.]+$'.
matthiasgomolka commented 3 years ago

Hi and thanks for reporting! The input checks on Ticker and SimFinId were too strict (inferred from older data). Fixed in the dev version (b45f4e631b624a7c8d7baa177e0520e3fef73731).