Administrative region parsing

Updated at:

This operation parses a full address and returns the corresponding administrative region and division code.

Test

You can perform an API test in the Address Purification console.

Request parameters

Name

Type

Required

Example

Description

Action

String

Yes

GetAddressDivisionCode

A required parameter. Set the value to GetAddressDivisionCode.

AppKey

String

Yes

Axqwerasdf1a

The AppKey of your project.

ServiceCode

String

Yes

addrp

Static field: addrp

Text

String

Yes

No. 969, Wenyi West Road, Hangzhou

The text content.

DefaultProvince

String

No

Zhejiang Province

The default province.

DefaultCity

String

No

Hangzhou

The default city.

DefaultDistrict

String

No

Yuhang District

The default administrative region.

Response data

Name

Type

Example

Description

Data

String

{"division_info":{"divcode":"330100000000","division_name":"Zhejiang Province Hangzhou"},"time_used":{"rt":{"division_info":"0.005276203155517578","complete":"0.022394180297851562","structure":"0.006552696228027344"},"start":"1589800407.0037742"},"status":"OK"}

division_info: The administrative region information.

divcode: The administrative region code.

division_name: The administrative region name.

time_used: The time consumed by the algorithm.

status: The status.

RequestId

String

F726DC5F-67A1-4FBF-B216-758D1A681B8A

RequestId

Examples

Request example

http(s)://[Endpoint]/?Action=GetAddressDivisionCode
&AppKey=Axqwerasdf1a
&ServiceCode=addrp
&Text=No. 969, Wenyi West Road, Hangzhou
&<Common request parameters>

Successful response example

XML format

<RequestId>F726DC5F-67A1-4FBF-B216-758D1A681B8A</RequestId>
<Data>
    <division_info>
        <divcode>330100000000</divcode>
        <division_name>Zhejiang Province Hangzhou</division_name>
    </division_info>
    <time_used>
        <rt>
            <division_info>0.005276203155517578</division_info>
            <complete>0.022394180297851562</complete>
            <structure>0.006552696228027344</structure>
        </rt>
        <start>1589800407.0037742</start>
    </time_used>
    <status>OK</status>
</Data>

JSON format

{
  "RequestId": "F726DC5F-67A1-4FBF-B216-758D1A681B8A",
  "Data": {
    "division_info": {
      "divcode": "330100000000",
      "division_name": "Zhejiang Province Hangzhou"
    },
    "time_used": {
      "rt": {
        "division_info": "0.005276203155517578",
        "complete": "0.022394180297851562",
        "structure": "0.006552696228027344"
      },
      "start": "1589800407.0037742"
    },
    "status": "OK"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

403

Forbidden.NoAuth

Failed to perform user authentication.

User authentication failed.

500

InternalError

A service error occurred.

An internal service error occurred.

400

InvalidParameter

The parameter is invalid.

The parameter is invalid.

404

ResourceDoesNotExist

The resource does not exist.

The resource does not exist.

429

Throttling.User

Flow control has been triggered.

Throttling is triggered.

400

UserStatusInvalid

The user status is invalid.

The user status is invalid.

For more error codes, see the Error Center.