Skip to main content

Geolocation from IP

Description

Objective

The Geolocation from IP module accepts an IP address and responds with the geolocation details.

InputOutput
User's IP addressThe geolocation and network details, such as:
  • IP Address & Hostname
  • Autonomous System Number(ASN) and Name
  • Location Details
  • The Internet Service Provider(ISP)
  • The Location Coordinates
  • Timezone

Input

The following table provides the complete information on all the input parameters for the module.

ParameterDescriptionMandatory or OptionalAllowed ValuesDefault Value
ipThe IP address for verification OptionalNot ApplicableThe public IP* address of the end user's system
note

*A Public IP is assigned by your Internet Service Provider (ISP) and is visible on the internet, allowing the module to fetch location data.

In contrast, Private IPs are used within local networks, for example, at home or in an office and cannot be used to retrieve such details, as they are not visible on the public internet.

Success Response

{
"status": "success",
"statusCode": "200",
"metadata": {
"requestId": "<Unique_Request_ID>",
"transactionId": "<Transaction_ID>"
},
"result": {
"workflowDetails": {
"workflowId": "<Workflow_ID>",
"version": 1
},
"applicationStatus": "auto_approved",
"results": [
{
"module": "Geolocation From IP",
"moduleId": "module_kzPEG0_ip_geolocation_api",
"apiResponse": {
"status": "success",
"statusCode": "200",
"metadata": {
"requestId": "<Unique_Request_ID_For_IP>",
"transactionId": "<Transaction_ID_For_IP>"
},
"result": {
"ipAddress": "<IP_Address>",
"geoDetails": {
"as": "<Autonomous_System>",
"city": "<City>",
"country": "<Country>",
"countryCode": "<Country_Code>",
"isp": "<Internet_Service_Provider>",
"lat": "<Latitude>",
"lon": "<Longitude>",
"org": "<Organization>",
"query": "<Query_IP_Address>",
"region": "<Region_Code>",
"regionName": "<Region_Name>",
"status": "success",
"timezone": "<Timezone>",
"zip": "<Zip_Code>"
},
"summary": {
"action": "pass",
"details": []
}
}
},
"attempts": "<Number_of_Attempts>",
"previousAttempts": []
}
]
}
}

Success Response Details

ParameterTypeDescription
workflowIdstringThe unique ID of the workflow
versionintegerThe version number of the workflow
applicationStatusstringThe status of the application
resultsarrayAn array of results for the request
modulestringThe name of the module being executed
moduleIdstringThe ID of the module
apiResponseobjectContains the API response details
statusstringThe status of the API response
statusCodestringThe status code of the API response
metadataobjectContains metadata information for the API response
requestIdstringA unique identifier for the API request
transactionIdstringA unique identifier for the API transaction
resultobjectContains the result of the API response
ipAddressstringThe IP address being queried
geoDetailsobjectGeolocation details based on the IP address
asstringThe autonomous system's name and number associated with the IP
citystringThe city associated with the IP
countrystringThe country associated with the IP
countryCodestringThe country code associated with the IP
ispstringThe internet service provider for the IP address
latfloatThe latitude of the location for the IP
lonfloatThe longitude of the location for the IP
orgstringThe organization associated with the IP
querystringThe queried IP address
regionstringThe region code for the location
regionNamestringThe name of the region
statusstringThe status of the geolocation query
timezonestringThe timezone of the location for the IP
zipstringThe zip code of the location for the IP
summaryobjectA summary of the geolocation result
actionstringThe action taken based on the geolocation query result
detailsarrayAn array of detailed actions and codes related to the query result
attemptsstringThe number of attempts made to retrieve the geolocation details
previousAttemptsarrayAn array containing information on previous attempts

Failure Response

{
"module": "Geolocation From IP",
"moduleId": "module_kzPEG0_ip_geolocation_api",
"apiResponse": {
"status": "failure",
"statusCode": "400",
"metadata": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
},
"result": {
"error": "Unable to locate geoIp",
"summary": {
"action": "fail",
"details": [
{
"code": "136",
"message": "Unable to locate geoIp"
}
]
}
}
}
}

Error Response

The following is a sample response for a server error.

{
"status": "failure",
"statusCode": "500",
"error": {
"message": "Internal Server Error"
}
}

Failure and Error Response Details

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

Status CodeError MessageError Description
400Unable to locate geoIpGeolocation details could not be fetched due to invalid or unresolvable IP
500Internal Server ErrorThere is an error with HyperVerge's server. Kindly contact the HyperVerge team for resolution.
503Server BusyPlease contact the HyperVerge team for resolution

Application View

The following image shows the information about the Video OTP module for a sample application available under the Applications tab of the HyperVerge dashboard.

case_management_image

Application Details

The application view presents the geolocation data, based on the queried IP address and displays the results. The set of information displayed in the application view is configurable.

The following table describes the fields available in an application view.

Field NameDescription
Attempted AtThe timestamp of the verification process
SummaryIf the field value is "pass," it indicates that the application has passed all the configured checks in the module. Otherwise, it reflects a "fail" value.
Results This field represents the geolocation data returned from the IP address. It can include data points such as City, Country,Region Name, ZIP Code, or any set of information, from the results that the module returns. The data seen in an application view can be configured as per the requirements.
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: