Discover/data.stats.gov.cn API
live

data.stats.gov.cn APIdata.stats.gov.cn

Access China NBS economic and social statistics: GDP, money supply, price indices, population, and provincial data via 7 structured endpoints.

Endpoints
7
Updated
3mo ago
Try it
Database code (e.g., 'hgyd' for national monthly, 'fsnd' for provincial annual)
Dimension code: 'zb' (indicators), 'reg' (regions), 'sj' (time)
Parent ID to drill down into (empty for root)
api.parse.bot/scraper/c388b348-261a-4275-a2a9-53ecd8ac542b/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Use it in your codegrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/c388b348-261a-4275-a2a9-53ecd8ac542b/get_indicator_tree?dbcode=hgyd&wdcode=zb' \
  -H 'X-API-Key: $PARSE_API_KEY'
All endpoints · 7 totalclick to expand

Browse the hierarchical tree of indicators, regions, or time periods. Use this to discover IDs for querying data.

Input
ParamTypeDescription
dbcoderequiredstringDatabase code (e.g., 'hgyd' for national monthly, 'fsnd' for provincial annual)
wdcodestringDimension code: 'zb' (indicators), 'reg' (regions), 'sj' (time)
parent_idstringParent ID to drill down into (empty for root)
Response
{
  "type": "array",
  "fields": {
    "id": "string",
    "pid": "string",
    "name": "string",
    "dbcode": "string",
    "wdcode": "string",
    "isParent": "boolean"
  },
  "sample": {
    "data": [
      {
        "id": "A01",
        "pid": "",
        "name": "价格指数",
        "dbcode": "hgyd",
        "wdcode": "zb",
        "isParent": true
      },
      {
        "id": "A02",
        "pid": "",
        "name": "工业",
        "dbcode": "hgyd",
        "wdcode": "zb",
        "isParent": true
      },
      {
        "id": "A03",
        "pid": "",
        "name": "能源",
        "dbcode": "hgyd",
        "wdcode": "zb",
        "isParent": true
      }
    ],
    "status": "success"
  }
}

About the data.stats.gov.cn API

This API exposes 7 endpoints for querying official statistical data published by China's National Bureau of Statistics (NBS), covering national and provincial economic indicators, demographic data, and time-series figures. The get_indicator_tree endpoint lets you navigate the full hierarchy of indicator codes before running targeted queries, while get_money_supply surfaces M0, M1, and M2 figures directly with a configurable month limit.

What the API Covers

The API wraps the NBS public data platform at data.stats.gov.cn, giving structured access to China's official macroeconomic and social statistics. Indicators span GDP, money supply (M0/M1/M2), price indices, population figures, and education statistics. Data is organized across multiple databases — for example, hgyd for national monthly data and fsnd for provincial annual data — and the API exposes both national-level and all-31-province breakdowns.

Navigating Indicators and Regions

The get_indicator_tree endpoint accepts a dbcode, an optional wdcode dimension (zb for indicators, reg for regions, sj for time), and an optional parent_id to drill into sub-nodes. Each node in the response includes id, pid, name, dbcode, wdcode, and isParent, making it straightforward to traverse from root categories down to specific leaf indicator codes. Pair this with get_regions (returns id and name for provinces or cities) and get_time_periods (available period codes for a given database) to assemble the exact filter parameters needed for a data query.

Querying Data

The query_data endpoint accepts wds (fixed dimension filters as a JSON list, e.g. locking an indicator code) and dfwds (display filters, e.g. LAST10 for the ten most recent periods), along with rowcode and colcode to control result orientation. Responses contain wdnodes (dimension metadata) and datanodes (the actual values). The get_provincial_data endpoint simplifies a common pattern: supply an indicator_code like A020101 for Regional GDP and an optional limit for recent years, and it returns region-by-year data for all provinces in the same wdnodes/datanodes structure. search_indicators supports keyword lookup in Chinese or English and returns paginated results with a pagecount field.

Indicator Discovery

Because the NBS data catalog uses opaque numeric and alphanumeric codes, the discovery flow matters: use search_indicators to find candidate indicator codes by keyword, confirm the right dbcode via get_indicator_tree, then pass those codes into query_data or get_provincial_data. The get_time_periods endpoint is useful when you need to confirm which periods are actually populated for a given database before constructing a time-series query.

