Address correction

Updated at:

Corrects errors in address text, including province, city, district, and street information.

Test

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

Request parameters

Name

Type

Required

Example value

Description

Action

String

Yes

CorrectAddress

A required parameter. The value is `CorrectAddress`.

AppKey

String

Yes

Axqwerasdf1a

The AppKey for the project.

ServiceCode

String

Yes

addrp

A static field. The value is `addrp`.

Text

String

Yes

Yuhang District Wuzhang Street Lejia International

The text content.

DefaultProvince

String

No

Zhejiang Province

The default province.

DefaultCity

String

No

Hangzhou City

The default city.

DefaultDistrict

String

No

Yuhang District

The default administrative region.

Response data

Name

Type

Example

Description

Data

String

{ "address_correct": [

"Yuhang District=district Wuchang Street=town Lejia International=poi"],

"time_used": { "rt": {

"segment":"0.0053822994232177734",

"address_correct": "0.0002961158752441406" }, "start":"1589799494.0997586"},

"status": "OK"}}

address_correct: The result of the address correction.

time_used: The time consumed by the algorithm.

status: The status.

RequestId

String

226BD68D-6208-4140-A6EC-2F2BF434B601

RequestId

Examples

Request example

http(s)://[Endpoint]/?Action=CorrectAddress
&AppKey=Axqwerasdf1a
&ServiceCode=addrp
&Text=Yuhang District Wuzhang Street Lejia International
&<Common request parameters>

Successful response example

XML format

<RequestId>226BD68D-6208-4140-A6EC-2F2BF434B601</RequestId>
<Data>
    <address_correct>Yuhang District=district Wuchang Street=town Lejia International=poi</address_correct>
    <time_used>
        <rt>
            <segment>0.0053822994232177734</segment>
            <address_correct>0.0002961158752441406</address_correct>
        </rt>
        <start>1589799494.0997586</start>
    </time_used>
    <status>OK</status>
</Data>

JSON format

{
  "RequestId": "226BD68D-6208-4140-A6EC-2F2BF434B601",
  "Data": {
    "address_correct": [
      "Yuhang District=district Wuchang Street=town Lejia International=poi"
    ],
    "time_used": {
      "rt": {
        "segment": "0.0053822994232177734",
        "address_correct": "0.0002961158752441406"
      },
      "start": "1589799494.0997586"
    },
    "status": "OK"
  }
}

Error codes

HttpCode

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 fault 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.