listCensusApis: Get general information about available datasets

View source: R/metadata_functions.R

listCensusApisR 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:

  • title: Short written description of the dataset.

  • name: Programmatic name of the dataset.

  • vintage: Year of the survey, for use with microdata and aggregate datasets.

  • type: Dataset type, which is either "Aggregate", "Microdata", or "Timeseries".

  • temporal: Time period of the dataset. Warning: not always documented.

  • spatial: Spatial region of the dataset. Warning: not always documented.

  • url: Base URL of the dataset endpoint.

  • modified: Date last modified. Warning: sometimes out of date.

  • description: Long written description of the dataset.

  • contact: Email address for specific questions about the Census Bureau survey.

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)


hrecht/censusapi documentation built on April 8, 2024, 9:21 a.m.