Document Web Service Guides Administrative Division Query

Administrative Division Query

Product Introduction

Administrative region query is a simple HTTP interface that helps users quickly find specific administrative region information based on their search criteria.

For example: Japan>Tokyo>Machida City.

Guidelines

1
Step 1
Apply for a 【Web Service API】Key
2
Step 2
Enable overseas permissions for the applied Key by submitting a ticket to request overseas permissions
3
Step 3
Construct the HTTP request URL, including the Key obtained in Step 1 as a required parameter
4
Step 4
Receive and parse the data returned from the HTTP request (in JSON or XML format)
Unless otherwise specified, all input parameters and output data are encoded in UTF-8

Administrative Division Query

Administrative Division Query API Service URL

URL

https://sg-restapi.opnavi.com/v5/district/global?parameters

Request Method

GET

The parameters represent both required and optional parameters. All parameters are separated by the 

ampersand character (&). The list below enumerates these parameters and their usage rules.

Request Parameters

Parameter Name

Description

Specification

Mandatory

Default

key

Service Authorization Token

Applying for a Web Service API Key and Submitting a Work Order for Overseas Permissions on Amap Map Official Website

Mandatory

None

keywords

Search keyword

Rule: Only single keyword search is supported. Keywords support: administrative region names.

For example, when subdistrict=1, searching for a country (e.g., Japan) will display level 2 administrative divisions (e.g., Tokyo).

Mandatory

None

subdistrict

Subordinate administrative region

Rule: Set the number of subordinate administrative levels to display (administrative levels include: level1=country, level2=province/municipality/state, level3=city, level4=district/county) 

Optional values: 0, 1, 2, etc. 

0: Do not return subordinate administrative regions; 

1: Return the next level of administrative regions; 

2: Return the next two levels of administrative regions;

Note: Different countries have different administrative division rules, based on the level (e.g., Japan: Tokyo, Toyama Prefecture, both belong to level2)

Optional

1

langCode

Return result language

Default is zh(Chinese),

optional: 

  • zh(Chinese)
  • en(English)
  • es(Spanish)
  • pt(Portuguese)
  • fr(French)
  • de(German)
  • th(Thai)
  • ja(Japanese)
  • ko(Korean)
  • ar(Arabic)
  • tr(Turkish)
  • he(Hebrew)
  • it(Italian)
  • ru(Russian)
  • ms(Malay)
  • id(Indonesian)
  • vi(Vietnamese)
  • pl(Polish)
  • cs(Czech)
  • uk(Ukrainian)
  • az(Azerbaijani)

Optional

en

page

Which page of data is needed

The outermost districts will return up to 20 data items. If the limit is exceeded, please use page to request the next page of data. For example: page=2; page=3. Default: page=1

Optional

1

offset

Number of outermost returned data

Optional

20

callback

Callback function

The callback value is the user-defined function name, this parameter is only valid when output=JSON

Optional

output

Return data format type

Optional value: JSON

Optional

JSON

Examples

https://sg-restapi.opnavi.com/v5/district/global?keywords=392000000&key=<your key>&subdistrict=1&LanguageCode=en

Response Parameters Description

Name

Description

Specification

status

Return result status value

0: Request failed; 1: Request succeeded

info

Return status description

When status is 0, info returns the reason for the error; otherwise, it returns 'OK'. For details, refer to the info status table.

infocode

Return Status Code

For details, refer to the infocode in the info status table: info status table

districts

Administrative Division List

district

Administrative Division Information

adcode

Area Code

9-digit Arabic 

number: 1~3 digits represent Level 1; 

4~5 digits represent Level 2; 

6~7 digits represent Level 3; 

8~9 digits represent Level 4;

name

Administrative division name

center

Regional center point

level

Administrative division level

Level 1: Country 

Level 2: Usually province, state 

Level 3: Usually city 

Level 4: Usually district

districts

List of subordinate administrative divisions, including district elements