ipgeolocation portfolio

ipgeolocation provides four APIs:

  • IP Geolocation API
    IP Geolocation API provides location information for any IPv4/IPv6 address or domain name.
  • Timezone API
    Timezone API provides date, time and timezone information from timezone name, IP address or location coordinates (latitude and longitude).
  • User-Agent API
    User-Agent API provides the accurate browser, device, and operating system details from device user agent string.
  • Astronomy API
    The Astronomy API provides sun rise time, sun set time, moon rise time and moon set time including current position, angle, and distance of the Sun and the Moon for a given date.

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.

Authorization

We provide two ways of authorization which are, by using the:

  • API Key
  • Request Origin (CORS)

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.

API Key

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.

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.

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.

Limit on No. of API Keys + Request Origins

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

Subscription PlanNo. of Extra API Keys + Request Origins
Bronze1
Bronze+1
Silver2
Silver+2
Gold3
Platinum3
Diamond3

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

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" }

JSON and XML Response Formats

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

XML Format

You can get API response in XML format in two ways:

  1. Pass output=xml as a URL parameter.
  2. Set Accept HTTP Header to application/xml or text/xml.

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.

Security / SSL

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.

Rate Limits

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

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