China Data API Docs

Free JSON and CSV endpoints for China's official government statistics. No authentication required.

Developer quick start

Fetch China GDP, trade, population, and CPI in one request.

Use the JSON endpoint for apps and charts, or append ?format=csv for spreadsheet-friendly downloads. Need the official raw NBS endpoint details? See the data.stats.gov.cn API guide.

Base URL

https://chinadata.live/api/v2

Try it now

curl https://chinadata.live/api/v2/data/china-gdp
curl -L "https://chinadata.live/api/v2/data/china-gdp?format=csv"

Get Dataset

GET /data/:dataset_id?format=csv

Returns metadata and all data points for a specific dataset in JSON. Add ?format=csv for CSV output.

Example Request

curl https://chinadata.live/api/v2/data/china-gdp
curl -L "https://chinadata.live/api/v2/data/china-gdp?format=csv"

Example Response

{
  "success": true,
  "data": {
    "id": "china-gdp",
    "slug": "china-gdp",
    "title": "GDP (Gross Domestic Product)",
    "category": "Economy",
    "description": "China's annual GDP in current prices (100M CNY), 1960 to 2025. Source: World Bank / NBS.",
    "source": "World Bank / National Bureau of Statistics",
    "unit": "100 Million CNY",
    "frequency": "yearly",
    "tags": ["economy", "gdp", "growth"],
    "isComparison": false,
    "data": [
      { "date": "1960", "value": 1473.3 },
      { "date": "2000", "value": 101308.6 },
      { "date": "2025", "value": 1401879 }
    ]
  }
}

Python

import requests

response = requests.get('https://chinadata.live/api/v2/data/china-gdp')
dataset = response.json()['data']

print(f"Dataset: {dataset['title']}")
print(f"Unit: {dataset['unit']}")
for point in dataset['data'][-5:]:  # last 5 years
    print(f"  {point['date']}: {point['value']}")

Python + pandas

import requests
import pandas as pd

response = requests.get('https://chinadata.live/api/v2/data/china-gdp')
dataset = response.json()['data']

df = pd.DataFrame(dataset['data'])
df['date'] = pd.to_numeric(df['date'])
df['value'] = pd.to_numeric(df['value'])
df = df.set_index('date')

print(df.tail(10))
# df.plot(title=dataset['title'])

JavaScript / Node.js

const res = await fetch('https://chinadata.live/api/v2/data/china-gdp');
const { data } = await res.json();

console.log(data.title, data.unit);
data.data.slice(-5).forEach(({ date, value }) => {
  console.log(`${date}: ${value}`);
});

List All Datasets

GET /datasets

Returns a list of all available datasets with metadata (no data points).

Example Request

curl https://chinadata.live/api/v2/datasets

Example Response

{
  "success": true,
  "data": [
    {
      "id": "china-gdp",
      "slug": "china-gdp",
      "title": "GDP (Gross Domestic Product)",
      "category": "Economy",
      "description": "China's annual GDP in current prices (100M CNY), 1960 to 2025.",
      "unit": "100 Million CNY",
      "frequency": "yearly",
      "tags": ["economy", "gdp"]
    },
    ...
  ]
}

Python — fetch all datasets

import requests

response = requests.get('https://chinadata.live/api/v2/datasets')
datasets = response.json()['data']

print(f"Total datasets: {len(datasets)}")
for ds in datasets:
    print(f"  {ds['id']:30s} {ds['category']}")

JavaScript

const res = await fetch('https://chinadata.live/api/v2/datasets');
const { data } = await res.json();

const economy = data.filter(ds => ds.category === 'Economy');
console.log('Economy datasets:', economy.map(ds => ds.id));

FAQ

Do I need an API key?

No. The API is completely free and requires no authentication or registration.

Is there a rate limit?

We recommend keeping requests under 100/minute for fair use. No hard limit enforced.

What response format is used?

All endpoints return JSON. Dates are strings (e.g. "2023"), values are numbers.

Can I download raw CSV data?

Yes — visit any dataset page and click the download button, or call the dataset endpoint with ?format=csv, for example https://chinadata.live/api/v2/data/china-gdp?format=csv.

Ready to Start?

No sign-up. No API key. Just fetch and use.

Need higher limits or custom data?

Commercial API access, bulk exports, custom datasets, and dedicated support available.

Contact Us →
💬 Need custom data?