Skip to main content

Address Match API

This document outlines the details of the Address Match API.

API Description

Objective

The Address Match API compares two input addresses and returns an overall similarity score. It also provides segment-level comparison scores for individual address components such as house, street, locality, city, state, and pincode, enabling a detailed evaluation of address similarity.

InputOutput
The two addresses for comparisonOverall similarity score along with individual scores for each address component

API URL

https://ind-engine.thomas.hyperverge.co/v1/address_match

API Endpoint

address_match

Overview

The Address Match API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Authentication

You need a unique pair of application ID ( appId ) and application key (appKey) from HyperVerge to verify your identity for accessing the Address Match API.

API Request Details

Method - POST

Headers

HeaderMandatory / OptionalDescriptionInput Format
content-typeMandatoryThis parameter defines the media type for the request payload.multipart/form-data
appIdMandatoryThe application ID shared by HyperVergeNot Applicable - this is a unique value
appKeyMandatoryThe application key shared by HyperVergeNot Applicable - this is a unique value
transactionIdMandatoryThe unique ID for the customer journeyNot Applicable - this is a unique value related to a transaction in your application

Input

The following table provides the details of the parameters required for the Address Match API's request body:

ParameterMandatory / OptionalTypeDescriptionInput FormatDefault Value
address1MandatorystringThe first address. This value will be compared with the address2 parameterA valid address stringNot Applicable
address2MandatorystringThe second address. This value will be compared with the address1 parameterA valid address stringNot Applicable
returnMatchingSegmentsOptionalstringIndicates if the response should return the matching address segmentsyes or noNot Applicable
regionOptionalstringThe region for comparison logic, e.g., "ind" for IndiaNot ApplicableNot Applicable
returnSegmentScoresOptionalstringIndicates if the response should return segment-level scoresyes or noNot Applicable

Request

The following code snippet demonstrates a standard curl request for the Address Match API:

curl --location --request POST 'https://ind-engine.thomas.hyperverge.co/v1/address_match' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--form 'address1="<Enter_the_first_address>"' \
--form 'address2="<Enter_the_second_address>"' \
--form 'returnMatchingSegments="<Enter_yes_or_no>"' \
--form 'region="<Enter_the_region>"' \
--form 'returnSegmentScores="<Enter_yes_or_no>"'

Success Response

The following code snippet demonstrates the success response from the Address Match API when the parameters returnSegmentScores and returnMatchingSegments are enabled in the request:

{
"status": "success",
"statusCode": 200,
"result": {
"overall_score": 0.5,
"segments": {
"house": {
"match": "no",
"score": 0
},
"street_name_or_landmark_nearby": {
"match": "no",
"score": 0.55
},
"locality": {
"match": "no",
"score": 0.35
},
"city": {
"match": "yes",
"score": 1
},
"state": {
"match": "yes",
"score": 1
},
"pincode": {
"match": "no",
"score": 0
}
}
}
}

The following success responses are returned when the parameters returnSegmentScores and returnMatchingSegments are not enabled in the request:

When the returnSegmentScores parameter is not included, only the match results (without scores) for each segment are returned:

{
"status": "success",
"statusCode": 200,
"result": {
"overall_score": 0.51,
"segments": {
"house": {
"match": "no"
},
"street_name_or_landmark_nearby": {
"match": "no"
},
"locality": {
"match": "no"
},
"city": {
"match": "yes"
},
"state": {
"match": "yes"
},
"pincode": {
"match": "no"
}
}
}
}

Success Response Details

The following table outlines the details of the success response from the Address Match API:

ParameterTypeDescription
statusstringThe status of the request
statusCodeintegerThe HTTP status code for the request
resultobjectThe result object containing the address match details
overall_scorefloatThe overall score representing the similarity between the two addresses, ranging from 0 to 1
segmentsobjectAn object containing segment-level match results
houseobjectThe matching result and score (if applicable) for the house number or building
house.matchstringIndicates if the house information matches between the two addresses
house.scorefloatThe similarity score for the house segment, ranging from 0 to 1
street_name_or_landmark_nearbyobjectThe matching result and score (if applicable) for the street name or nearby landmark
street_name_or_landmark_nearby.matchstringIndicates if the street or landmark matches between the two addresses
street_name_or_landmark_nearby.scorefloatThe similarity score for the street or landmark segment (if returned)
localityobjectThe matching result and score (if applicable) for the locality or area
locality.matchstringIndicates if the locality matches between the two addresses
locality.scorefloatThe similarity score for the locality segment (if returned)
cityobjectThe matching result and score (if applicable) for the city
city.matchstringIndicates if the city matches between the two addresses
city.scorefloatThe similarity score for the city segment (if returned)
stateobjectThe matching result and score (if applicable) for the state
state.matchstringIndicates if the state matches between the two addresses
state.scorefloatThe similarity score for the state segment (if returned)
pincodeobjectThe matching result and score (if applicable) for the pincode
pincode.matchstringIndicates if the pincode matches between the two addresses
pincode.scorefloatThe similarity score for the pincode segment (if returned)

Error Responses

The following are some error responses from the Address Match API:

{
"message": "Input Validation Error: requires property \"address1\"",
"statusCode": 400,
"status": "failure"
}

Error Response Details

A failure or error response from the Address Match API contains a failure status with a relevant status code and error message. The following table lists all error responses:

Status CodeError MessageError DescriptionError Resolution
400Input Validation Error: requires property address1The address input fields in the request are either missing or invalidEnsure both address1 and address2 are provided in the request body
401Missing/Invalid credentialsThe request is either missing the mandatory appId and appKey combination or has invalid valuesProvide valid appId and appKey in the request headers. Check the dashboard's credentials tab
500Internal Server ErrorThere is an internal server error. Kindly contact the HyperVerge Team for investigation and support.Contact the HyperVerge team for resolution
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: