Misc

Adcode Administrative Region Lookup (Domestic & International)

0calls
2 credits / call

One endpoint covering 243 countries and China’s four-level administrative hierarchy (province / city / district / subdistrict). Three query modes are supported (at least one parameter is required): keyword search, administrative-code lookup, and reverse-geocoding by coordinates.

GET
uapis.cn
/api/v1/misc/district
Query parameters
7
keywords
string

Keyword search across city and district names (Chinese and English).

adcode
string

Exact lookup by Chinese administrative code (e.g. 110000); the children regions are returned alongside the matched region.

lat
number

Latitude. Use together with lng to reverse-geocode the nearest regions.

lng
number

Longitude. Use together with lat.

level
string

Filter by administrative level.

country
string

Filter by country code (ISO 3166-1 alpha-2), e.g. CN, JP, US, GB.

limit
integer

Maximum number of results. Default 20, max 100.

Overview

The endpoint returns the matching administrative regions for the given inputs. For example: China > Shandong > Jinan > Lixia District > Shunhua Road Subdistrict.

No registration or API key required. Three query modes:

  • Pass adcode for exact lookup by administrative code; the children list is returned alongside the matched region.
  • Pass lat + lng to reverse-geocode and return the nearest regions.
  • Pass keywords for keyword search (Chinese and English).

Domestic vs international data

Chinese records include adcode and citycode and support drilling down through province / city / district / subdistrict. International records do not include these fields but additionally provide population and timezone.

Note

Some cities (e.g. Dongguan, Wenchang) skip the district level and place subdistricts directly under the city. The subdistrict-leveladcode returns the parent district’s adcode.

Query parameters

keywords
stringoptional

Keyword search across city and district names (Chinese and English).

adcode
stringoptional

Exact lookup by Chinese administrative code (e.g. 110000); the children regions are returned alongside the matched region.

lat
numberoptional

Latitude. Use together with lng to reverse-geocode the nearest regions.

lng
numberoptional

Longitude. Use together with lat.

level
stringoptional

Filter by administrative level.

country
stringoptional

Filter by country code (ISO 3166-1 alpha-2), e.g. CN, JP, US, GB.

limit
integeroptional

Maximum number of results. Default 20, max 100.

Response

200 / OK

Lookup succeeded. Returns the matching administrative regions.

JSON
{
  // Total number of results.
  "total": 2,
  // Result list.
  "results": [
    {
      // Region name.
      "name": "北京市",
      // Administrative level: `province`, `city`, `district`, or `street`.
      "level": "province",
      // Country name.
      "country": "中国",
      // ISO 3166-1 alpha-2 country code.
      "country_code": "CN",
      // Province/state (Chinese data) or first-level administrative division (international data).
      "province": "北京市",
      // City (Chinese data only).
      "city": "北京市",
      // District/county (Chinese data only).
      "district": "朝阳区",
      // Subdistrict/township (Chinese data only).
      "street": "三里屯街道",
      // Administrative code (Chinese data only).
      "adcode": "110000",
      // City area code (Chinese data only).
      "citycode": "010",
      // Centroid coordinates.
      "center": {
        "lat": 39.904987,
        "lng": 116.405289
      },
      // Population (international cities only).
      "population": 8336599,
      // Time zone (international cities only), e.g. `Asia/Tokyo`.
      "timezone": "Asia/Tokyo"
    }
  ]
}

400 / Bad Request

Invalid request.

JSON
{
  "code": "INVALID_PARAMETER",
  "message": "invalid 'level' parameter, must be one of: province, city, district, street"
}