How to Add US Census Data to OpenClaw
OpenClaw is a solid local AI agent, but out of the box it has no way to look up real demographic data. Ask it about the population of a county or the median income in a zip code and it’ll give you whatever it memorized during training — which may be years out of date. Adding the Census Data tool through AgentPatch fixes that.
Why This Matters
If you’re building a bot that answers questions about communities, compares regions, or does any kind of civic or economic analysis, you need current data from a reliable source. The US Census Bureau’s American Community Survey is the standard, but its API is notoriously unfriendly — cryptic variable codes, FIPS-based geography, and minimal documentation.
The Census Data tool on AgentPatch wraps all of that complexity. Your OpenClaw bot can request variables like total_population, median_household_income, or bachelors_degree_or_higher using plain names. Geography works with state names (“Texas”) instead of FIPS codes, and you can query at the national, state, county, zip code, or place level. Results come back with human-readable labels, not Census Bureau codes.
Setup
Add AgentPatch to ~/.openclaw/openclaw.json:
{
"mcp": {
"servers": {
"agentpatch": {
"transport": "streamable-http",
"url": "https://agentpatch.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
}
Replace YOUR_API_KEY with your actual key from the AgentPatch dashboard. Restart OpenClaw and it discovers all AgentPatch tools automatically.
Example
You’re chatting with your OpenClaw bot on Discord and ask:
“What’s the population and median age in Travis County, Texas?”
Without Census Data access, the bot would give you a rough estimate from training data. With AgentPatch connected, it queries the ACS directly:
Fetching Census ACS data for Travis County, Texas...
Variables: total_population, median_age
Geography: county, state: Texas, county: Travis
Year: 2023, Dataset: acs5
Travis County, Texas:
- Total population: 1,290,188
- Median age: 34.4
Travis County skews younger than the national median of 38.9,
which tracks with Austin's reputation as a tech hub.
The bot fetched current numbers from the Census Bureau and added useful context. No API keys to manage, no FIPS code lookups, no raw table parsing.
This works the same way on Telegram or Signal — wherever your OpenClaw instance lives.
Wrapping Up
Once AgentPatch is connected, your OpenClaw bot can pull US Census data whenever it needs real demographic or economic figures. Each call costs 75 credits and covers 16 variables across population, income, education, housing, and demographics. The same connection also gives your bot access to everything else on the marketplace. Check out agentpatch.ai to see what’s available.