API Documentation
Free REST API for China's official government statistics. No authentication required.
Base URL
https://chinadata.live/api/v2 Get Dataset
Returns metadata and all data points for a specific dataset.
Example Request
curl https://chinadata.live/api/v2/data/gdp
Example Response
{
"success": true,
"data": {
"id": "gdp",
"slug": "gdp",
"title": "China GDP",
"category": "Economy",
"description": "China's gross domestic product (GDP) in current USD",
"source": "World Bank, National Bureau of Statistics",
"unit": "Billion USD",
"frequency": "yearly",
"tags": ["economy", "gdp", "growth"],
"isComparison": false,
"data": [
{ "date": "1990", "value": 360.86 },
{ "date": "2000", "value": 1211.35 },
{ "date": "2023", "value": 17794.78 }
]
}
} Python
import requests
response = requests.get('https://chinadata.live/api/v2/data/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/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/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
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": "gdp",
"slug": "gdp",
"title": "China GDP",
"category": "Economy",
"description": "China's gross domestic product (GDP) in current USD",
"unit": "Billion USD",
"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)); Search Datasets
Full-text search across dataset titles, descriptions, and tags.
Parameters
| Parameter | Type | Description |
|---|---|---|
| q | string | Search query (required) |
Example Requests
curl "https://chinadata.live/api/v2/search?q=energy" curl "https://chinadata.live/api/v2/search?q=trade" curl "https://chinadata.live/api/v2/search?q=population"
Python
import requests
response = requests.get(
'https://chinadata.live/api/v2/search',
params={'q': 'energy'}
)
results = response.json()['data']
for ds in results:
print(f"{ds['id']}: {ds['title']}") 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 use the dataset page URL with /download.
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 →