IP Geolocation API

The IP Geolocation API is a powerful tool that allows you to easily detect a user's location by their IP address. By utilizing this API, you can determine which language your visitor speaks and which currency to use in payment forms, among other valuable data.

To see the API in action, you can test it out using the API Playground. :

IP Geolocation Live Demo



Authentication and API key

If you don't have an API key, create one from our registration page. Once you register, you can get an IP Geolocation API key for free! For an overview of our plans, please take a look at our price page.

If you don't have an API key, don't worry - getting one is quick and easy. Go to our main page and press the "Sign Up" button to create an account. Once you're registered, you can get a Geoapify API key for free!

Getting started

  1. To get started, head over to the Geoapify MyProjects page and create a new project
  2. From there, go to the API Keys section, where you can generate one or multiple API keys for your project. You can also protect your API key by specifying allowed IP addresses, HTTP referrers, origins, and CORS.
  3. To generate the IP Geolocation API programming code sample, select the API key you want to use and choose "IP Geolocation API" from the list of APIs. You'll then be provided with an URL and programming code that you can use to make API calls.
  4. To test out your API call, simply press the "Try" button and get the result object.

API Reference

To use the IP Geolocation API, make an HTTP GET request to the API endpoint:


https://api.geoapify.com/v1/ipinfo?REQUEST_PARAMS


If you do not specify an IP address in the request, the API will automatically detect the user's IP address and provide location data based on that. Alternatively, you can specify a different IP address in the request to get location data for that IP address instead.

Here are IP Geolocation URL examples (click on a URL to test the API):

Request parameters

Name Description
apiKey Geoapify API key
ip IP address to lookup. Optional parameter. The IP address is detected automatically when it is not set.

Pricing

At Geoapify, we use a universal unit called a "credit" to calculate the cost of our API calls.

With our IP Geolocation API, each call is priced at just 1 credit:

API name Cost in credits Example
IP Geolocation API 1 request = 1 credit 3 IP Geoclocation requests cost 3 credits

Our pricing plans are designed to cater to the needs of any company, and our Free plan includes 3,000 credits per day. To see our pricing plans and find the best option for your business, visit our pricing page.