cn-stats
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "cn-stats" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-4c50c805e860a9d6f4c08e38066ea0ecb21cdb480006fe66d8e411b64ffdc39e. Verify the upstream source and version against https://github.com/aahl/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
China National Bureau of Statistics data lookup skill: used to retrieve and respond when the user wants official statistical data such as economic indicators, CPI, GDP, population, or housing price indices.
Introduction source: third_party · aahl · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Software, accounts and paid services
- BASE_URL='https://data.stats.gov.cn/dg/website/publicrelease/web/external' JQ_INDICATORS='.data | {total}, (.list[] | {_id, type, chart_style_text, i_showname})' JQ_AREAS='.data[] | [.name_value,.name_text] | @tsv'
- Testing
- Not tested
Browse files
Frontmatter
name: cn-stats
description: 中国国家统计局公开数据查询技能,当用户想查询经济、CPI、GDP、人口、房价指数等数据时触发。国家统计局
# 全局环境变量
BASE_URL='https://data.stats.gov.cn/dg/website/publicrelease/web/external'
JQ_INDICATORS='.data | {total}, (.list[] | {_id, type, chart_style_text, i_showname})'
JQ_AREAS='.data[] | [.name_value,.name_text] | @tsv'
# 获取指标分类根节点ID
# code: {1:月度数据, 2:季度数据, 3:年度数据, 4:分省月度数据, 5:分省季度数据, 6:分省年度数据}
# {7:主要城市月度价格, 8:主要城市年度数据, 9:港澳台月度数据, 10:港澳台年度数据}
# {12:三大经济体月度数据, 13:国际市场月度商品价格, 14:主要国家年度数据}
ROOT_ID=$(curl "$BASE_URL/new/queryIndexTreeAsync?pid=&code=1" | jq -r '.data[0]._id // .')
# 获取指标分类子节点
curl "$BASE_URL/new/queryIndexTreeAsync?pid=$ROOT_ID&code=1" | jq -r '.data[] | {_id, name, type, isLeaf}'
# 获取指标列表 (isLeaf==true)
curl "$BASE_URL/new/queryIndicatorsByCid?cid=$NODE_ID&dt=&name=" | jq -r $JQ_INDICATORS
# 搜索指标列表
curl -G "$BASE_URL/new/queryIndicatorsByCid?cid=&dt=&rootId=$ROOT_ID" \
--data-urlencode 'name=<关键词>' \
| jq -r $JQ_INDICATORS
# 获取统计数据 - 多指标
# dts: 时间范围 {年: 2026YY | 2022YY-2026YY, 月: 202501MM-202512MM}
curl "$BASE_URL/stream/esData" \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Referer: https://data.stats.gov.cn/dg/website/page.html' \
--data-raw '{
"cid": "分类NODE_ID(isLeaf==true)",
"indicatorIds": ["指标ID1","指标ID2"],
"daCatalogId": "",
"das": [{"text":"全国","value":"000000000000"}],
"showType": "1",
"dts": "",
"rootId": "根节点ROOT_ID"
}' | jq -r '
.data[] |
.name as $year |
.values[] |
[$year, ._name, .value // "-", .du_name] |
@tsv
'
# 获取地区分类
curl "$BASE_URL/getDaCatalogTreeByIndicatorCid?indicatorCid=$NODE_ID"
# 获取地区列表
curl "$BASE_URL/getDasByDaCatalogId?daCid=$DA_CATELOG_ID&rootId=$ROOT_ID" | jq -r $JQ_AREAS
# 获取国内全部省份
curl "$BASE_URL/getDasByDaCatalogId?daCid=a10dceae75d245008bf4b9a0e6fe1d55" | jq -r $JQ_AREAS
# 获取国内大中城市
curl "$BASE_URL/getDasByDaCatalogId?daCid=44016f1bffeb4ea49fe34e100c6415fb" | jq -r $JQ_AREAS
# 获取统计数据 - 多地区
curl "$BASE_URL/stream/esData" \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Referer: https://data.stats.gov.cn/dg/website/page.html' \
--data-raw '{
"cid": "分类NODE_ID(isLeaf==true)",
"indicatorIds": ["指标ID"],
"daCatalogId": "",
"das":[{"text":"上海市","value":"310000000000"},{"text":"北京市","value":"110000000000"}],
"showType": "3",
"dts": ["202301MM-202512MM"],
"rootId": "根节点ROOT_ID"
}' | jq -r '
.data[] |
.name as $year |
.values[] |
[$year, ._name, .value // "-", .du_name] |
@tsv
'
# 全局数据查询
curl -G "$BASE_URL/query?code=&pagenum=1&pageSize=15" \
--data-urlencode 'search=<中文关键词>' \
-H 'client: pc' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Referer: https://data.stats.gov.cn/dg/website/page.html' \
| jq -r '.data | {types,count}, (.data[] | {cid,indic_id,show_name,da_name,da,dt,dt_type,value,explain})'
常用数据
# 大中城市住宅销售价格指数
curl "$BASE_URL/new/queryIndicatorsByCid?cid=3eb43764c74741469b745c396cf002d1&dt=&name=" | jq -r $JQ_INDICATORSCurrent listing version
0.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供国家统计局官方公开数据查询能力,覆盖经济、CPI、GDP、人口、房价指数等高频刚需数据
- 具有明确实际使用价值和广泛受众
Highlights
- 触发词精准完整,覆盖多种经济数据查询场景,边界清晰
Areas to improve
-
缺少 When to Use/示例章节 Reported severity: Minor
文档结构清晰但缺少 When to Use 章节和端到端完整示例
Recommendation: 建议补充 When to Use 章节和端到端完整示例,提升用户理解
Highlights
- 文档结构清晰,frontmatter 完整,常用数据示例实用
Areas to improve
-
缺少网络异常处理 Reported severity: Minor
未显式处理网络请求失败、JSON解析错误等异常情况
Recommendation: 建议增加网络异常处理机制,提升执行可靠性
Highlights
- 工具来源明确(国家统计局官方API),参数说明清晰,覆盖主要异常(如空值处理)
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- data.stats.gov.cn
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
BASE_URL='https://data.stats.gov.cn/dg/website/publicrelease/web/external' JQ_INDICATORS='.data | {total}, (.list[] | {_id, type, chart_style_text, i_showname})' JQ_AREAS='.data[] | [.name_value,.name_text] | @tsv'
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.