ipgeolocation provides four APIs:
This documentation provides complete details of features and available options in the above APIs. For information related to our IP Geolocation API Database, please contact our support.
We provide two ways of authorization which are, by using the:
In order to use the APIs, sign up for a desired plan.
We provide the same API response in our free as well as paid plans over https. Response in multiple languages, Bulk IP Geolocation Lookup and Request Origin Support are not available for free plans, however.
Here is an overview of both authorization methods.
You can make authorized requests to our API by passing API key as a query parameter. To get your API key, login to our API console and get your API key from there. We strongly discourage the use of API key in client-side JavaScript as it will expose your API key to the public.
In order to use API key in the client-side JavaScript, use the Request Origin (CORS) approach.
This feature is available for paid plans only. The purpose of this feature is to call our API from the client-side JavaScript without using your API key.
To use this feature, go to application console and click on + Add
button in the Dashboard/API Keys section. A popup will open up asking about to add an API key or a request origin. Choose Request Origina and enter the domain name of the website from where you'll be making requests. If your website is https://www.example.com, you should enter example.com
in that pop up as your request origin.
Once saved successfully, you can make requests from the main domain as well as all of the subdomains of the main website.
The number of extra API keys and request origins is limited based on the user's plan.
Subscription Plan | No. of Extra API Keys + Request Origins |
---|---|
Bronze | 1 |
Bronze+ | 1 |
Silver | 2 |
Silver+ | 2 |
Gold | 3 |
Platinum | 3 |
Diamond | 3 |
You can add more API keys and request origins than your limit at a cost of $2.5 per month per API key or request origin.
Get IP endpoint returns the IP address of the client from where it's called. So if you call it from your server, it returns IP address of the server. If it's called from your website like using JavaScript, it will return the IP address of the person viewing your website. This endpoint does not require any authentication and you can use this endpoint without creating an account. Here is a curl
example:
$ curl 'https://api.ipgeolocation.io/getip' { "ip": "1.1.1.1" }
All the endpoints of ipgeolocation API can respond in JSON and XML formats, JSON is the default response format.
You can get API response in XML format in two ways:
Here are a few examples of XML response:
$ curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=1.1.1.1&fields=city&output=xml'
<?xml version="1.0" encoding="UTF-8"?>
<result>
<ip>1.1.1.1</ip>
<city>South Brisbane</city>
</result>
$ curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=1.1.1.1&fields=currency' -H 'Accept: text/xml'
<?xml version="1.0" encoding="UTF-8"?>
<result>
<ip>1.1.1.1</ip>
<currency>
<code>AUD</code>
<name>Australian Dollar</name>
<symbol>A$</symbol>
</currency>
</result>
If you don't set output URL parameter or Accept header, the API will respond in JSON format.
We take security seriously and all of our API endpoints are served over a secure HTTPS connection for all users, even if you are on the free plan.
We have a hard limit of 1000 requests per day on our Free plan. However, we don't have any daily, hourly or monthly rate limit on any of our paid plans. If you increase from your monthly quota, we'll keep serving your requests and add a surcharge amount on top of your monthly price. Surcharge rate varies from plan to plan. Please consult our pricing page for the surcharge rate of each plan
To facilitate the developers, we have added some SDKs for various programming languages. The detailed documentation on how to use these SDKs is available in the respective SDK's documentation page linked below.
Our SDKs are also available on Github. Feel free to help us improve them. SDKs. Following are the available SDKs: