Developer docs

Bring yearbook data into
your research workflow

Query long-term indicators, yearbook editions, and complete two-dimensional tables through a stable HTTP API—with definitions, versions, and official sources.

Create API keyAPI reference
Quickstart

Your first request takes three steps

Try core metrics anonymously; use shdata browser authorization for complete data or a Bearer API key on servers.

01

Try the public scope

Query six core metrics and recent yearbooks without a key; responses identify preview limits.

Install shdata CLI
02

Choose authentication

Run shdata login locally; on servers save a Professional key as SHDATA_API_KEY.

03

Send the request

Call an endpoint under the API base URL and inspect meta.truncated.

First request

Read the gross regional product series

All three examples return the same metric definition, 2015–2024 values, statistical definitions, and annual sources.

export SHDATA_API_KEY="sdo_请替换为你的密钥"


curl --request GET \
  --url "https://shdata.watch/api/v1/data/metrics/gdp?fromYear=2015&toYear=2024" \
  --header "Authorization: Bearer $SHDATA_API_KEY"
Response shape200 OK
{
  "data": {
    "metric": {
      "id": "gdp",
      "label": "地区生产总值",
      "topic": "经济总量",
      "unit": "亿元",
      "firstYear": 1978,
      "lastYear": 2024,
      "observationCount": 47
    },
    "series": [
      {
        "year": 2024,
        "value": 53926.71,
        "editionYear": 2025,
        "sourcePageId": "C0301-51a44e58",
        "sourceUrl": "https://tjj.sh.gov.cn/..."
      }
    ]
  },
  "meta": {
    "sourceVersion": "catalog-v1-...",
    "generatedAt": "..."
  }
}