Authorization and Response Format (JSON/XML)
Authorization
We provide two methods of authorization, which are:
- API Key
- 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.
- Login to your Billing dashboard.
- Copy your API key from the
API Keyssection of the landing page. - Pass
apiKeyas a query parameter in your API requests. - 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'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:
- Login to your Billing dashboard. .
- In the
Api Keyssection, click+ Addto add a new key or request origin. - Choose
Request Originsand enter the domain name of the website where you will make requests. - Once saved successfully, you can make requests from the main domain as well as all subdomains without passing
apiKeyparameter.
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=xmlas 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'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'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>API Key limits
The number of extra API keys and request origins is limited based on the user's plan.
| Name | No. of Extra API Keys + Request Origins |
|---|---|
| Starter150K requests | 1 |
| Core250K requests | 1 |
| Plus500K requests | 2 |
| Pro1M requests | 2 |
| Business2M requests | 3 |
| Premium5M requests | 3 |
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: