Is there an API for Census demographics by ZIP code?
Yes: the Census Bureau's Data API serves American Community Survey (ACS) 5-year estimates for ZIP Code Tabulation Areas (ZCTAs) for free, but every query needs a free API key, you ask for coded variables such as B19013_001E (median household income) and its margin of error B19013_001M, and results come back as a two-dimensional array. The Olympus US Geographic & Demographics API serves the same ACS 5-year data by ZCTA as named JSON fields, each with its margin of error, source table and survey period: GET /v1/geo-demographics/locations/02139.
By New Odyssey · Published · Markdown
The official route, and what it lacks
- A key on every call. The Census Bureau's query limits page says: "An API key must be used with all data queries made to the Census Data API." Keys are free.
- Coded variables. You request variables by table code (
B19013_001Eis the estimate of median household income,B19013_001Mits margin of error) and look the codes up in the variable lists of each dataset and year. - Arrays, not records. "Data are represented in a two-dimensional array": the first row holds the field names and each following row one geography.
- ZCTAs, not ZIP codes. ZCTAs are "generalized areal representations of the geographic extent and distribution of the point-based ZIP Codes", and "Not all valid ZIP Codes are represented by a 2020 ZCTA."
- 5-year estimates only. The ACS publishes no 1-year estimates for ZCTAs; 5-year estimates are available for all areas. The latest, 2020-2024, was released on 29 January 2026.
None of that is wrong; it is what a general statistical API is for. It means mapping codes to names, pairing each estimate with its margin of error and keeping track of which vintage you read, in your own code.
What the US Geographic & Demographics API serves
Census ACS 5-year demographic profiles for ZIP Code Tabulation Areas (ZCTAs) and counties, with 90% margins of error; NCES public schools near a ZCTA; two-ZCTA comparison.
Limits
- ZCTAs are not USPS ZIP codes: codes resolve only by exact ZCTA match; PO-box-only and single-building ZIPs have no ZCTA (404 ZCTA_NOT_FOUND).
- Values are survey estimates with margins of error (moe); suppressed values are null with null_reason.
- Connecticut planning regions (09110-09190) have no ZCTA overlaps in the 2020 relationship file.
Not included: crime data or scores; school ratings or rankings; flood or other risk scores; private schools; predictive scores.
Example request and response
A ZCTA's profile (02139 is in Cambridge, Massachusetts):
curl -s "https://api.olympus.new-odyssey.com/v1/geo-demographics/locations/02139" \
-H "X-API-Key: $OLYMPUS_API_KEY"{
"data": {
"geography": {
"type": "zcta",
"id": "02139",
"name": "ZCTA5 02139",
"input_code": "02139",
"matched_by": "exact_zcta_code",
"land_area_sqmi": 1.552,
"primary_county_fips": "25017",
"primary_state_code": "MA"
},
"vintage": { "survey": "ACS 5-year", "period": "2020-2024", "year": 2024 },
"summary": {
"median_household_income": {
"key": "median_household_income",
"unit": "usd",
"value": 134586,
"moe": 8697,
"qualifier": null,
"null_reason": null,
"universe": "Households",
"source": { "table_id": "B19013", "variables": ["B19013_001E"], "moe_variable": "B19013_001M", "derived": false }
}
},
"provenance": {
"dataset_id": "…",
"source_id": "census.acs5",
"source_version": "acs5-2024:zcta",
"source_date": "2025-09-02",
"validation_status": "passed",
"record_id": "zcta:02139"
}
},
"meta": {
"coverage": { "geography_type": "zcta", "scope": "ACS 5-year ZCTAs in the 50 states, DC and Puerto Rico" },
"notices": [
{ "code": "ZCTA_NOT_USPS_ZIP", "message": "ZCTAs approximate USPS ZIP code areas; they are not ZIP codes." }
]
}
}Every metric carries its estimate (value), its 90% margin of error (moe), the ACS table and variables it came from and the survey period. GET /v1/geo-demographics/locations/{zcta}/demographics returns the full profile, and GET /v1/geo-demographics/counties/{fips} the same for a county.
ACS margins of error are at the 90 percent confidence level, the Census Bureau standard. A ZIP code that has no ZCTA answers 404 ZCTA_NOT_FOUND; see ZCTA vs ZIP code.
Coverage and refresh
Coverage: ACS 5-year ZCTAs and counties in the 50 states, DC and Puerto Rico.
- ACS 5-year: the latest release loaded (e.g. 2020-2024), stated on every metric as vintage.period. Values describe that period, not today; dollars are inflation-adjusted to its final year.
- ZCTA-to-county relationships: Census 2020.
- Schools: the latest NCES CCD school year loaded (e.g. 2024-2025), stated as school_year.
Refresh: Annual (a publication is stale after 400 days). GET /v1/geo-demographics/coverage lists exactly what is loaded right now.
Price
Every Olympus plan includes the US Geographic & Demographics API and every other live API. The Free plan (no card) gives 1,000 requests a month to each live API at 10 requests a minute. Paid plans: Developer $79 a month (50,000 requests per API), Growth $299 a month (250,000 requests per API), Business $999 a month (1,000,000 requests per API); Enterprise from $2,500 a month on request. Prices in USD; see pricing for rate limits and what counts as a request.
Docs
- US Geographic & Demographics API: what it serves and its endpoints
- API reference; OpenAPI contract at
/openapi/geo-demographics.yaml - Coverage and known limits
- ZCTA vs ZIP code
- Methodology
- Get a free API key, then send it in the
X-API-Keyheader - From an AI agent: the MCP server tools
get_us_demographicsandget_product_coverage
This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau.
Questions
Does the Census API need a key?
Yes. The Census Bureau says an API key must be used with all data queries made to the Census Data API. Keys are free.
Can I get ACS data for a ZIP code?
For a ZIP Code Tabulation Area (ZCTA), the Census Bureau's approximation of a ZIP code area. ACS 5-year estimates are published for ZCTAs; not every ZIP code has a ZCTA.
Are margins of error included?
Yes. Every metric the Olympus API returns carries its ACS margin of error (90 percent confidence level) next to the estimate.
Does it include crime data or school ratings?
No. Crime data, school ratings or rankings, risk scores and private schools are not included. NCES public schools near a ZCTA are.
Sources
- U.S. Census Bureau: Census Data API user guide: query limits
- U.S. Census Bureau: Census Data API user guide: core concepts
- U.S. Census Bureau: ZIP Code Tabulation Areas (ZCTAs)
- U.S. Census Bureau: ACS: areas published
- U.S. Census Bureau: ACS sample size and data quality definitions
- U.S. Census Bureau: 2020-2024 ACS 5-year estimates release
- U.S. Census Bureau: Census Data API terms of service