Skip to content

Commit 473a9db

Browse files
committed
added more content to census
1 parent cec650a commit 473a9db

File tree

1 file changed

+90
-2
lines changed

1 file changed

+90
-2
lines changed

episodes/census.md

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ exercises: 5
88

99
- What are the kinds of datasets available from the U.S. Census Bureau?
1010
- How can you visualize and analyze these datasets for your region of interest?
11-
- Where can you find additional information about a particular dataset?
1211
- How do you combine spatial and tabular data from the Census Bureau?
1312
- What are the variables in the ACS dataset?
1413

@@ -42,7 +41,7 @@ The ANSI include both the Federal Information Processing Series (FIPS) codes and
4241
The fields in the shapefiles include these information. For example, “STATEFP” filed means state FIPS code, and “STATENS” field means state GNIS code.
4342
County level FIPS codes usually have five digits. The first two are the FIPS code of the state to which the county belongs and the rest three are county codes.
4443

45-
![Census USA Map](census_map.png "A map showing U.S. Census Bureau TIGER/Line shapefile boundaries for states and counties.")
44+
![Census USA Map] <img src="/census_map.jpg" alt="Census Map"> ("A map showing U.S. Census Bureau TIGER/Line shapefile boundaries for states and counties.")
4645

4746
### Decennial Census of Population and Housing
4847

@@ -97,6 +96,95 @@ In addition to demographic and housing data, ACS also include:
9796

9897
::::::::::::::::::::::::::::::::::::::::::::::::
9998

99+
100+
## Expert Tutorial: Accessing ACS Data via the Census API
101+
102+
### Step 1 - Explore the Census API
103+
104+
1. Go to [Census Developers Page](https://www.census.gov/data/developers.html).
105+
2. Select **Available APIs** (left side of the search bar).
106+
3. Scroll down and click on the desired API dataset. For this tutorial, we choose **American Community Survey (ACS)**.
107+
4. The ACS offers multiple products — **1-year**, **3-year**, and **5-year estimates**.
108+
- 5-year data provides a longer time frame.
109+
- For example:
110+
- **2023 ACS 5-Year** covers 2019–2023.
111+
- **2022 ACS 5-Year** covers 2018–2022.
112+
- We will use **2023**.
113+
5. Scroll to **Data Profiles** and review the “Example Call” links — these are the base API URLs used in Python or directly in a browser.
114+
6. Under **Data Profiles**, click the `html` link next to **2023 ACS Comparison Profiles Variables**. This page lists all available variables and their codes.
115+
116+
117+
### Step 2 - Understanding API Links for Geographic Levels
118+
119+
120+
The ACS API provides different base links for:
121+
- **Country**
122+
- **State**
123+
- **Tract within a state**
124+
125+
For tract-level data, use the “state > county > tract” pattern.
126+
127+
Example base link for California (state code `06`):
128+
https://api.census.gov/data/2023/acs/acs5/profile?get=NAME&for=tract:*&in=state:06&in=county:*&key=YOUR_KEY_GOES_HERE
129+
130+
131+
**Key points:**
132+
- `tract:*` = all tracts in the selected state
133+
- `county:*` = all counties in the selected state
134+
- Replace `state:06` with your state code (see [State Codes List](https://www.census.gov/library/reference/code-lists/ansi.html#state))
135+
- `state:*` is not allowed for tract-level queries because of dataset size limitations.
136+
137+
---
138+
139+
### Step 3 — Adding Variables to Your Request
140+
141+
1. On the **variables** page you opened earlier, press **Ctrl + F** and search for your variable of interest.
142+
Example: “no vehicles available” → variable `DP04_0058E` (estimate version).
143+
2. Add the variable to your API link after `NAME`, separated by a comma:
144+
145+
**Before**
146+
https://api.census.gov/data/2023/acs/acs5/profile?get=NAME&for=tract:*&in=state:18&in=county:*
147+
148+
**After**
149+
https://api.census.gov/data/2023/acs/acs5/profile?get=NAME,DP04_0058E&for=tract:*&in=state:18&in=county:*
150+
151+
3. Add more variables by separating with commas:
152+
153+
154+
---
155+
156+
### Step 4 — Optional Enhancements
157+
158+
- **View variable descriptions**
159+
Add `&descriptive=true` to the end of your API URL.
160+
- **Download as CSV**
161+
Add `&outputFormat=csv` to get a spreadsheet-friendly file.
162+
163+
---
164+
165+
**Note:** API calls are case-sensitive — variable names must match exactly.
166+
167+
📺 **Video Tutorial:** [How to Access ACS Data from the Census API](https://www.youtube.com/watch?v=rqePUEBrcWQ)
168+
169+
---
170+
171+
#### Example Final API Call
172+
173+
https://api.census.gov/data/2023/acs/acs5/profile?get=NAME,DP04_0058E&for=tract:*&in=state:18&in=county:*&descriptive=true&outputFormat=csv
174+
175+
176+
This returns the number of occupied households without a vehicle for every tract in Indiana.
177+
178+
::::::::::::::::::::::::::::::::::::: keypoints
179+
180+
- The Census API provides flexible, precise access to ACS data.
181+
- You can combine multiple variables in a single API call.
182+
- Adding `&descriptive=true` helps you understand variable meanings.
183+
- Adding `&outputFormat=csv` makes data easier to download and analyze.
184+
185+
::::::::::::::::::::::::::::::::::::::::::::::::
186+
187+
100188
# Module Overview
101189

102190
| Lesson | Overview |

0 commit comments

Comments
 (0)