home / skills / openclaw / skills / census

This skill helps you fetch and summarize US Census Bureau data, including population, demographics, ACS, and geographic indicators, via a Python CLI.

npx playbooks add skill openclaw/skills --skill census

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
2.4 KB
---
name: census
description: "US Census Bureau — population, demographics, ACS data, economic indicators, and geographic data."
homepage: https://www.agxntsix.ai
license: MIT
compatibility: Python 3.10+ (stdlib only — no dependencies)
metadata: {"openclaw": {"emoji": "šŸ“Š", "requires": {"env": ["CENSUS_API_KEY"]}, "primaryEnv": "CENSUS_API_KEY", "homepage": "https://www.agxntsix.ai"}}
---

# šŸ“Š Census API

US Census Bureau — population, demographics, ACS data, economic indicators, and geographic data.

## Requirements

| Variable | Required | Description |
|----------|----------|-------------|
| `CENSUS_API_KEY` | āœ… | Census API key (optional) |


## Quick Start

```bash
# ACS 5-Year estimates
python3 {{baseDir}}/scripts/census.py acs-5yr --get "NAME,B01003_001E" --for "state:*"

# ACS 1-Year estimates
python3 {{baseDir}}/scripts/census.py acs-1yr --get "NAME,B01003_001E" --for "state:*"

# 2020 Decennial Census
python3 {{baseDir}}/scripts/census.py decennial --get "NAME,P1_001N" --for "state:*"

# Population estimates
python3 {{baseDir}}/scripts/census.py population --get "NAME,POP_2022" --for "state:*"

# County Business Patterns
python3 {{baseDir}}/scripts/census.py cbp --get "NAME,ESTAB,EMP" --for "state:*" --naics "72"

# Poverty data
python3 {{baseDir}}/scripts/census.py poverty --get "NAME,B17001_001E,B17001_002E" --for "state:*"

# Median household income
python3 {{baseDir}}/scripts/census.py income --get "NAME,B19013_001E" --for "state:*"

# Housing data
python3 {{baseDir}}/scripts/census.py housing --get "NAME,B25001_001E,B25002_002E,B25002_003E" --for "state:*"

# List available datasets
python3 {{baseDir}}/scripts/census.py list-datasets --year "2022"

# List ACS variables
python3 {{baseDir}}/scripts/census.py list-variables

# List available geographies
python3 {{baseDir}}/scripts/census.py list-geographies
```

## Output Format

All commands output JSON by default.

## Script Reference

| Script | Description |
|--------|-------------|
| `{baseDir}/scripts/census.py` | Main CLI — all commands in one tool |

## Credits
Built by [M. Abidi](https://www.linkedin.com/in/mohammad-ali-abidi) | [agxntsix.ai](https://www.agxntsix.ai)
[YouTube](https://youtube.com/@aiwithabidi) | [GitHub](https://github.com/aiwithabidi)
Part of the **AgxntSix Skill Suite** for OpenClaw agents.

šŸ“… **Need help setting up OpenClaw for your business?** [Book a free consultation](https://cal.com/agxntsix/abidi-openclaw)

Overview

This skill provides a command-line interface to query the US Census Bureau APIs for population, demographic, ACS, economic, and geographic data. It wraps multiple datasets and endpoints into a single script so you can fetch estimates, decennial counts, business patterns, poverty, income, housing, and more. Outputs are JSON by default for easy integration into pipelines and apps.

How this skill works

The tool accepts dataset names (ACS 1yr/5yr, decennial, population estimates, CBP, etc.), variable lists, geography selectors, and optional NAICS filters for business data. It calls the Census API (with an optional API key) and returns structured JSON results. Additional helper commands list available datasets, variables, and geographies to simplify discovery.

When to use it

  • Automate retrieval of demographic or economic indicators for states, counties, metros, or custom geographies.
  • Integrate annual ACS or decennial census data into analytics pipelines or dashboards.
  • Fetch industry-level establishment and employment counts via County Business Patterns with NAICS filters.
  • Obtain poverty, income, housing, or population estimate series for research or reporting.
  • Quickly explore available variables and geographies before building queries.

Best practices

  • Provide a Census API key via environment variable to avoid rate limits and ensure stable access.
  • Start with list-variables and list-geographies to discover correct field names and geography codes.
  • Request only the variables you need to reduce payload size and speed up queries.
  • Cache results for repeated queries (e.g., monthly pipelines) to limit API usage.
  • Validate geography selectors (state:, county:, tract:) to avoid unexpected empty results.

Example use cases

  • Download state-level total population from the decennial census for a comparative report.
  • Pull ACS 5-year median household income across states for a visualization.
  • Retrieve county business patterns for hospitality (NAICS 72) to estimate regional employment.
  • Extract poverty counts and rates from ACS for a social services needs assessment.
  • List datasets for a specific year to confirm available survey files for a research project.

FAQ

Is an API key required?

No — the script can run without a key, but supplying CENSUS_API_KEY reduces rate limits and improves reliability.

What output formats are supported?

JSON is the default output, suitable for direct consumption by downstream tools and scripts.