# China Statistics Database API: NBS GDP, CPI & Province Data (`sinodata/china-statistics-database`) Actor

Any of 3,300+ tables from China's National Bureau of Statistics database (国家数据), in Chinese and English: GDP, prices, industry, trade, investment, population and more, national, by province and for 36 cities. Monthly, quarterly and annual history. No login.

- **URL**: https://apify.com/sinodata/china-statistics-database.md
- **Developed by:** [SinoData](https://apify.com/sinodata) (community)
- **Categories:** Other
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 1,000 values

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## China Statistics Database API: NBS GDP, CPI & Province Data

Get **any table from China's National Bureau of Statistics database (国家数据, data.stats.gov.cn)** as clean JSON or CSV, with **English names** next to the Chinese ones. No login, no API key, no browser.

- **3,300+ tables**: national accounts (GDP), prices (CPI, PPI), industry, energy, investment, real estate, retail, trade, finance, population, employment, wages, agriculture, education and more
- **National, by province and for 36 major cities**
- **Monthly, quarterly and annual**, with long history (annual series reach back decades)
- **Chinese and English** table, indicator and region names
- **Browse the catalog** for free with **List tables**
- **Only new data** mode for scheduled runs

### Use cases

- **Economists and analysts**: pull official Chinese macro data into Python, R, Excel or a dashboard without copying tables by hand.
- **Investors**: GDP, industrial output, retail sales, property investment and prices as soon as NBS publishes them.
- **Market research**: compare provinces and cities on income, consumption, population or output.
- **AI and data pipelines**: a reliable, structured source for China statistics with stable IDs.

### How to use

1. Turn on **List tables** and type a word in **Tables** (e.g. `GDP`, `居民消费价格`, `Retail`) to see matching tables, or leave Tables empty to list a whole section.
2. Put the table names (or IDs) you want in **Tables**, choose the **Sections**, and run.
3. Optionally narrow down with **Indicators** (any indicator whose name contains the word, e.g. `累计增长` or `Accumulated`) and **Provinces or cities** (e.g. `广东`, `Beijing`), and set a history range.

### Example input

GDP, the latest 8 quarters:

```json
{
  "tables": ["国内生产总值 (现价)"],
  "sections": ["quarterly"],
  "latestPeriods": 8
}
```

Monthly CPI by province since 2026, for two provinces:

```json
{
  "tables": ["居民消费价格分类指数 (上年同月=100) (2026-)"],
  "sections": ["provinceMonthly"],
  "regions": ["广东", "Beijing"],
  "indicators": ["居民消费价格指数 (上年同月=100)"],
  "periodFrom": "2026-01"
}
```

### Output

One record per value (indicator × region × period):

```json
{
  "table": "国内生产总值 (现价)",
  "tableEnglish": "Gross Domestic Product (Current Price)",
  "indicator": "国内生产总值当季值 (亿元)",
  "indicatorEnglish": "Gross Domestic Product, Current Quarter (100 million yuan)",
  "region": "全国",
  "regionEnglish": "China",
  "regionCode": "000000000000",
  "period": "2026-Q3",
  "frequency": "quarter",
  "value": 375367.2,
  "unit": "亿元",
  "section": "quarterly",
  "tablePath": "季度数据 > 国民经济核算 > 国内生产总值 (现价)",
  "tableId": "28d936104e304aa191e338eb82b6dc09",
  "source": "National Bureau of Statistics of China (data.stats.gov.cn)"
}
```

- `period` is `2026` for years, `2026-09` for months and `2026-Q3` for quarters.
- Values are exactly as published. Index tables say their base in the name, e.g. `(上年同月=100)` means the same month last year = 100, so 100.9 is +0.9% year on year.
- Empty cells (not yet published, or not collected for that region) are skipped and not charged.
- With **List tables**, each record is a table: ID, section, frequency, Chinese and English path.

### Pricing

**$0.001 per value ($1 per 1,000).** Listing tables is free. Quarterly GDP for 8 quarters (about 260 values) costs about $0.26; one indicator for all 31 provinces over 10 years about $0.31.

Tip: use **Indicators** and **Provinces or cities** to get only the values you need.

### Notes and limits

- NBS reorganises tables when a base year or classification changes, so one series can be split across tables such as `(2016-2020)` and `(2021-2025)`. Search with List tables to find all of them.
- The site limits fast clients, so the Actor sends requests one at a time; large requests take a few minutes.
- Official figures as published; this Actor does not calculate or adjust anything. Only public data is collected.

### Related

- [China CPI, PPI & PMI](https://apify.com/sinodata/china-cpi-ppi-pmi): the monthly releases with English component names, ready to use.
- [China Commodity Prices](https://apify.com/sinodata/china-commodity-prices) and [China House Price Index](https://apify.com/sinodata/china-house-price-index).

### 中文说明

国家统计局“国家数据”数据库接口，无需登录：3,300 多张表，覆盖国民经济核算、价格、工业、投资、房地产、消费、外贸、人口、就业、工资等，包括全国、分省和 36 个主要城市的月度、季度和年度数据，中英文名称对照。可先用“List tables”免费查看表目录，再按表名、指标、地区和时间范围获取数据。每个数值 0.001 美元，可在 Apify 上直接运行或通过 API 调用，也可设置定时任务。有问题请在 Issues 页面留言（中文、英文均可）。

### Feedback

Need a table that's missing or another field? Open an issue on the Issues tab.

# Actor input Schema

## `tables` (type: `array`):

Table names in Chinese or English (e.g. 国内生产总值 (现价), Gross Domestic Product, 居民消费价格指数), or table IDs. A name can match several tables; turn on List tables to browse the catalog first.

## `sections` (type: `array`):

Which parts of the database to search: national, by province or for major cities, monthly, quarterly or annual.

## `indicators` (type: `array`):

Optional: only indicators whose name contains one of these words (Chinese or English). Leave empty for every indicator in the table.

## `regions` (type: `array`):

For province and city sections: names in Chinese or English (e.g. 广东, Beijing). Leave empty for all.

## `latestPeriods` (type: `integer`):

How many of the most recent months, quarters or years to get. Ignored when you set a period range.

## `periodFrom` (type: `string`):

Start of a period range: 2015 for years, 2020-01 for months, 2020-Q1 for quarters. A bare year works for every frequency.

## `periodTo` (type: `string`):

End of the range, in the same format. Leave empty for up to the latest data.

## `maxTables` (type: `integer`):

Upper limit on tables per run when your names match many tables.

## `listTables` (type: `boolean`):

Only list the tables (ID, section, Chinese and English path) whose name matches Tables, or every table in the chosen sections if Tables is empty. Free.

## `skipUnchanged` (type: `boolean`):

For scheduled runs: skip (and don't pay for) values you already saved in a previous run.

## `refreshCatalog` (type: `boolean`):

Read the table list live from the site instead of the built-in copy (adds a few minutes). Only needed if a new table is missing.

## Actor input object example

```json
{
  "tables": [
    "国内生产总值 (现价)"
  ],
  "sections": [
    "monthly",
    "quarterly",
    "annual"
  ],
  "latestPeriods": 8,
  "maxTables": 10,
  "listTables": false,
  "skipUnchanged": false,
  "refreshCatalog": false
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "tables": [
        "国内生产总值 (现价)"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("sinodata/china-statistics-database").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "tables": ["国内生产总值 (现价)"] }

# Run the Actor and wait for it to finish
run = client.actor("sinodata/china-statistics-database").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "tables": [
    "国内生产总值 (现价)"
  ]
}' |
apify call sinodata/china-statistics-database --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sinodata/china-statistics-database"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Wv52CFPPenEYagVtO/builds/I2i33YdGmsjx2hRug/openapi.json
