Location-based services are playing a crucial role in our digital life. Most service providers must know where their customers are coming from to tailor their offerings and maintain security-related measures. 

At the other end, most consumers use location-aware devices nowadays, such as GPS-powered mobile devices, and often 'know' their current location with great precision. Therefore, the most accurate way service providers can retrieve their customers' current location is by actively asking them to share it.

This method requires consent, but if granted, the exact GPS accuracy level coordinates can be obtained using the browser's HTML5 geolocation or devices’ location services, which are then transmitted back to the service provider. The service provider's servers can then convert the coordinates to a meaningful form such as Country/State/City/postcode using a conventional Reverse Geocoding service. 

This approach, however, raises significant privacy concerns, and users are often very reluctant to share their actual coordinates with an external party, who can potentially attach and combine that data with the personal identification data they already have. Therefore, exchanging location information between customers and vendors so that both parties can satisfy their objectives is not an easy task. 

Often, service providers only require a Country/City/Locality level of accuracy, so obtaining their customers' exact GPS coordinates, such as what household or local pub they are visiting, is overkill and unnecessary exposure of privacy. Therefore, the safest approach is to carry out the reverse geocoding at the client-side and only send back the textual locality data rather than the coordinates themselves to the servers’ level. 

The BigDataCloud FREE Client-side Reverse Geocoding API has already proved itself as the best on the market for precisely that - delivering unprecedently fast and accurate service with no rate, storage, or other restrictions.

However, we often hear our customers wondering about the best course of action when users are unwilling to share their location with their service providers. In such a case, the only fallback approach is to use IP Geolocation. It is generally less accurate, especially with hosting (VPN/Proxy etc.) or cellular network users. Still, it is the only option to estimate a user's location without their consent for location sharing. 

However, combining both Reverse Geocoding and IP Geolocation approaches, especially when multiple underlying services are involved, can be challenging. Different data sources can end up in inconsistent geographical naming conventions and formatting challenges. 

Moreover, premium IP Geolocation services are often costly and calling it at the client side can potentially expose the API key to a third party. 

This is why we decided to step in and provide the industry’s first service that uses the best of both geolocation methods in a single utterly free API service. This API endpoint is a Reverse Geocoding API that can accept a user’s coordinates when available or recover the caller's IPv4 address in other situations. 

The API provides the same data-structured output with the same data reach level and the same naming conventions involved in both cases. Therefore, it gives the most straightforward and complete API option for free!

The diagram above shows how you can implement our new free client-side reverse geocoding API to know where your website visitors or mobile app users are coming from. Using this approach, when the HTML5 geolocation API fails to retrieve the user’s location, you can call the same API without passing any geo-coordinates and it will automatically fallback to BigDataCloud’s patent-pending next-generation IP geolocation technology. The API introduces a new field called ‘lookupSource’ that shows if the location data was based on IP geolocation or reverse geocoding.

Please check out the sample working code to see the API in action: 

https://codepen.io/BigDataCloudAPI/pen/KKwQZjb

You can implement the API on your project for free without creating an account with us.

To get started check out the API documentation page.