U.S. flag

An official website of the United States government

Skip Header
Webinars
Resources
REQUEST A DATA TRAINING

Webinars
Live and recorded classes led by Census Bureau instructors on a variety of topics.

Introduction to the Census Bureau Data API

Discover the variables available in our API, geography FIPS codes, and learn how to use our Census Bureau API in coding programs, like R, and Excel.

Skill Level: Intermediate to Advanced 

Course Description

The Census Bureau Application Programing Interface (API) is a data service that enables software developers and researchers to streamline data integration within their applications and data visualizations through access to our free API data. This course provides detailed instructions on:

  • What an API is and the functions and components of and API call.
  • A basic overview of the types of data the Census Bureau provides API access to.
  • How to use Census Bureau resources (examples, variable lists, FIPS codes) to write and construct an API call (URL) for the specific variables and statistics you need. 
  • How to get a Census Bureau API key.
  • How to download data from your API call and clean the data using Excel.
  • How to load and parse data directly into R using the tidycensus package. 
  • How to use Excel and R to visualize statistics.

*Please Note: To follow along with step-by-step examples for module 3, you will need to download Rstudio and the tidycensus code package. 

Who Should Take this Course?

Those who need to construct API data calls from the U.S. Census Bureau’s datasets. 
Those who would like to use R or Excel to visualize statistics.  

Course Instructors:

Tyson Weister, Center for Enterprise Dissemination

Amanda Klimek, American Community Survey Office

Deborah Rivera, Center for Enterprise Dissemination

Mary Leisenring, Census Academy

Table of Contents

Module 1: Introduction to API’s and Census Bureau Data (37 minutes)

  • Part 1: What is an API (4:26)
  • Part 2: Introduction to Census Bureau Data (15:20)
  • Part 3: What is Available on the Census Data API (4:22)
  • Part 4: Demo of data.census.gov (12:59)

Module 2: Accessing the API and Building Your Query (51 minutes)

  • Part 1: What to Know About API Keys (4:15)
  • Part 2: Core Concepts of the Census Bureau Data API (9:44)
  • Part 3: Building Your First Queries (37:39)

Module 3: Creating Your Datasets Using Excel and R (42 minutes) 

  • Part 1: Loading and Parsing Data Using Excel (21:23)
  • Part 2: Loading and Parsing Data Using R (20:19)

Module 4: Using Your Data and Next Steps (25 minutes)

  • Part 1:  Visualizing the Data in Excel and R (18:18)
  • Part 2: Other Resources and Next Steps (4:06)
  • Part 3: Contact (2:03)

Beginning of Course

Module 1: Introduction to API’s and Census Bureau Data

In this module, become acquainted with the concept and uses of an API through common examples from other websites, and tools that are powered with the Census Bureau API. We then review some of the most popular surveys and programs so you can learn what kinds of data are available in the API and at what levels of geography.  

We show you how to navigate the discovery tool to determine what is available in the Census Bureau’s API and relate it to your needs. Finally, we will briefly go over how to use data.census.gov. Data.census.gov is useful to find statistics in general, but it can also be used to support finding the table and variable names and ids for your API calls.   

Part 1: What is an API (4:26)

Part 2: Introduction to Census Bureau Data (15:20)

Part 3: What is Available on the Census Data API (4:22)

Part 4: Demo of data.census.gov (12:59)

Resources

Module 2: Accessing the API and Building Your Query

In this module, we discuss when an API key is necessary and how to obtain a key through census.gov/developers. 

We then go over basic API terminology, such as functions, components, and variables.  Lastly, you’ll learn the main components of an API query: base query, dataset and year, variable call, and geography. By the end of this module, you will be able to construct an API query using the four components of the query. We walk you through how to use baseline example API calls in the Census Bureau’s API Discovery Tool.

Part 1: What to Know About API Keys (4:15)

Part 2: Core Concepts of the Census Bureau Data API (9:44)

Part 3: Building Your First Queries (37:39)

Resources

Module 3: Creating Your Datasets Using Excel and R

Now that you have constructed and API call, it is time to learn how to download the data from a raw JSON format into Excel. Then we will install the “tidycensus” package into R, and walk you through how to load our datasets from the API into R.  

For this module, you will need to download R Studio and the tidycensus document, API_Course.R. (below)

Part 1: Loading and Parsing Data Using Excel (21:23)

Part 2: Loading and Parsing Data Using R (20:19)

Resources

Module 4: Using Your Data and Next Steps

In Module Four, we show you how to work with the data we pulled from the API in both Excel and R to create quick and basic visualizations. Viewing the data you downloaded, you will work with the data in order to make basic visualizations like line and bar graphs.

Finally, we review how to get in contact with Census Bureau staff for API support.

Part 1: Visualizing the Data in Excel and R (18:18)

Part 2: Other Resources and Next Steps (4:06)

Part 3: Contact (2:03)

Resources

Congratulations! You Finished the Course!

Completed the Data Gem?

Share your accomplishment on your social media by downloading this certificate or badge!

Text to Copy When You Share:

I just finished Introduction to the Census Bureau Data API with Census Academy. Be sure to check out their free resources!

#CensusAcademy #FreeCourses #DataScience #API #DataAnalysis #FreeData 

Subscribe to Census Academy to receive the upcoming Data Gems from this series.

Page Last Revised - July 12, 2024
Is this page helpful?
Thumbs Up Image Yes Thumbs Down Image No
NO THANKS
255 characters maximum 255 characters maximum reached
Thank you for your feedback.
Comments or suggestions?

Top

Back to Header