Pull demographic data from the US Census Bureau API

domain: api.census.gov · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Register for a free Census API key at api.census.gov/data/key_signup.html; all data queries to the Census Data API require an api_key parameter.
  2. Identify the dataset and vintage year: for the American Community Survey 5-year estimates use the base URL https://api.census.gov/data/{year}/acs/acs5; for 1-year estimates use acs1 — 5-year estimates provide data down to census tracts and block groups, while 1-year estimates require populations of 65,000 or more.
  3. Construct a GET request with a get parameter listing the variable codes you need (e.g., B01003_001E for total population) and a for parameter specifying the geographic unit (e.g., county:* or tract:* within state:06 for California tracts).
  4. Parse the JSON response: the first array in the response contains column headers and each subsequent array is a data row; join on the geographic FIPS codes to match rows to your spatial data.
  5. To discover available variables, fetch the variables JSON at https://api.census.gov/data/{year}/acs/acs5/variables.json or use the subject-tables endpoint (acs5/subject) for pre-computed topic summaries.
  6. Handle the Census API's 50-variable-per-request limit by splitting large variable lists across multiple requests and joining results on the geographic identifier.

Known gotchas

Related routes

Fetch American Community Survey demographic data from the Census Bureau API
census.gov · 5 steps · unrated
Pull neighborhood demographic data from the Census Bureau's ACS API for a comparative market analysis.
api.census.gov · 5 steps · unrated
Pull American Community Survey 5-year detailed table estimates from the Census Bureau API for a custom geography
api.census.gov · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans