Address structuring
Parses address fragments to identify elements such as provinces, cities, districts, and roads.
Test
You can run an API test in the Address Purification console.
Request parameters
Name | Type | Required | Example value | Description |
Action | String | Yes | StructureAddress | A required parameter. Value: StructureAddress. |
AppKey | String | Yes | Axqwerasdf1a | The AppKey of the project. |
ServiceCode | String | Yes | addrp | A static field. Value: addrp. |
Text | String | Yes | No. 969, Wenyixi Road, Hangzhou | 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 | {"structure":"prov=Zhejiang Province\tcity=Hangzhou City\troad=Wenyixi Road\troadNo=No. 969","time_used":{"rt":{"structure":"0.006234884262084961"},"start":"1589801057.2344782"},"status":"OK"} | structure: The result of address structuring. time_used: The time consumed by the algorithm. status: The status. |
RequestId | String | 3542CCCD-A58D-4D46-9772-CC214D2D1E32 | RequestId |
Examples
Request example
http(s)://[Endpoint]/?Action=StructureAddress
&AppKey=Axqwerasdf1a
&ServiceCode=addrp
&Text=No. 969, Wenyixi Road, Hangzhou
&<Common request parameters>Example of a normal response
XML format
<RequestId>3542CCCD-A58D-4D46-9772-CC214D2D1E32</RequestId>
<Data>
<structure>prov=Zhejiang Province city=Hangzhou City road=Wenyixi Road roadNo=No. 969</structure>
<time_used>
<rt>
<structure>0.006234884262084961</structure>
</rt>
<start>1589801057.2344782</start>
</time_used>
<status>OK</status>
</Data>JSON format
{
"RequestId": "3542CCCD-A58D-4D46-9772-CC214D2D1E32",
"Data": {
"structure": "prov=Zhejiang Province\tcity=Hangzhou City\troad=Wenyixi Road\troadNo=No. 969",
"time_used": {
"rt": {
"structure": "0.006234884262084961"
},
"start": "1589801057.2344782"
},
"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 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, visit the Error Center.