Learn R Programming

censusapi

censusapi is a lightweight package to get data from the U.S. Census Bureau's APIs. More than 1,000 Census API endpoints are available, including the Decennial Census, American Community Survey, Poverty Statistics, Population Estimates, and Census microdata. This package is designed to let you get data from all of those APIs using the same main functions and syntax for every dataset.

getCensus() is designed to work with any new Census API endpoint when it is released, as long as it conforms to Census's existing standards. The package also includes metadata functions so that users determine which datasets are available and for each dataset, what variables, geographies, and groups can be used.

Installation

Get the latest stable release from CRAN:

install.packages("censusapi")

You can also install the latest development version of censusapi from Github using devtools:

# Install the devtools package if needed
# install.packages("devtools")
devtools::install_github("hrecht/censusapi")

To learn more about using censusapi, read the package documentation and articles at https://www.hrecht.com/censusapi/.

Disclaimer

This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Copy Link

Version

Install

install.packages('censusapi')

Monthly Downloads

1,624

Version

0.8.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Hannah Recht

Last Published

August 9th, 2022

Functions in censusapi (0.8.0)

makeVarlist

Use variable metadata to find variables containing a given string.
listCensusMetadata

Get information about a specific API as a data frame
listCensusApis

Get useful dataset metadata on all available APIs as a data frame
getCensus

Retrieve Census data from a given API
fips

List of state fips codes - 50 states plus DC
getFunction

Internal function: Get the API response, return a data frame