China Administrative Division Codes API (行政区划代码) avatar

China Administrative Division Codes API (行政区划代码)

Pricing

Pay per event

Go to Apify Store
China Administrative Division Codes API (行政区划代码)

China Administrative Division Codes API (行政区划代码)

Official PRC administrative division codes (行政区划代码, MCA) for 34 provinces, 333 prefectures, 2,847 counties and 38,699 townships. Look up and validate codes, search by Chinese or pinyin, list children or export with English names. No proxy, no personal data.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Wayne Blomfield

Wayne Blomfield

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

19 days ago

Last modified

Security

Limited permissions

Share

China Administrative Division Codes API (行政区划代码): Province, City, County, Town

Look up, validate, search and export every official administrative division code of the People's Republic of China (中华人民共和国行政区划代码): 34 provinces, 333 prefecture-level divisions, 2,847 county-level divisions and 38,699 township-level divisions (streets, towns, townships). Each row comes with its full parent chain, its type and an English / pinyin name.

The codes follow the Ministry of Civil Affairs (民政部) lists, the same codes used in GB/T 2260 style region codes, government forms, logistics address systems and Chinese statistics. Use it to clean address data, map Chinese region names to codes (or codes to names), build province → city → district pickers, or check whether a code is still valid after a boundary change.

  • ✅ Latest official list, including recent changes such as the new Liangjiang District (两江新区, 500157) in Chongqing (2025) and Cenling County (岑岭县, 653132) in Xinjiang (2026)
  • ✅ 4 levels: province (省级), prefecture (地级), county (县级) and township (乡级, 9-digit codes)
  • ✅ Validation: unknown codes come back as not_found, and codes abolished by an official notice come back as abolished with their successor and the notice URL (for example 江北区 500105 → 两江新区 500157)
  • ✅ Search in Chinese or pinyin: 朝阳, chaoyang, tianhe, optionally inside one province or city
  • ✅ English names and types: Tianhe District, Guangzhou City, Guangdong, Yanbian Korean Autonomous Prefecture, district / county_level_city / banner / subdistrict / town …
  • ✅ Accepts 2-, 4-, 6-, 9- and 12-digit codes (44, 4401, 440106, 441900003, 440106000000)
  • ⚡ No scraping, no proxy, no external calls at run time, no personal data; a lookup finishes in about a second on 256 MB

Who uses it

  • Cross-border e-commerce, logistics and ERP teams normalising Chinese addresses and region fields, or mapping province / city / district names to codes
  • Data engineers and analysts joining Chinese government or statistical datasets on region code (6-digit or 12-digit form)
  • App developers who need a current China province-city-district-town list for dropdowns and cascaders
  • AI agents and MCP clients answering "What is the region code of Tianhe District?" or "Which districts belong to Guangzhou?"

Operations

operationInputOutput (one row each)
lookup (default)codes: up to 1000 codesone row per input code, with status
searchquery (Chinese or pinyin), optional levels, within, limit (≤200)matching divisions, best match first
childrencode (empty = all provinces), optional recursive, maxLevelsub-divisions
listoptional levels, within, maxResults (≤50,000)a whole level, e.g. all counties of Guangdong
statsnone1 row with counts per level and type

levels accepts province, prefecture, county, township (or 1–4).

Example: look up and validate codes

Input:

{ "operation": "lookup", "codes": ["440106", "500157", "500105"] }

Output (first row):

{
"input": "440106",
"found": true,
"code": "440106",
"code12": "440106000000",
"name": "天河区",
"nameEn": "Tianhe District",
"pinyin": "tian he qu",
"level": 3,
"levelName": "county",
"type": "district",
"typeEn": "District",
"parentCode": "440100",
"parentName": "广州市",
"provinceCode": "440000",
"provinceName": "广东省",
"provinceNameEn": "Guangdong",
"prefectureCode": "440100",
"prefectureName": "广州市",
"countyCode": "440106",
"countyName": "天河区",
"fullName": "广东省广州市天河区",
"fullNameEn": "Tianhe District, Guangzhou City, Guangdong",
"childCount": 21,
"status": "active",
"dataVersion": "2026.1",
"path": [
{ "code": "440000", "name": "广东省", "level": 1 },
{ "code": "440100", "name": "广州市", "level": 2 },
{ "code": "440106", "name": "天河区", "level": 3 }
]
}

An abolished code:

