GnistAI GnistAI
Log in

US Census Bureau

US Census Bureau data — American Community Survey demographics, income, housing, and social characteristics for states, counties, cities, and tracts.

Overview   |   MCP Docs   |   API Docs   |   OpenAPI   |   Playground   |   Tutorial   |   Toolkits   |   Home
status: healthy status status healthy healthy tools: 6 tools tools 6 6 Economics

Data source: US Census Bureau API

MCP MCP Protocol

Endpoint https://context.gnist.ai/mcp/us-census/
claude_desktop_config.json
{
  "mcpServers": {
    "gnist-us-census": {
      "url": "https://context.gnist.ai/mcp/us-census/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}
Shell
curl -X POST "https://context.gnist.ai/mcp/us-census/" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_acs_data", "arguments": {"variables": "...", "geography": "example"}}}'

API REST API

API Root https://context.gnist.ai/rest/us-census/

6 endpoints available:

Shell
curl "https://context.gnist.ai/rest/us-census/get_acs_data?variables=...&geography=example" \
  -H "Gnist-API-Key: YOUR_API_KEY"
Python
import httpx

resp = httpx.get(
    "https://context.gnist.ai/rest/us-census/get_acs_data",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    params={
        "variables": "...",
        "geography": "example"
},
)
print(resp.json())

OpenAPI Spec  ·  Full API Docs

CLI Command Line

Command gc us-census

CLI documentation will be available when the GnistAI SDK is published.

Install
pip install gnistai

Available Tools (6)

get_acs_data
Fetch American Community Survey 5-year data by variable codes and geography.
ParameterTypeRequiredDescription
variableslist[string]requiredACS variable codes (e.g. ["B01001_001E", "B19013_001E"]).
geographystringrequiredGeography type: us, state, county, place, tract, block_group, zip_code, metro_area, or congressional_district.
codestringoptionalFIPS code for the geography, or "*" for all. Use get_geography_codes to look up codes. (default: "*")
within_stateanyoptionalState FIPS code to filter within (required for county, place, tract queries).
within_countyanyoptionalCounty FIPS code to further filter within (for tract/block group queries).
yearintegeroptionalACS 5-year vintage year (2009-2022). Default 2022. (default: 2022)
get_acs_profile
Get curated demographic, economic, housing, or social profile data.
ParameterTypeRequiredDescription
profile_typestringrequiredProfile type: demographic, economic, housing, or social.
geographystringrequiredGeography type: us, state, county, place, etc.
codestringoptionalFIPS code for the geography, or "*" for all. (default: "*")
within_stateanyoptionalState FIPS code to filter within.
yearintegeroptionalACS 5-year vintage year (2009-2022). Default 2022. (default: 2022)
search_groups
Search available ACS table groups (data tables) by keyword.
ParameterTypeRequiredDescription
querystringrequiredSearch term for ACS table groups (e.g. "income", "education", "housing").
yearintegeroptionalACS 5-year vintage year. Default 2022. (default: 2022)
limitintegeroptionalMax results to return (1-100). Default 20. (default: 20)
get_group_variables
List all variables in a specific ACS table group.
ParameterTypeRequiredDescription
groupstringrequiredACS table group code (e.g. "B01001", "B19013", "DP05").
yearintegeroptionalACS 5-year vintage year. Default 2022. (default: 2022)
get_geography_codes
Look up FIPS codes for geographies by name.
ParameterTypeRequiredDescription
geography_typestringrequiredGeography type: state, county, place, etc.
state_codeanyoptionalState FIPS code (for county, place, tract lookups).
yearintegeroptionalACS 5-year vintage year. Default 2022. (default: 2022)
report_feedback
Report a bug, feature request, or general feedback for this data source.
ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: "general")

Related