Location Auto-Completion and Geo Codes

๐Ÿ‘

NOTE:

This guide is intended for API clients, particularly those seeking a solution locations auto-complete for retrieving Geolocations (Latitude & Longitude) for locations around the world.

Overview

To perform a Geo Location based search for a destination, it's essential to have accurate Geo Location information in place.

While there are multiple Location and Geo-Coding APIs available in the market (i.e. Google Maps API article).

HSP provides a convenient solution for clients - by offering a dedicated API for location services.

When an end customer searches for a location name (i.e. New York), it's crucial to have the necessary details for initiating a Search Hotels request to HSP. This information should include the latitude, longitude, and a radius in meters specific to the chosen location.

The locations service offers couple of solutions :

API RequestDescriptionUsed forPostman API Example
Get LocationsThe request accepts free-text input of locations (e.g., "Rome" / "New York"),
and returns matching locations along with their corresponding Latitude and Longitude coordinates.
- Locations Auto completion.
- Getting the GeoCodes (Lat + Long) of locations.
Click here.
Country by IPThe request accepts user's IP Address (IPv4),
and returns the country of the user.
- Identifying end-costumer's origin country by their IP.Click here.
Country CodeThe request accepts country code (ISO country code),
and returns the country of the user.
-Identifying the country name by country-code.Click here.
GetLocations - Example

GetLocations - Example