If you want to determine your public (external) IP address programmatically, you can use the following request : https://ipapi.co/ip
Suppose you want to redirect your visitors to country-specific subdomains or pages on your website. If you visitor's IP address is, you can fetch the country with the following request:
Your application can then redirect the visitors based on the country code fetched above.

Similarly for city, you can use:

If you omit the IP address from the requests above, the response will show your country / city respectively.
Get the latitude & longitude : https://ipapi.co/ & plug it into a maps API (e.g. Google Maps or OpenStreetMaps)

The above map image can be displayed with the following piece of code :
<img src="https://maps.googleapis.com/maps/api/staticmap?center=37.384500,-122.088100&zoom=9&size=280x200&scale=1">
We aggregate data from multiple sources to provide an accurate & up-to date location information. This website includes location data available from db-ip, GeoLite2 data created by MaxMind, available from MaxMind and location information from Geonames In addition, we also partner with network service providers to provide a one stop comprehensive solution.
Plan upgrades are applied instantly with pro-rated charges. Downgrades take effect from next billing cycle. On sign-up, you will receive instructions on how to change your plan.
We have a hassle free cancellation policy. Just drop us an e-mail or contact us here. (You'll receive these instructions and our e-mail address on sign-up). Once your plan is cancelled, you won't be billed anymore but your plan will work till the end of your billing cycle.
We offer a free plan for trial & testing with no time limit. No signup or credit card is required to use it. The free plan is not recommended for use in a production environment or on a public facing website or app. If you have different requirements for a trial, please contact us.

Even after the free trial, if you are unhappy with the purchase, we will issue a full refund within 24 hours of sign-up.
We use Stripe, a secure online payment gateway to handle online payments. Stripe meets and exceeds the most stringent industry standards for security. Stripe has been audited by a PCI Qualified Security Assessor (QSA) and is certified as a PCI Level 1 Service Provider. This is the most stringent level of certification available.
Please contact us for any changes to your plan or payment method.
By using our website or API, you agree to the terms of service & privacy policy
If your daily usage approaches your request limit, you'll receive an e-mail alert with instructions on how to upgrade your plan before you run out of your quota.
Please refer to API Docs on specific error messages when your usage exceeds your plan limit.
Please refer to the API Docs & developer page for usage examples in ruby, python, php, Node.js, jQuery & java