Frontend
Back to frontend track

System Designs

Dynamic Pricing Page

Learn how to design a dynamic pricing page

Third-Party API

Third-Party APIs are usually external services that provide information about the user's location. They mostly do this with just your IP address.

But wait how do they have access to your IP address?

Every device that is connected to the internet has a unique IP address. This is also sent with each request to the server. These third-party providers use this information and approximate the location of the user and also save it in a database (they index it for fast lookup). The IP Address can be used to identify the user's location to almost a city-level precision.

Check here for that kind of information about your IP.

So, this information is pretty much publicly available and can be used to render the regional pricing page.

Various services provide this information. You can search around on Google for one that best fits your needs. In our case, our hosting provider Vercel provides this information.

Conclusion

This IP Address lookup is a great way to get the user's location and fits perfectly for our requirement as there is no friction with the user. In the next few sections, we will see the different rendering strategies to render the regional pricing page.