Address extraction

Updated at:

Extracts address segments from natural language text.

Test

You can test the API in the Address Purification console.

Request parameters

Name

Type

Required

Example value

Description

Action

String

Yes

ExtractAddress

A required parameter. Set the value to ExtractAddress.

AppKey

String

Yes

Axqwerasdf1a

Project AppKey

ServiceCode

String

Yes

addrp

A static field. The value is addrp.

Text

String

Yes

No. 969, Wenyi West Road

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 value

Description

Data

String

{"location_extract":[{"start":0,"end":8,"type":"LOC","word":"No. 969, Wenyi West Road"}],"time_used":{"rt":{"location_extract":"0.008937358856201172"},"start":"1589799727.438162"},"status":"OK"}

start: The start position of the field in the source text.

end: The end position of the field in the source text.

type: The field type. `LOC` stands for location.

word: The detected entity.

time_used: The time taken for the algorithm to process the request.

status: The status of the request.

RequestId

String

E0627DDE-28D7-4C00-A611-E047DF81AF05

The request ID.

Examples

Request example

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

Successful response example

XML format

<RequestId>E0627DDE-28D7-4C00-A611-E047DF81AF05</RequestId>
<Data>
    <location_extract>
        <start>0</start>
        <end>8</end>
        <type>LOC</type>
        <word>No. 969, Wenyi West Road</word>
    </location_extract>
    <time_used>
        <rt>
            <location_extract>0.008937358856201172</location_extract>
        </rt>
        <start>1589799727.438162</start>
    </time_used>
    <status>OK</status>
</Data>

JSON format

{
  "RequestId": "E0627DDE-28D7-4C00-A611-E047DF81AF05",
  "Data": {
    "location_extract": [
      {
        "start": 0,
        "end": 8,
        "type": "LOC",
        "word": "No. 969, Wenyi West Road"
      }
    ],
    "time_used": {
      "rt": {
        "location_extract": "0.008937358856201172"
      },
      "start": "1589799727.438162"
    },
    "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.

Flow control was triggered.

400

UserStatusInvalid

The user status is invalid.

The user status is invalid.

For more information about error codes, see Error Center.