cn-stats
Solid中国国家统计局公开数据查询技能,当用户想查询经济、CPI、GDP、人口、房价指数等数据时触发。
AI & Automation 146 stars
18 forks Updated 1 weeks ago MIT
Install
Quality Score: 83/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# 国家统计局
```bash
# 全局环境变量
BASE_URL='https://data.stats.gov.cn/dg/website/publicrelease/web/external'
# 获取指标分类根节点ID
ROOT_ID=$(curl "$BASE_URL/new/queryIndexTreeAsync?pid=&code=1" | jq -r '.data[0]._id')
# code: {1:月度数据, 2:季度数据, 3:年度数据, 4:分省月度数据, 5:分省季度数据, 6:分省年度数据}
# {7:主要城市月度价格, 8:主要城市年度数据, 9:港澳台月度数据, 10:港澳台年度数据}
# {12:三大经济体月度数据, 13:国际市场月度商品价格, 14:主要国家年度数据}
# 获取指标分类子节点
curl "$BASE_URL/new/queryIndexTreeAsync?pid=$ROOT_ID&code=1" | jq -r '.data[] | {_id, name, type, isLeaf}'
# 获取指标列表
curl "$BASE_URL/new/queryIndicatorsByCid?cid=$NODE_ID&dt=&name="
# 搜索指标列表
curl "$BASE_URL/new/queryIndicatorsByCid" -G --data-urlencode "cid=&dt=&name=<关键词>&rootId=$ROOT_ID"
# 获取统计数据 - 多指标
curl "$BASE_URL/getEsDataByCidAndDt" \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Referer: https://data.stats.gov.cn/dg/website/page.html' \
--data-raw '{
"cid": "分类ID",
"indicatorIds": ["指标ID1","指标ID2"],
"daCatalogId": "",
"das": [{"text":"全国","value":"000000000000"}],
"showType": "1",
"dts": "",
"rootId": "根节点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 '.data[] | [.name_value,.name_text] | @tsv'
# 获取国内全部省份
curl "$BASE_URL/getDasByDaCatalogId?daCid=a10dceae75d245008bf4b9a0e6fe1d55" | jq -r '.data[] | [.name_value,.name_te...
Details
- Author
- aahl
- Repository
- aahl/skills
- Created
- 5 months ago
- Last Updated
- 1 weeks ago
- Language
- Python
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
cn-stats
中国国家统计局公开数据查询技能,当用户想查询经济、CPI、GDP、人口、房价指数等数据时触发。
5 Updated today
opencue AI & Automation Solid
tianqi
查询中国地区的天气预报,支持15天及逐小时预报、各种生活指数
146 Updated 1 weeks ago
aahl AI & Automation Listed
a-stock-value-check
每天检查沪深300「股债性价比」排名,按固定纪律返回"买 / 卖 / 不动"信号。数据来自 rich.jkgeekjk.xyz。 触发方式:/a-stock-value-check、「查一下性价比」「今天 A 股该买还是该卖」「A 股贵不贵」「帮我看看沪深300」「今天该加仓还是减仓」 Daily CSI 300 cost-performance (equity-bond value) check that returns a buy/sell/hold signal by a fixed discipline. Data from rich.jkgeekjk.xyz. Trigger: /a-stock-value-check, "check A-share valuation", "should I buy or sell CSI300 today", "is A-share expensive"
1 Updated 1 weeks ago
jkgeekJack