Common use cases
  • Track quarterly GDP growth trends by querying national and provincial indicator codes over multi-year time series.
  • Monitor M0, M1, and M2 money supply changes month-over-month using get_money_supply with a rolling window.
  • Build cross-province economic comparison dashboards using get_provincial_data for indicators like Regional GDP.
  • Discover and map the full NBS indicator hierarchy programmatically with get_indicator_tree for automated catalog indexing.
  • Search NBS datasets by keyword (e.g. '居民消费价格' or 'CPI') via search_indicators to identify relevant indicator codes.
  • Retrieve province and city-level region codes via get_regions to filter multi-dimensional queries by geography.
  • Automate ingestion of official Chinese economic releases into data pipelines using structured datanodes responses.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000250 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does data.stats.gov.cn have an official developer API?+
The NBS does not publish a documented public REST API for developers. The data.stats.gov.cn website is intended for manual browsing and data downloads rather than programmatic access.
What does `query_data` return and how do I filter it?+
It returns two arrays: wdnodes, which contains dimension metadata describing the axes of the result, and datanodes, which holds the actual statistical values. You filter using wds (fixed dimensions, e.g. locking a specific indicator code) and dfwds (display filters, e.g. LAST10 to retrieve the ten most recent periods). Set rowcode to zb for indicator rows or reg for region rows, and colcode to sj for time columns.
Does the API cover city-level or county-level data below the provincial level?+
The API currently exposes national-level and province-level data across all 31 provinces, plus region-code navigation via get_regions with a parent_id parameter. Sub-provincial city or county breakdowns are not currently returned by these endpoints. You can fork the API on Parse and revise it to add queries targeting finer administrative divisions if the underlying NBS database supports them for a given indicator.
How current is the data, and how often is it updated?+
The data reflects what NBS publishes on data.stats.gov.cn at the time of a request. NBS releases national monthly figures (GDP flash, money supply, CPI) on a fixed release calendar, typically within three to four weeks after the reference month ends. Annual provincial data is usually published in the first quarter of the following year. There is no real-time or intraday feed.
Can I retrieve historical data beyond what `LAST10` covers, or get full time-series going back decades?+
The dfwds filter supports range and recency codes including LAST10 for the ten most recent periods. Older historical depth depends on what each specific dbcode database holds; not all indicators have decades of data available. For indicators with limited depth in the current databases, you can fork the API on Parse and revise it to target additional NBS database codes or alternative historical tables.
Page content last updated . Spec covers 7 endpoints from data.stats.gov.cn.
Related APIs in Government PublicSee all →
identify.plantnet.org API
Identify and explore plant species by searching through Pl@ntNet's comprehensive botanical database to access detailed information like taxonomic families, genera, species descriptions, photos, and community observations. Track plant distributions, view contribution trends, and discover expert contributors within the platform's collaborative plant identification community.
data.lime.bike API
Access real-time availability data for Lime bikes and scooters, including station locations, vehicle status, system alerts, and geofencing zones across multiple cities. Monitor micromobility inventory and service information to find nearby vehicles or plan your trips effectively.
accessdata.fda.gov API
Search and retrieve comprehensive FDA premarket approval information for medical devices, including approval status, supplements, applicant details, and advisory committee data. Get instant access to specific PMA records with all relevant approval information in one place.
eprocurement.gov API
Monitor India's public procurement opportunities by accessing active tenders, bids closing today, global tenders, high-value contracts, and cancelled tenders from the Central Public Procurement Portal. Search tender details, browse participating organizations, and track real-time procurement statistics to stay informed on government contracting opportunities.
cmegroup.com API
Get CME Group market data including FedWatch interest-rate probabilities, futures quotes and settlements, volume/open interest history, and options expirations and near-the-money option chains.
alienvault.com API
Search and analyze global threat intelligence data including indicators of compromise, threat pulses, and adversary profiles from the Open Threat Exchange community. Monitor recent security alerts and access detailed information about threats and adversaries to strengthen your cybersecurity defenses.
api.nasa.gov API
Access NASA's suite of open data APIs — including the Astronomy Picture of the Day, Near Earth Object tracking, DONKI space weather events, EPIC Earth imagery, Mars weather, the NASA Image and Video Library, the Exoplanet Archive, and EONET natural events.
mahatenders.gov.in API
Access Maharashtra government tenders from mahatenders.gov.in, browsing them by closing date or by organization with full tender details and pagination support. Find and review procurement opportunities across different government departments in one place.