Ask statistical questions across every US state, county, city, or ZIP code. No FIPS lookup tables, Census variable IDs, or manual data wrangling — just sign in for a free key and ask. Pick how you'd like to consume the service:
Give any AI agent or orchestrator plug-and-play Census capability with a single instruction pointing to our live skill manifest.
Get the skill instruction →Test natural language queries directly in your browser and view structured narrative summaries and underlying raw JSON data.
Try interactive playground →Call our serverless API endpoints using Python requests or cURL inside your scripts, data pipelines, and applications.
Paste one instruction into any AI agent (Claude Code, Cursor, LangChain, OpenWebUI, ...). The skill manifest teaches it the endpoint, authentication, and query patterns — your agent handles the rest autonomously.
Read https://censusdata.xyz/skill and follow it to answer US Census data questions. Authenticate /query requests with the header X-API-Key: cd_YOUR_API_KEY
Test the agent in real time. Ask any demographic, economic, commute, or housing question. The agent autonomously resolves geographies, handles historical variable shifts, queries live Census tables, and returns structured data.
Consume the service programmatically inside your scripts, data workflows, or autonomous AI agents. All /query requests require an API key — sign in with Google above to get yours free. Pass it as an X-API-Key header (or api_key query parameter). The free tier includes a daily query allowance; contact the administrator for higher or unlimited quotas.
Send queries via standard HTTP GET requests with your API key. Returns structured JSON containing narrative summaries and underlying raw data.
import requests
url = "https://censusdata.xyz/query"
params = {"q": "What is the poverty rate in Chicago, IL?"}
headers = {"X-API-Key": "cd_YOUR_API_KEY"}
resp = requests.get(url, params=params, headers=headers)
if resp.status_code == 401:
print("Missing/invalid API key — sign in at censusdata.xyz")
elif resp.status_code == 429:
print("Daily quota exhausted — resets at midnight UTC")
else:
data = resp.json()
if data.get("success"):
print("Summary:", data["summary"])
print("Raw Data:", data["raw_data"])
else:
print("Error / Unanswerable:", data.get("error_details"))
Every response package returns a boolean status flag alongside narrative summaries, structured records, and your remaining quota.
{
"success": true, // false if irrelevant/unanswerable
"error_details": null, // details if success is false
"query": "user request text",
"summary": "distilled narrative response",
"raw_data": [ /* structured Census records */ ],
"quota": { "used": 3, "limit": 10 } // today's usage
}