listCensusApis {censusapi}R Documentation

Get general information about available datasets

Description

Scrapes https://api.census.gov/data.json and returns a dataframe that includes columns for dataset title, description, name, vintage, url, dataset type, and other useful fields.

Usage

listCensusApis(name = NULL, vintage = NULL)

Arguments

name

Optional complete or partial API dataset programmatic name. For example, "acs", "acs/acs5", "acs/acs5/subject". If using a partial name, this needs to be the left-most part of the dataset name before /, e.g. "timeseries/eits" or "dec" or "acs/acs5".

vintage

Optional vintage (year) of dataset.

Value

A data frame with the following columns:

See Also

Other metadata: listCensusMetadata(), makeVarlist()

Examples


# Get information about every dataset available in the APIs
apis <- listCensusApis()
head(apis)

# Get information about all vintage 2022 datasets
apis_2022 <- listCensusApis(vintage = 2022)
head(apis_2022)

# Get information about all timeseries datasets
apis_timeseries <- listCensusApis(name = "timeseries")
head(apis_timeseries)

# Get information about 2020 Decennial Census datasets
apis_decennial_2020 <- listCensusApis(name = "dec", vintage = 2020)
head(apis_decennial_2020)

# Get information about one particular dataset
api_sahie <- listCensusApis(name = "timeseries/healthins/sahie")
head(api_sahie)


[Package censusapi version 0.9.0 Index]