Multi-address similarity comparison
This feature compares two input address strings to determine whether they refer to the same location. It provides a similarity score, the most granular matching level, and the distance between the two addresses based on their latitude and longitude.
Testing
You can test the API in the Address Purification console.
Request parameters
Name | Type | Required | Example | Description |
Action | String | Yes | GetAddressSimilarity | A required parameter. Set the value to GetAddressSimilarity. |
AppKey | String | Yes | Axqwerasdf1a | The AppKey of your project. |
ServiceCode | String | Yes | addrp | A static field. The value must be addrp. |
Text | String | Yes | Hangzhou Alibaba Xixi Park;Building 1, No. 969, Wenyi West Road, Hangzhou | The two address strings to process. Use a semicolon (;) as the separator. |
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 | {"sim_level":{"level":"none","address_a":"Hangzhou Alibaba Xixi Park", "address_b":"Building 1, No. 969, Wenyi West Road, Hangzhou", "is_same":false, "same_info":"prov=Zhejiang Province city=Hangzhou City district=Yuhang District town=Wuchang Street road=North Side Road poi=Alibaba Xixi Park"} "time_used":{"rt":{"sim_level":"0.415966272354126"},"start":"1665298648.3907936"},"status": "OK"} | sim_level: The result of the address similarity level comparison. level: The most granular similarity level. same_info: The matching parts of the two input addresses. address_a: The original text of the first input address. address_b: The original text of the second input address. is_same: Indicates whether the two addresses are the same. time_used: The time that the algorithm takes to process the request. status: The status of the request. |
RequestId | String | F1BD3BD6-3510-4144-996A-B7FCA70A5F81 | RequestId |
Examples
Request example
http(s)://[Endpoint]/?Action=GetAddressSimilarity
&AppKey=Axqwerasdf1a
&ServiceCode=addrp
&Text=Hangzhou Alibaba Xixi Park;Building 1, No. 969, Wenyi West Road, Hangzhou
&<Common request parameters>Response example
XML format
<RequestId>F1BD3BD6-3510-4144-996A-B7FCA70A5F81</RequestId>
<Data>
<sim_level>
<level>none</level>
<address_a>Hangzhou Alibaba Xixi Park</address_a>
<address_b>Building 1, No. 969, Wenyi West Road, Hangzhou</address_b>
<is_same>false</is_same>
<same_info>prov=Zhejiang Province city=Hangzhou City district=Yuhang District town=Wuchang Street road=North Side Road poi=Alibaba Xixi Park</same_info>
</sim_level>
<time_used>
<rt>
<sim_level>0.415966272354126</sim_level>
</rt>
<start>1665298648.3907936</start>
</time_used>
<status>OK</status>
</Data>
JSON format
{
"RequestId": "F1BD3BD6-3510-4144-996A-B7FCA70A5F81",
"Data": {
"sim_level": {
"level": "none",
"address_a": "Hangzhou Alibaba Xixi Park",
"address_b": "Building 1, No. 969, Wenyi West Road, Hangzhou",
"is_same": false,
"same_info": "prov=Zhejiang Province city=Hangzhou City district=Yuhang District town=Wuchang Street road=North Side Road poi=Alibaba Xixi Park"
},
"time_used": {
"rt": {
"sim_level": "0.415966272354126"
},
"start": "1665298648.3907936"
},
"status": "OK"
}
}Error codes
HTTP 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 was triggered. |
400 | UserStatusInvalid | The user status is invalid. | The user status is invalid. |
For more information about error codes, see the Error Center.