us-census-data — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited us-census-data (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Query demographic, economic, housing, and population data from the US Census Bureau API. Supports American Community Survey (ACS), Decennial Census, and Population Estimates.
Before querying, check if the user has an API key:
CENSUS_API_KEY in the user's .env file&key=<api_key>.env: CENSUS_API_KEY=your_key_hereThe API works without a key for testing but is rate-limited and may block requests.
The Census API is at api.census.gov. Queries require:
/data/{year}/{dataset} (e.g., /data/2022/acs/acs5)?get=NAME,B01001_001E (variable codes)&for=county:*&in=state:17 (FIPS codes)&key=YOUR_KEY (required for production use)Ask the user:
| Need | Dataset | Endpoint | Notes |
|---|---|---|---|
| Detailed demographics (small areas) | ACS 5-Year | /data/{year}/acs/acs5 | Block group+, most reliable |
| Recent data (large areas only) | ACS 1-Year | /data/{year}/acs/acs1 | 65k+ population areas only |
| Exact population counts | Decennial | /data/2020/dec/dhc | Every 10 years, block level |
| Annual population change | Pop Estimates | /data/{year}/pep/population | County+, intercensal |
See references/datasets.md for complete dataset documentation.
Census variables use codes like B19013_001E (median household income). The E suffix = estimate, M suffix = margin of error.
Option A - Popular Variables Reference: See references/popular-variables.md for curated list of common variables.
Option B - Variable Search API:
GET https://api.census.gov/data/2022/acs/acs5/variables.jsonOption C - Groups (Tables) API:
GET https://api.census.gov/data/2022/acs/acs5/groups.jsonSee references/datasets.md for common table prefixes and naming conventions.
Basic structure:
https://api.census.gov/data/{year}/{dataset}?get={variables}&for={geography}&key={api_key}Example - Median income by county in Illinois:
https://api.census.gov/data/2022/acs/acs5?get=NAME,B19013_001E&for=county:*&in=state:17&key=YOUR_KEYGeography predicates:
for=state:* - All statesfor=county:*&in=state:17 - All counties in Illinoisfor=tract:*&in=state:17&in=county:031 - All tracts in Cook County, ILfor=block%20group:*&in=state:17&in=county:031&in=tract:010100 - Block groups in tractSee references/geographies.md for complete geography hierarchy and FIPS codes.
Census API returns JSON array where first row is column headers:
[
["NAME", "B19013_001E", "state", "county"],
["Cook County, Illinois", "62088", "17", "031"],
["DuPage County, Illinois", "99007", "17", "043"]
]For large queries, the API has no built-in pagination. Request specific geographies or use &in= filters.
| Parameter | Purpose | Example |
|---|---|---|
get | Variables to return | get=NAME,B01001_001E,B19013_001E |
for | Target geography | for=county:* or for=county:031 |
in | Parent geography filter | in=state:17 |
key | API key | key=abc123 |
get=NAME,B01001_001E,B19013_001E (comma-separated)get=group(B19013) (all variables in table)get=B19013_001E,B19013_001MUse * for "all" at that level:
for=state:* - All 50 states + DC + territoriesfor=county:*&in=state:06 - All counties in Californiafor=tract:*&in=state:06&in=county:037 - All tracts in LA CountyState-level totals:
curl "https://api.census.gov/data/2022/acs/acs5?get=NAME,B01001_001E&for=state:*&key=$CENSUS_API_KEY"County-level within a state:
curl "https://api.census.gov/data/2022/acs/acs5?get=NAME,B19013_001E&for=county:*&in=state:17&key=$CENSUS_API_KEY"Tract-level (requires state + county):
curl "https://api.census.gov/data/2022/acs/acs5?get=NAME,B01001_001E&for=tract:*&in=state:17&in=county:031&key=$CENSUS_API_KEY"Multiple variables:
curl "https://api.census.gov/data/2022/acs/acs5?get=NAME,B01001_001E,B19013_001E,B25001_001E&for=county:*&in=state:17&key=$CENSUS_API_KEY"Provide the user with:
Dataset: ACS 5-Year 2022
Endpoint: https://api.census.gov/data/2022/acs/acs5
Variables:
- NAME: Geography name
- B19013_001E: Median Household Income (estimate)
- B19013_001M: Median Household Income (margin of error)
Geography: All counties in Illinois (state FIPS 17)
Query:
curl "https://api.census.gov/data/2022/acs/acs5?get=NAME,B19013_001E,B19013_001M&for=county:*&in=state:17&key=$CENSUS_API_KEY"
Note: ACS data are estimates with margins of error. 5-year estimates are most reliable for small geographies.| Issue | Cause | Fix |
|---|---|---|
| 400 Bad Request | Invalid variable or geography | Check variable exists for that dataset/year |
| 204 No Content | Valid query, no matching data | Geography may not exist or have data |
Empty array [] | No data for that geography | Try different year or geography level |
| "error: unknown variable" | Variable doesn't exist | Use variables.json endpoint to verify |
| Missing data for small areas | ACS 1-year limitation | Use ACS 5-year for areas <65k population |
ACS estimates have sampling error. Always consider:
E suffix = estimate, M suffix = margin of error (90% confidence)See references/datasets.md for MOE calculation guidance.
Census data API returns tabular data only. For geographic boundaries, use TIGERweb:
See references/tigerweb.md for geometry retrieval and data joining.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.