Statistics

US Census Data API

by census.gov

Statistics Added on November 7th, 2026 Checked and working on November 7th, 2026
Visit census.gov →

What it does

The Census Data API from the US Census Bureau gives population, housing, income and business statistics from the decennial census, the American Community Survey and other surveys, down to states, counties and tracts, for example to show the population of every county. Name the dataset, the variables and the geography in the URL and get a JSON table. Free with a free API key. An official MCP server (github.com/uscensusbureau/us-census-bureau-data-api-mcp) lets AI agents query Census data.
  • API
  • HTTP-GET
  • JSON
  • MCP
  • REST

At a glance

API key
Needed, free · More APIs with a free key
Pricing
Free with a free API key.
From the browser
Yes (CORS)
Formats
JSON
Interface
REST, HTTP-GET, MCP
Provider
census.gov
Last checked
Working on November 7th, 2026

More information: https://www.census.gov/data/developers.html

Is this your service? Show that it is listed

Put this badge on your website or in your README; it links to this page. About the badge

Listed on Free Web Services

census.gov
US Census Data API

Example request

curl

curl 'https://api.census.gov/data/2020/dec/pl?get=NAME,P1_001N&for=state:06&key=YOUR_API_KEY'

JavaScript

const response = await fetch("https://api.census.gov/data/2020/dec/pl?get=NAME,P1_001N&for=state:06&key=YOUR_API_KEY");
const data = await response.json();
console.log(data);

Python

import requests

response = requests.get(
    "https://api.census.gov/data/2020/dec/pl?get=NAME,P1_001N&for=state:06&key=YOUR_API_KEY",
    timeout=30,
)
print(response.json())

Replace YOUR_API_KEY with your own key. The JavaScript works in a web page as well as in Node.js 18 or newer.

Did it work for you?

Tell us what you found when you tried US Census Data API.