Geolocation Web API is available in almost all browsers. The way it works is pretty simple and the simplest example you can check right away is Google Maps.
- Go to Google Maps.
- Click on the locate me button, located usually at the bottom right corner of the screen.
- The browser should now ask you for permission to access your location.
- Tada! You should now be able to see your current location on the map.
So, can we use this API to render the pricing page?
Does not lead to good UX!
We can but it has too much friction and does not lead to good UX! Also, the Geolocation Web API gives location with high accuracy, at a latitude and longitude level of precision.
Do we need that amount of accuracy to render the pricing page?
No, the majority of the cases just require a rough location of the user to render regional pricing. Usually, at a country-level precision.
Conclusion
Geolocation Web API has its use cases. But for a pricing page, has zero use case. We will discuss the better solution in the next section.