Authorization and Response Format (JSON/XML)


Authorization

We provide two methods of authorization, which are:

  1. API Key
  2. Request Origin (CORS)

Here are more details on how both authorization methods work:


1.API Key

You can make authorized requests to our API by passing API key as a query parameter.

  1. Login to your Billing dashboard.
  2. Copy your API key from the API Keys section of the landing page.
  3. Pass apiKey as a query parameter in your API requests.
  4. We strongly discourage using API key in client-side JavaScript as it will expose your API key to the public. When using API key on server side too, always store your API key in server-side environment variables.

Please refer to the example below to see how to pass apiKey parameter in the request.

curl -X GET 'https://api.ipgeolocation.io/v3/ipgeo?apiKey=API_KEY&ip=8.8.8.8'
Tip
In order to make requests from client-side application, please use origin whitelisting approach.

2.Request Origin (CORS)

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 on frontend.

To configure request origin:

  1. Login to your Billing dashboard. .
  2. In the Api Keys section, click + Add to add a new key or request origin.
  3. Choose Request Origins and enter the domain name of the website where you will make requests.
  4. Once saved successfully, you can make requests from the main domain as well as all subdomains without passing apiKey parameter.
Note
If your website is https://www.example.com , you should enter example.com as the request origin.

JSON and XML Response Formats

All the endpoints of ipgeolocation API can respond in JSON and XML formats, JSON is the default response format.


1.XML Format

All the endpoints of ipgeolocation API can respond in JSON and XML formats, JSON is the default response format.

  • Pass output=xml as a URL parameter.

  • Set Accept HTTP Header to application/xml or text/xml.

Here are a few examples of XML response:

I.URL parameter:

curl -X GET 'https://api.ipgeolocation.io/v3/ipgeo?apiKey=API_KEY&ip=1.1.1.1&fields=location.city&output=xml'
Response
1<LinkedHashMap>
2	<ip>1.1.1.1</ip>
3	<location>
4		<city>South Brisbane</city>
5	</location>
6</LinkedHashMap>

II.Header:

curl -X GET 'https://api.ipgeolocation.io/v3/ipgeo?apiKey=API_KEY&ip=1.1.1.1&fields=currency' \
-H 'Accept: text/xml'
Response
1<LinkedHashMap>
2	<ip>1.1.1.1</ip>
3	<currency>
4		<code>AUD</code>
5		<name>Australian Dollar</name>
6		<symbol>A$</symbol>
7	</currency>
8</LinkedHashMap>
Note
If you don't set output URL parameter or Accept header, the API will respond in JSON format.

API Key limits

The number of extra API keys and request origins is limited based on the user's plan.

NameNo. of Extra API Keys + Request Origins
Starter150K requests1
Core250K requests1
Plus500K requests2
Pro1M requests2
Business2M requests3
Premium5M requests3
Important
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.

API SDKs

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. Following are the available SDKs:


Integrations

IPGeolocation.io integrates easily with leading platforms and automation tools, allowing you to add accurate IP geolocation, Network and Threat intelligence, timezone data, and useragent data to your existing workflows. These integrations help you enrich data, automate processes, and build location-aware applications with minimal setup.

Following are the available Integrations:

Subscribe Our Newsletter

Get the latest in geolocation tech, straight to your inbox.