360 Secure SkillHub
360 安全技能中心

Census

这是一个封装美国人口普查局 API 的 Python 命令行工具,支持 ACS 1年/5年估计、十年普查、人口估计、县级商业格局、贫困、收入与住房等数据集,可列出数据集、变量和地理范围,结果以 JSON 输出;需要 Python 3 运行,并可配置 API 密钥。

aiwithabidi
aiwithabidi
热度 60.08
最近更新 2026-05-10 17:38:52
分类:数据依赖:代码执行 / 第三方 API应用场景:数据处理 / 研究 / 报告撰写

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add census
Metadata
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

# 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 | agxntsix.ai YouTube | GitHub Part of the AgxntSix Skill Suite for OpenClaw agents.

📅 Need help setting up OpenClaw for your business? Book a free consultation