census_api_url.Rd
Create an API call to send to api.census.gov
census_api_url(
variables,
for_geo,
for_items,
survey_type,
survey_or_table_code,
year,
...
)
a vector of variables
a single geographic level, like "tract" or "block"
the specific geographies, or "*"
e.g. "acs" or "dec"
e.g. "acs5" or "pl"
the year of the survey
<[`dynamic dots`][rlang::dyn-dots]> other items to pass to the query
one URL, as a string
census_api_url(paste0("B25003_00", 1:3, "E"),
"tract",
"*",
"acs",
"acs5",
2020L,
state = 55L,
county = 101L)
#> [1] "https://api.census.gov/data/2020/acs/acs5?get=B25003_001E,B25003_002E,B25003_003E&for=tract:*&in=state:55&in=county:101"
census_api_url(paste0("P1_00", c(1, 3, 4), "N"),
"tract",
"*",
"dec",
"pl",
2020L,
state = 55L,
county = 101L)
#> [1] "https://api.census.gov/data/2020/dec/pl?get=P1_001N,P1_003N,P1_004N&for=tract:*&in=state:55&in=county:101"