China Statistics Data Query (cn-stats)
Queries China's National Bureau of Statistics public API (data.stats.gov.cn) with curl + jq to pull GDP, CPI, population and housing price index data.
Data & AnalyticsIntermediate★ 160⑂ 20AI score 8/10Last updated: Sep 15, 2026
What it does
- Teaches Claude to hit the public API endpoints behind China's official statistics portal
data.stats.gov.cn. - Documents the indicator-tree codes (1–14): monthly, quarterly, annual, by-province, major-city prices, HK/Macao/Taiwan, and cross-country comparisons.
- Provides the full call chain: browse categories → search indicators → fetch region lists → query actual values.
- Uses
jqto flatten JSON responses into TSV (year / indicator / value / unit) that drops straight into tables or analysis.
Who it's for
- Analysts, researchers and journalists tracking Chinese macro data, CPI and the property market.
- Trade, export and market-strategy teams that need official source statistics.
- Data engineers who prefer a public API over brittle web scraping.
Examples
- "Build a table of China's monthly CPI for the last three years" → resolve the monthly root node, then call
stream/esDatawith202301MM-202512MM. - "Compare residential sales price indices for Beijing and Shanghai" → pull city codes (110000000000, 310000000000) from the major-cities list and run a multi-region query.
- "Search indicators for '常住人口' (permanent resident population) and fetch the annual series" → indicator search API plus the annual-data root node.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/aahl/skills/HEAD/skills/cn-stats/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/cn-stats folder from the GitHub repo aahl/skills into my ~/.claude/skills/cn-stats/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/aahl/skills.git && mkdir -p ~/.claude/skills && cp -r skills/skills/cn-stats ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Check prerequisites: run
curl --versionandjq --version. Install if missing (brew install jqon macOS,sudo apt install jq curlon Ubuntu). - Create the skills folder:
mkdir -p ~/.claude/skills - Clone the repo:
git clone https://github.com/aahl/skills.git - Copy just this skill:
cp -r skills/skills/cn-stats ~/.claude/skills/ - Restart Claude Code and try a prompt like "Get China's CPI for the last 12 months".
- If calls fail, the portal's API may have changed — inspect data.stats.gov.cn in your browser's Network tab and update the endpoints in
SKILL.md.
View source on GitHub ↗License: MIT