Search SAM API by item
sam_search(
legal_name = NULL,
dba = NULL,
cage = NULL,
duns = NULL,
registration_status = NULL,
disaster_response = NULL,
city = NULL,
country = NULL,
state = NULL,
zip = NULL,
congressional_district = NULL,
naics_sb = NULL,
naics_any = NULL,
registration_purpose = NULL,
is_minority_owned = F,
is_woman_owned = F,
is_vet_owned = F,
is_service_vet = F,
is_8a = F,
is_hubzone = F,
is_ability_one = F,
api_version = 3,
api_key = "DEMO_KEY",
return_message = T
)
library(tidyverse)
library(govtrackR)
df <- sam_search(legal_name = c("JBG", "Booz", "Lockheed"))
df %>% glimpse()
df %>% group_by(idDUNS) %>% summarise(count = n(), entities = str_c(nameCompanyLegal, collapse = " | ")) %>% arrange(desc(count))
dict_naics <- dictionary_naics_codes()
codes <-
dict_naics %>%
filter(nameNAICS %>% str_detect("ICE CREAM|COOKIE")) %>%
pull(idNAICS)
df_cookies_ice_cream <- sam_search(naics_any = c(codes))
df_cookies_ice_cream %>%
count(statusCompany, state)