Skip to main content

GeoCoding API -v2

API Description

Objective

The GeoCoding API -v2 validates the address of the user by returning a Geolocation.

InputOutput
The address to be verifiedThe validated address components, formatted address, and geographic coordinates (latitude and longitude). The complete list of output fields is available in the Success Response Details section

API URL

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

API Endpoint

geoCodingV2

Overview

The GeoCoding API -v2 is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should send all data in JSON format 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 API.

API Request Details

Method - POST

Headers

ParameterMandatory or OptionalDescriptionAllowed Values
content-typeMandatoryThis parameter defines the media type for the request payloadapplication/json
appIdMandatoryThe application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value.
appKeyMandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value.
transactionIdOptionalA unique identifier for tracking a user journeyThis should be both unique and easily associated with the user's journey in your application(s)

Input

The following table provides the details of the parameters required for the GeoCoding API -v2's request body:

ParameterMandatory or OptionalDescriptionAllowed ValuesDefault Value
addressMandatoryThe address to be verifiedNot ApplicableNot Applicable

Request

The following code snippet demonstrates a standard curl request for the GeoCoding API -v2:

curl --location --request POST 'https://ind-engine.thomas.hyperverge.co/v1/geoCodingV2' \
--header 'Content-Type: application/json' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--data '{
"address": "<Enter_the_address>"
}'

Success Response

The following code snippet demonstrates a success response from the GeoCoding API -v2:

{
"status": "success",
"statusCode": 200,
"result": {
"houseNumber": "<House_Number>",
"street": "<Street>",
"subSubLocality": "<Sub_Sub_Locality>",
"subLocality": "<Sub_Locality>",
"locality": "<Locality>",
"village": "<Village>",
"subDistrict": "<Sub_District>",
"district": "<District>",
"city": "<City>",
"state": "<State>",
"pincode": "<Pincode>",
"formattedAddress": "<Formatted_Address>",
"latitude": <Latitude>,
"longitude": <Longitude>
},
"metadata": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
}
}

Success Response Details

The following table outlines the details of the success response from the GeoCoding API -v2:

ParameterTypeDescription
statusstringThe status of the request
statusCodenumberThe HTTP status code representing the result
resultobjectThe container for the validated address components and geolocation data
houseNumberstringThe house or building number in the address
streetstringThe name of the street or road
subSubLocalitystringThe smallest subdivision within the locality, such as a colony or area
subLocalitystringThe subdivision within the locality, often representing a neighborhood
localitystringThe name of the main locality or town area
villagestringThe village name if applicable for rural addresses
subDistrictstringThe sub-district within the district
districtstringThe district name of the address
citystringThe city or town name of the address
statestringThe state or union territory name
pincodestringThe postal code or ZIP code
formattedAddressstringThe complete formatted address string
latitudenumberThe geographic latitude coordinate of the location
longitudenumberThe geographic longitude coordinate of the location
requestIdstringThe unique identifier for the request
transactionIdstringThe unique identifier for the user journey

Error Responses

The following are some error responses from the API:

{
"status": "failure",
"statusCode": 400,
"error": "Invalid address.",
"metadata": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
}
}
{
"message": "Missing/Invalid credentials",
"statusCode": 401,
"status": "failure"
}

Error Response Details

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

Status CodeErrorError Description
400Invalid address.The request has an invalid, empty, or unparseable address
400Invalid request.Please try again.The request has missing or malformed payload or parameters
401Invalid token.Please try again.The request has an expired or invalid authentication token
401Something went wrong.Please try again.The request is denied due to insufficient permissions or invalid credentials
401Missing/Invalid credentialsThe request is either missing the mandatory appId and appKey combination or has invalid values
404No match found.The request has an address or record that does not match the provided input
500Internal Server ErrorPlease check the request headers or contact the HyperVerge team for investigation
503External source downtimeThe request cannot be processed due to an unavailable external service or data source
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: