What is this?
China's administrative divisions at five levels — provinces, cities, counties, towns and villages — each with its official statistics code and name, provided as JSON, CSV and SQLite files.
Is it a library I install, or just data files?
Just data, not a library: one flat JSON and CSV file per level, plus pre-linked cascade files and a data.sqlite database — nothing to install and no dependencies.
How do I get the data?
Download the JSON or CSV files for the levels you need straight from the repo, or grab the full bundle from Releases; all the data also comes as a ready data.sqlite file.
Do I need Node.js or any other runtime to use it?
No — plain JSON, CSV and SQLite files can be read from any language or tool; Node.js is only needed to run the repo's own fetch and build scripts.
Is the data still being updated?
No — the data is frozen at the 2023 edition (cutoff June 30, 2023) because the National Bureau of Statistics stopped publishing the division codes in October 2024, so anything newer is missing.
Where does the data come from?
From China's National Bureau of Statistics — its statistical division codes and urban-rural classification codes, the same codes government statistics work is based on; the repo mirrors their 2023 edition.
How are the five levels linked together?
Each record carries a 12-digit code plus its parents' codes (provinceCode, cityCode, areaCode, streetCode), and cascade files bundle two to four levels (pc, pca, pcas) in a plain and a code-annotated version; there is no ready-made five-level cascade.
Are these codes the same as postal codes?
No — they are statistical division codes from the National Bureau of Statistics, not postal codes. The codes are hierarchical: each level extends its parent's code, which is what makes the cascade files nest cleanly.
What do people typically build with this dataset?
Mostly cascading address pickers — pick a province, then city, district, town and village — for web or mobile forms, plus data work that needs official division codes, like cleaning addresses or aggregating statistics by region.
What are similar projects?
exercises-dataset, datasette, real-api-pricing, prediction-market-analysis, COVID-19, drawdb, redash, orm