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.
1) Get the latitude & longitude from https://ipapi.co/ i.e. 37.384500,-122.088100 in this case.

2) Plug it into a maps API
<img src="https://maps.googleapis.com/maps/api/staticmap?center=37.384500,-122.088100&zoom=9&size=280x200&scale=1&key=YOUR_MAPS_KEY">

You can use Google Maps, OpenStreetMaps or any other maps API that accepts latitude / longitude. This would display a map image like the one below. You might need a key from the map provider to display the map.

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 details 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 require a higher limit trial plan, please contact us. We would be happy to help you out.

We use a secure, PCI compliant payment provider to handle credit & debit card transactions. We never view or store any customer’s full credit or debit card details on our platform. Our primary payment processor is Stripe. It has been audited by an independent PCI QSA and is certified as a PCI Level 1 Service Provider. This is the most stringent level of certification available in the payments industry.
Please contact us for any changes to your plan or payment method.
The API is suitable for a website, mobile or desktop app to automatically determine the location and related information of the user. If you need to perform bulk lookup, we offer a separate GUI tool covered under the same subscription plan. If you expect an uncommon usage or traffic pattern, please contact us to ensure that the API will be suitable for you. For further details, please see our terms of service & privacy policy
If your 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