Code for administrative divisions of the People’s Republic of China

Administrative divisions of the People’s Republic of China (five levels) : provincial, prefectural, county, township and village levels.

From the Ministry of Civil Affairs, PRC, a website for querying provincial, municipal and district data in China.

  • Code of administrative Division of the People’s Republic of China
  • Code for zoning and urban-rural division for statistics, updated at: 2019-01-31

Making: github.com/uiwjs/provi…

Data update Diff

  • Data Updated 2019-11-25
  • Data Update 2019-11-05
  • Data Update 2019-06-21

The installation

npm install province-city-china --save-dev
Copy the code

use

const { data, province, city, area, town } = require('province-city-china/data');
Copy the code
  • data– Total data (province/prefecture/county/township)
  • province– Provincial level (province/Municipality/Special Administrative Region)
  • city– Prefecture-level (city)
  • area– County level (District county)
  • town– Township level (Town/Street)

All the data

const provinces = require('province-city-china/dist/data.json');
// provinces Output ===>[{"code":"110000"."name":"Beijing"."province":"11"."city":0."area":0."town":0},
  {"code":"110101"."name":"Dongcheng District"."province":"11"."city":"01"."area":"01"."town":0},
  {"code":"110102"."name":"West Side"."province":"11"."city":"01"."area":"."."town":0},
  {"code":"110105"."name":"Chaoyang District"."province":"11"."city":"01"."area":"5"."town":0},... ]Copy the code

Rules:

  • Province - Provincial (province/municipality/Special Administrative Region)city=0.area=0.town=0
  • City - Prefecture level (city)area=0.town=0
  • Area - County leveltown=0Not for other0
  • Town - Village level (town/street)– All values are not0

North China 1, Northeast China 2, East China 3, South Central 4, southwest 5, northwest 6. For example, Hubei -> 42 begins with 4, indicating the central and southern regions.

Obtaining city data

const city = require('province-city-china/dist/city.json');
// city output ===>[{"code":"01"."name":"Shijiazhuang"."province":"13"},
  {"code":"."."name":"Tangshan city"."province":"13"},
  {"code":"3"."name":"Qinhuangdao city"."province":"13"},
  {"code":"04"."name":"Handan"."province":"13"},
  {"code":"5"."name":"Xingtai"."province":"13"},... ]Copy the code

Description:

  • code– City code
  • name– City name
  • province– Province/Municipality/Special Administrative Region code

More data

CDN resources can be downloaded by UNPKG: unpkg.com/province-ci…

File list JSON CSV SQL CDN
Total data (province/prefecture/county/township) data.json data.csv data.sql data.sql / csv / json
Provincial/prefecture/county/township level data level.json level.json
Provincial level (province/municipality/Special Administrative Region) province.json province.csv province.json / csv
Prefecture-level (city) city.json city.csv city.json / csv
County level (District) area.json area.csv area.json / csv
Township level (Town/Street) town.json town.csv town.json / csv

More CDN data access

  • Unpkg.com/province-ci…
  • Raw.githack.com/uiwjs/provi…
  • The CDN. Statically. IO/gh/uiwjs/pr…

Total data (province/prefecture/county/township)

data.json | data.csv | data.sql

[{"code": "110000"."name": "Beijing"."province": "11"."city": 0."area": 0."town": 0},]Copy the code

Provincial/prefecture/county/township level data