{
"input": "500105",
"found": false,
"code": "500105",
"name": "江北区",
"status": "abolished",
"abolished": "2025-11",
"replacedBy": [{ "code": "500157", "name": "两江新区" }],
"notice": "http://mzj.cq.gov.cn/zwgk_218/zfxxgkml/tzgg/202512/t20251205_15215632.html"
}

status is active, abolished, not_found or invalid_format. Bad codes never fail the run, so you can validate a whole column in one call.

Example: search by name or pinyin

{ "operation": "search", "query": "chaoyang", "levels": ["county"], "limit": 3 }

Returns 北京市朝阳区 110105 (Chaoyang District, Beijing), 辽宁省朝阳市朝阳县 211321 and 吉林省长春市朝阳区 220104. Add "within": "110000" to search only inside Beijing.

Example: children of a city

{ "operation": "children", "code": "440100" }

Returns the 11 districts of Guangzhou. Use "recursive": true with "maxLevel": 4 to get the districts and all their streets and towns.

Example: export all counties of a province

{ "operation": "list", "levels": ["county"], "within": "440000", "maxResults": 5000 }

Download the dataset as JSON, CSV, Excel or XML from the run's Storage tab or the API.

How the codes work

  • Province xx0000, prefecture xxxx00, county xxxxxx (6 digits); township = county code + 3 digits (9 digits). Rules: MCA Measures for the Administration of Administrative Division Codes (民政部令第79号, 2025).
  • Districts of the four municipalities (Beijing, Tianjin, Shanghai, Chongqing) and county-level cities directly under a province (e.g. 五指山市 469001, 仙桃市 429004) have the province as parentCode. Prefecture-level cities without counties (东莞 441900, 中山 442000, 儋州 460400, 嘉峪关 620200) have townships directly below them.
  • code12 pads the code to 12 digits for joining with NBS-style statistical codes (统计用区划代码).

Data sources and accuracy

  • Source: administrative division codes of the Ministry of Civil Affairs of the PRC (民政部), published through the National Geographic Names Database (国家地名信息库, https://dmfw.mca.gov.cn/XzqhVersionPublish.html). The snapshot was assembled from two MIT-licensed open mirrors of that interface (kk-418/cn-division, netnr/zoning) and cross-checked: prefecture and county-level totals match the official MCA statistics (293 prefecture-level cities, 30 autonomous prefectures, 7 prefectures, 3 leagues; 976 districts, 398 county-level cities, 1,302 counties, 117 autonomous counties, 49 banners, 3 autonomous banners, 1 special district, 1 forestry district) once the 2025–2026 changes are applied.
  • Statistical-only codes are not included: NBS development-zone codes (e.g. 130171) and 市辖区 placeholder codes (e.g. 130101) are not administrative divisions.
  • Taiwan, Hong Kong and Macao appear as province-level rows only (710000, 810000, 820000), as in the MCA list.
  • English names: official names for provinces; other names are Hanyu Pinyin plus an English type word, with common place-name readings fixed (Lu'an, Xi'an, Chaoyang, Bengbu…). Ethnic autonomous areas use English ethnonyms (Hui, Korean, Mongol, Tibetan…).
  • The MCA publishes a full list every January (status as of 31 December) and provinces publish township changes every January and July. This Actor is updated after each release; dataVersion tells you which snapshot you got.
  • Reference data only. For legal or official use, confirm against the latest MCA publication.

Pricing

Pay per event:

  • Actor start: tiny fixed fee per run
  • Result: per row in the dataset (one per looked-up code, search hit, child or listed division)

Set a maximum charge per run and the Actor stops cleanly at the limit. Invalid input fails immediately and produces no results. Use levels, within and maxResults to export only what you need.

Use from an AI agent (MCP)

One clear purpose and a typed input schema, so MCP clients can call it through the Apify MCP server. Typical prompts: "What is the administrative code of Pudong New Area?", "List all districts of Shenzhen with codes", "Is 500105 still a valid Chinese region code?"

Limits

  • lookup: 1000 codes per run. search: 200 results. children / list: up to 50,000 rows (maxResults, default 1000).
  • Mainland administrative divisions only; no postal codes, coordinates or boundaries.

Changelog

  • 0.1: first release. MCA codes for all 4 levels (status 2026), lookup / validate / search / children / list / stats, English and pinyin names, abolished-code mapping for Chongqing's 2025 reorganisation.