Free IP Lookup API and Accurate IP Location Finder

Our IP API provides geographical information about website visitors with any IPv4 or IPv6 address in JSON and XML format over a secure HTTPS connection even in our free plan. We provide data such as country name, country code, city, state, local currency, time zone, ISP, ASN, Company Details, device data from User-Agent String, VPN, Proxy, TOR and threat intelligence data. Our services are globally available with latency-based routing.

  • fieldip:"",
  • fieldhostname:"",
  • fieldcontinent_code:"",
  • fieldcontinent_name:"",
  • fieldcountry_code2:"",
  • fieldcountry_code3:"",
  • fieldcountry_name:"",
  • fieldcountry_name_official:"",
  • fieldcountry_capital:"",
  • fieldstate_prov:"",
  • fieldstate_code:"",
  • fielddistrict:"",
  • fieldcity:"",
  • fieldzipcode:"",
  • fieldlatitude:"",
  • fieldlongitude:"",
  • booleanis_eu:,
  • fieldcalling_code:"",
  • fieldcountry_tld:"",
  • fieldlanguages:"",
  • linkcountry_flag:field
  • fieldisp:"",
  • fieldconnection_type:"",
  • fieldorganization:"",
  • fieldasn:"",
  • fieldgeoname_id:"",
  • fieldcountry_emoji:"",
  • objectcurrency:Object,
    • fieldname:"",
    • fieldcode:"",
    • fieldsymbol:"",
  • objecttime_zone:Object,
    • fieldname:"",
    • integeroffset:,
    • integeroffset_with_dst:,
    • fieldcurrent_time:"",
    • integercurrent_time_unix:,
    • booleanis_dst:N/A,
    • integerdst_savings:,
    • booleandst_exists:N/A,
  • objectsecurity:Object,
    • integerthreat_score:,
    • booleanis_tor:,
    • booleanis_proxy:,
    • fieldproxy_type:"",
    • booleanis_anonymous:,
    • booleanis_known_attacker:,
    • booleanis_spam:,
    • booleanis_bot:,
    • booleanis_cloud_provider:,
  • objectuser_agent:Object,
    • fielduserAgentString:"",
    • fieldname:"",
    • fieldtype:"",
    • fieldversion:"",
    • fieldversionMajor:"",
    • objectdevice:Object,
      • fieldname:"",
      • fieldtype:"",
      • fieldbrand:"",
      • fieldCPU:"",
    • objectengine:Object,
      • fieldname:"",
      • fieldtype:"",
      • fieldversion:"",
      • fieldversionMajor:"",
    • objectoperatingSystem:Object,
      • fieldname:"",
      • fieldtype:"",
      • fieldversion:"",
      • fieldversionMajor:"",

IP Location Module

IP to Location module provides geolocation information related to an IP address such as continent, country, country capital, country calling code, country top level domain, city, state/province, zip code, local languages, country flag, latitude and longitude information.

Response

1{
2  "ip": "8.8.8.8",
3  "continent_code": "NA",
4  "continent_name": "North America",
5  "country_code2": "US",
6  "country_code3": "USA",
7  "country_name": "United States",
8  "country_name_official": "United States of America",
9  "country_capital": "Washington, D.C.",
10  "state_prov": "California",
11  "state_code": "US-CA",
12  "district": "Santa Clara County",
13  "city": "Mountain View",
14  "zipcode": "94043-1351",
15  "latitude": "37.42240",
16  "longitude": "-122.08421",
17  "is_eu": false,
18  "calling_code": "+1",
19  "country_tld": ".us",
20  "languages": "en-US,es-US,haw,fr",
21  "country_flag": "https://ipgeolocation.io/static/flags/us_64.png",
22  "geoname_id": "6301403",
23  "country_emoji": "🇺🇸"
24}

Currency Module

IP to Currency module provides currency information of the country such as currency name, currency symbol and currency code from an IP address.

Response

1"currency": {
2  "name": "US Dollar",
3  "code": "USD",
4  "symbol": "$"
5}

Time Zone Module

IP to Time Zone module provides time and timezone related information such as timezone name, UTC/GMT offset, current date and time string, is daylight saving time active and daylight saving in hours.

Response

1"time_zone": {
2  "name": "America/Los_Angeles",
3  "offset": -8,
4  "offset_with_dst": -7,
5  "current_time": "2024-10-02 00:06:41.301-0700",
6  "current_time_unix": 1727852801.301,
7  "is_dst": true,
8  "dst_savings": 1,
9  "dst_exists": true,
10  "dst_start": {
11    "utc_time": "2024-03-10 TIME 10",
12    "duration": "+1H",
13    "gap": true,
14    "dateTimeAfter": "2024-03-10 TIME 03",
15    "dateTimeBefore": "2024-03-10 TIME 02",
16    "overlap": false
17  },
18  "dst_end": {
19    "utc_time": "2024-11-03 TIME 09",
20    "duration": "-1H",
21    "gap": false,
22    "dateTimeAfter": "2024-11-03 TIME 01",
23    "dateTimeBefore": "2024-11-03 TIME 02",
24    "overlap": true
25  }
26}

Connection Information Module

Connection information module provides connection related information such as name of the ISP which owns this IP address, name of the organization/company to whom this IP address is further licensed by the ISP, ASN and the connection type (wired or wireless).

Response

1{
2  "isp": "Level 3 Communications",
3  "connection_type": "wired",
4  "organization": "Google Inc.",
5  "asn": "AS15169"
6}

Security Module

The security module provides threat intelligence data such as threat score, is tor, vpn or proxy, is known attacker and if the IP address belongs to one of the cloud providers.

Response

1"security": {
2  "threat_score": 42,
3  "is_tor": false,
4  "is_proxy": true,
5  "proxy_type": "VPN",
6  "is_anonymous": true,
7  "is_known_attacker": true,
8  "is_spam": false,
9  "is_bot": false,
10  "is_cloud_provider": true
11}

User Agent Parser Module

User Agent module parses the browser user agent string and provides detailed device information such as device name, device version, device type, device operating system, device browser, browser engine and browser version. It can identify robots, crawlers and attackers.

Response

1"user_agent": {
2  "userAgentString": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Safari/605.1.15",
3  "name": "Safari",
4  "type": "Browser",
5  "version": "13.0.5",
6  "versionMajor": "13",
7  "device": {
8    "name": "Apple Macintosh",
9    "type": "Desktop",
10    "brand": "Apple",
11    "cpu": "Intel"
12  },
13  "engine": {
14    "name": "AppleWebKit",
15    "type": "Browser",
16    "version": "605.1.15",
17    "versionMajor": "605"
18  },
19  "operatingSystem": {
20    "name": "Mac OS",
21    "type": "Desktop",
22    "version": "10.15.3",
23    "versionMajor": "10.15"
24  }
25}

Reverse IP Lookup Module

With reverse IP Lookup, you can resolve the host name or domain or router dns address. This gives you detailed information about the original source of traffic.

Request

curl 'https://api.ipgeolocation.io/ipgeo?include=hostname&ip=8.8.8.8&apiKey=API_KEY'

Response

1{
2  "ip":"8.8.8.8",
3  "hostname":"dns.google",
4  "..."
5}

Domain IP Lookup

Enter the domain address in place of IP address and our API will perform a DNS Lookup to give you the information about the web hosting provider and the geographical location of the website.

Response

1{
2  "domain": "ipgeolocation.io",
3  "ip": "104.20.61.122",
4  "isp": "Cloudflare, Inc.",
5  "asn": "AS13335",
6  "..."
7}

Bulk IP Address Lookup Support

Use our Bulk IP Lookup endpoint to perform batch lookup of multiple IPs in one go. One request can have up to 50,000 IPs. Both IPv4 and IPv6 are supported.

Request

curl -X POST 'https://api.ipgeolocation.io/ipgeo-bulk?apiKey=API_KEY' \
-H 'Content-Type: application/json' \
-d '{ 
"ips": ["1.1.1.1", "1.2.3.4", "1.2.3.5", "1.2.3.6", "1.2.3.7"] 
}'

Response in Multiple Languages

You can retrieve the geolocation information for an IP address in the following languages:

US FlagEnglish DE FlagGerman RU FlagRussian JP FlagJapanese FR FlagFrench CN FlagChinese Simplified ES FlagSpanish CZ FlagCzech IT FlagItalian KO FlagKorean FA FlagPersian

Use Cases

Website content localization

Adapt the content of your website to the destination of your visitors. Make your visitors feel right at home by "talking" to them in their local language and connect with them instantly. With IP geolocation, redirect your users to their region-specific websites and increase the possibility of increasing conversions up to 70%.

iplocation

Non-intrusive geolocation

Do you have an awesome content localization strategy in place? IP geolocation is a non-intrusive way to know where your visitors are coming from. Don't ruin your visitor's website experience by showing annoying pop-ups asking for their location. Our geolocation API will detect their location from their IP address and show them the relevant message.

geoip

Digital Rights Protection

Enforce digital rights of your content using IP location API. Build a virtual fence around your content and make sure that only the people inside the fence can see it.

iplook-up

Prevent Threats and Scams

With our security and user agent module, you can identify anonymous traffic sources, known attackers, suspicious devices and tor nodes to prevent online fraud, trial abusers, forum spams and botnet attackers.

ipgeolocator

Ready to get started?Get Started with IP Intelligence API Today

IP Geolocation API Documentation

IP Geolocation API

IP Geolocation API provides real-time and accurate geolocation, and security information for any IPv4 or IPv6 address and domain name along with the user-agent detail for the provided user-agent string. You can geolocate your online visitors and provide them the customized user-experience accordingly.

We provide the two endpoints in our IP Lookup API to get geolocation information.

Single IP Geolocation Lookup API

Single IP Location API can be used in two ways to lookup any IP address or domain name with JSON or XML response. The URL for this endpoint is https://api.ipgeolocation.io/ipgeo and its full JSON response is below:

Response

1{
2  "ip": "8.8.8.8",
3  "hostname": "dns.google",
4  "continent_code": "NA",
5  "continent_name": "North America",
6  "country_code2": "US",
7  "country_code3": "USA",
8  "country_name": "United States",
9  "country_name_official": "United States of America",
10  "country_capital": "Washington, D.C.",
11  "state_prov": "California",
12  "state_code": "US-CA",
13  "district": "Santa Clara",
14  "city": "Mountain View",
15  "zipcode": "94043-1351",
16  "latitude": "37.42240",
17  "longitude": "-122.08421",
18  "is_eu": false,
19  "calling_code": "+1",
20  "country_tld": ".us",
21  "languages": "en-US,es-US,haw,fr",
22  "country_flag": "https://ipgeolocation.io/static/flags/us_64.png",
23  "geoname_id": "6301403",
24  "isp": "Google LLC",
25  "connection_type": "",
26  "organization": "Google LLC",
27  "country_emoji": "🇺🇸",
28  "asn": "AS15169",
29  "currency": {
30    "code": "USD",
31    "name": "US Dollar",
32    "symbol": "$"
33  },
34  "time_zone": {
35    "name": "America/Los_Angeles",
36    "offset": -8,
37    "offset_with_dst": -7,
38    "current_time": "2024-09-19 00:19:04.376-0700",
39    "current_time_unix": 1726730344.376,
40    "is_dst": true,
41    "dst_savings": 1,
42    "dst_exists": true,
43    "dst_start": {
44      "utc_time": "2024-03-10 TIME 10",
45      "duration": "+1H",
46      "gap": true,
47      "dateTimeAfter": "2024-03-10 TIME 03",
48      "dateTimeBefore": "2024-03-10 TIME 02",
49      "overlap": false
50    },
51    "dst_end": {
52      "utc_time": "2024-11-03 TIME 09",
53      "duration": "-1H",
54      "gap": false,
55      "dateTimeAfter": "2024-11-03 TIME 01",
56      "dateTimeBefore": "2024-11-03 TIME 02",
57      "overlap": true
58    }
59  }
60}

Passing an IPv4, IPv6 Address or a domain

In order to find geolocation information about an IP address or a domain name, pass it as a query parameter ip like below. Note that apiKey is also need to pass as a query parameter for authorization. This endpoint is meant to be called from the server side.

Passing an IPv4

Here's an example to get the geolocation information for the IP address '8.8.8.8'.

curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=8.8.8.8'

Without Passing an IP Address

When this endpoint is queried without an IP address, it returns the geolocation information of the device/client which is calling it. This endpoint is meant to be called from client side.

curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY'

Note: apiKey parameter can also be ommitted from your API request when this endpoint is called from client side using Request Origin.

Bulk IP Geolocation Lookup API

This feature is available only on the paid API subscriptions. This endpoint allows you to perform the geolocation lookup for multiple IPv4, IPv6 addresses or domain names (maximum 50,000) at the same time. The requests count per lookup is equal to total IP addresses or domain names passed.

To perform bulk IP Geolocation Lookup, send a POST request and pass the "ips" array as JSON data along with it. Here is an example to query the geolocation data for multiple IPs at once.

curl -X POST 'https://api.ipgeolocation.io/ipgeo-bulk?apiKey=API_KEY' \
-H 'Content-Type: application/json' \
-d '{ "ips": ["1.1.1.1", "1.2.3.4", "4.3.2.1"] }'

Response in Multiple Languages

The geolocation information for an IP address from the IP Geolocation API can be retrieved in the following languages

  • English (en)
  • German (de)
  • Russian (ru)
  • Japanese (ja)
  • French (fr)
  • Chinese Simplified (cn)
  • Spanish (es)
  • Czech (cs)
  • Italian (it)
  • Persian (fa)
  • Korean (ko)

By default, the API responds in English. You can change the response language by passing the language code as a query parameter lang. Here is an example to get the geolocation data for IP adderss '1.1.1.1' in Chinese language:

curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=1.1.1.1&lang=cn'

Only the paid plan subscriptions can get the response in languages other than English. All the other subscriptions will only get the response in English.

Filter Responses

We've built our API to give you fine granularity. Specify what you want in query parameter and get only those fields. This will save you processing time, bandwidth and improve the API response time.

You can filter the API response in two ways:

• Get the Required Fields Only

First, you can filter the API response by specifying names of the fields that you want instead of getting the full response. Names of the required fields must be passed as a query parameter fields in the request. Here are a few examples to get only the required fields:

Get City Information Only

curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=1.1.1.1&fields=city'

Response

Response

1{
2  "ip": "1.1.1.1",
3  "city": "Kecamatan Margorejo"
4}

Get Country Name and Country Code (ISO2) Only

curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=1.1.1.1&fields=country_code2,country_name'

Response

Response

1{
2  "ip": "1.1.1.1",
3  "country_code2": "ID",
4  "country_name": "Indonesia",
5  "country_name_official": "Republic of Indonesia"
6}

Get the Time Zone Information Only

curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=8.8.8.8&fields=time_zone'

Response

Response

1{
2  "ip": "8.8.8.8",
3  "time_zone": {
4    "name": "America/Los_Angeles",
5    "offset": -8,
6    "offset_with_dst": -7,
7    "current_time": "2024-09-19 06:18:47.854-0700",
8    "current_time_unix": 1726751927.854,
9    "is_dst": true,
10    "dst_savings": 1,
11    "dst_exists": true,
12    "dst_start": {
13      "utc_time": "2024-03-10 TIME 10",
14      "duration": "+1H",
15      "gap": true,
16      "dateTimeAfter": "2024-03-10 TIME 03",
17      "dateTimeBefore": "2024-03-10 TIME 02",
18      "overlap": false
19    },
20    "dst_end": {
21      "utc_time": "2024-11-03 TIME 09",
22      "duration": "-1H",
23      "gap": false,
24      "dateTimeAfter": "2024-11-03 TIME 01",
25      "dateTimeBefore": "2024-11-03 TIME 02",
26      "overlap": true
27    }
28  }
29}

Get Only the Local Currency Information of Multiple IP Addresses

You can use our filters with Bulk IP Lookup as well. Here is an example:

curl -X POST 'https://api.ipgeolocation.io/ipgeo-bulk?apiKey=API_KEY&fields=currency' \
-H 'Content-Type: application/json' \
-d '{ "ips": ["1.0.1.0", "8.8.8.8"] }'

Response

1[
2  {
3    "ip": "1.0.1.0",
4    "currency": {
5      "code": "CNY",
6      "name": "Yuan Renminbi",
7      "symbol": "Â¥"
8    }
9  },
10  {
11    "ip": "8.8.8.8",
12    "currency": {
13      "code": "USD",
14      "name": "US Dollar",
15      "symbol": "$"
16    }
17  }
18]

Get Geolocation Information Only

We know, most of the times, users are interested in geolocation information only. So, we have added a shortcut for you. You can specify just fields=geo in your query parameter.

curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=8.8.8.8&fields=geo'

Response

1{
2  "ip": "8.8.8.8",
3  "continent_code": "NA",
4  "continent_name": "North America",
5  "country_code2": "US",
6  "country_code3": "USA",
7  "country_name": "United States",
8  "country_name_official": "United States of America",
9  "state_prov": "California",
10  "state_code": "US-CA",
11  "district": "Santa Clara",
12  "city": "Mountain View",
13  "zipcode": "94043-1351",
14  "latitude": "37.42240",
15  "longitude": "-122.08421",
16  "is_eu": false
17}

• Remove the Unnecessary Fields

Second, you can also filter the API response by specifying the names of fields (except IP address) that you want to remove from the API response. Names of the fields must be passed as a query parameter excludes in the request. Here are a few examples to exclude the unnecessary fields:

Exclude Continent Code, Currency and, Time zone Objects

curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=8.8.8.8&excludes=continent_code,currency,time_zone'

Response

1{
2  "ip": "8.8.8.8",
3  "continent_name": "North America",
4  "country_code2": "US",
5  "country_code3": "USA",
6  "country_name": "United States",
7  "country_name_official": "United States of America",
8  "country_capital": "Washington, D.C.",
9  "state_prov": "California",
10  "state_code": "US-CA",
11  "district": "Santa Clara",
12  "city": "Mountain View",
13  "zipcode": "94043-1351",
14  "latitude": "37.42240",
15  "longitude": "-122.08421",
16  "is_eu": false,
17  "calling_code": "+1",
18  "country_tld": ".us",
19  "languages": "en-US,es-US,haw,fr",
20  "country_flag": "https://ipgeolocation.io/static/flags/us_64.png",
21  "geoname_id": "6301403",
22  "isp": "Google LLC",
23  "connection_type": "",
24  "organization": "Google LLC",
25  "country_emoji": "🇺🇸",
26  "asn": "AS15169"
27}

• Get the Geo Field and Exclude Continent Information

Third, You can combine the fields and excludes query parameters for fully customized API queries. This approach helps you retrieve only the necessary data while reducing response latency. Here's a sample code to demonstrate how to use both parameters effectively:

curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=8.8.8.8&fields=geo&excludes=continent_code,continent_name'

Response

1{
2  "ip": "8.8.8.8",
3  "country_code2": "US",
4  "country_code3": "USA",
5  "country_name": "United States",
6  "country_name_official": "United States of America",
7  "state_prov": "California",
8  "state_code": "US-CA",
9  "district": "Santa Clara",
10  "city": "Mountain View",
11  "zipcode": "94043-1351",
12  "latitude": "37.42240",
13  "longitude": "-122.08421"
14}

IP-Security Information for an IP Address

IP Geolocation API also provides IP-Security information on all the paid subscriptions, but doesn't respond it by default. To get IP-Security information along with the geolocation information, you must pass the include=security as a query parameter in the URL.

Here is an example to IP Geolocation lookup that includes IP security information for the IP address:

curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=8.8.8.8&fields=geo&include=security'

Response

1{
2  "ip": "8.8.8.8",
3  "continent_code": "NA",
4  "continent_name": "North America",
5  "country_code2": "US",
6  "country_code3": "USA",
7  "country_name": "United States",
8  "country_name_official": "United States of America",
9  "state_prov": "California",
10  "state_code": "US-CA",
11  "district": "Santa Clara",
12  "city": "Mountain View",
13  "zipcode": "94043-1351",
14  "latitude": "37.42240",
15  "longitude": "-122.08421",
16  "is_eu": false,
17  "security": {
18    "threat_score": 80,
19    "is_tor": false,
20    "is_proxy": true,
21    "proxy_type": "VPN",
22    "is_anonymous": true,
23    "is_known_attacker": true,
24    "is_spam": false,
25    "is_bot": false,
26    "is_cloud_provider": true
27  }
28}

Hostname Lookup for an IP Address

IPGeolocation API also provide hostname lookup for an IP address on all the paid subscriptions, but doesn't respond it by default. To get the hostname for an IP address, you can pass one of the three values hostname, liveHostname, hostnameFallbackLive as a URL parameter include=.

Here is an example to IP Geolocation lookup that includes hostname for the IP address:

curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=8.8.8.8&fields=geo&include=liveHostname'

Response

1{
2  "ip": "8.8.8.8",
3  "hostname": "dns.google",
4  "continent_code": "NA",
5  "continent_name": "North America",
6  "country_code2": "US",
7  "country_code3": "USA",
8  "country_name": "United States",
9  "country_name_official": "United States of America",
10  "state_prov": "California",
11  "state_code": "US-CA",
12  "district": "Santa Clara",
13  "city": "Mountain View",
14  "zipcode": "94043-1351",
15  "latitude": "37.42240",
16  "longitude": "-122.08421",
17  "is_eu": false
18}

include=hostname URL Parameter

This URL parameter enables the IPGeolocation API to lookup hostname from our IP-Hostname database and returns the same IP address if there is no hostname found for the queried IP address. Lookup thru IP-Hostname database is faster than other options but is experimental and under process and can produce unwanted output.

include=liveHostname URL Parameter

This URL parameter enables the IPGeolocation API to lookup hostname from live sources. Lookup thru live sources is accurate but can introduce more latency to your query to IPGeolocation API

include=hostnameFallbackLive URL Parameter

This URL parameter enables the IPGeolocation API to lookup hostname from our IP-Hostname database and if there is no hostname found for the queried IP address, then lookup thru the live sources. This option has been introduced for faster and accurate lookup.

User-Agent Information for a Device

IP Geolocation API also provides User-Agent information of the client on all the paid subscriptions, but doesn't respond it by default. To get User-Agent information along with the geolocation information, you must pass the include=useragent as a query parameter in the URL.

Here is an example to IP Geolocation lookup that includes User-Agent information for a device from which the query originated:

curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=8.8.8.8&fields=geo&include=useragent'

Response

1{
2  "ip": "8.8.8.8",
3  "continent_code": "NA",
4  "continent_name": "North America",
5  "country_code2": "US",
6  "country_code3": "USA",
7  "country_name": "United States",
8  "country_name_official": "United States of America",
9  "state_prov": "California",
10  "state_code": "US-CA",
11  "district": "Santa Clara",
12  "city": "Mountain View",
13  "zipcode": "94043-1351",
14  "latitude": "37.42240",
15  "longitude": "-122.08421",
16  "is_eu": false,
17  "user_agent": {
18    "userAgentString": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
19    "name": "Chrome",
20    "type": "Browser",
21    "version": "128",
22    "versionMajor": "128",
23    "device": {
24      "name": "Linux Desktop",
25      "type": "Desktop",
26      "brand": "Unknown",
27      "cpu": "Intel x86_64"
28    },
29    "engine": {
30      "name": "Blink",
31      "type": "Browser",
32      "version": "128",
33      "versionMajor": "128"
34    },
35    "operatingSystem": {
36      "name": "Linux",
37      "type": "Desktop",
38      "version": "??",
39      "versionMajor": "??"
40    }
41  }
42}

Note: To get hostname, IP-Security information, and user-agent information together for an IP address and the device, you can pass include=hostname, security, useragent as a query parameter in the URL.

Reference to IPGeolocation API Response

Field Type Description Can be empty?
domain string Domain name that is used to lookup geolocation information. It is not returned if an IP address is used to query IP Geolocation API. Yes
ip string IP address that is used to lookup geolocation information. No
hostname string Hostname of the IP address used to query IP Geolocation API. No
continent_code string 2-letter code of the continent. No
continent_name string Name of the continent. No
country_code2 string Country code (ISO 3166-1 alpha-2) of the country. No
country_code3 string Country code (ISO 3166-1 alpha-3) of the country. No
country_name string Name of the country. No
country_name_official string Official name (ISO 3166) of the country. No
country_capital string Name of the country’s capital. No
state_prov string Name of the state/province/region. Yes
state_code string Code of the state/province/region. Yes
district string Name of the district or county. Yes
city string Name of the city. Yes
zipcode string ZIP/Postal code of the place Yes
latitude string Latitude of the place. No
longitude string Longitude of the place. No
is_eu boolean Is the country belong to European Union? No
calling_code string Calling code of the country. No
country_tld string Top Level Domain Name (TLD) of the country No
languages string Comma-separated list of the languages’ codes, spoken in the country. No
country_flag string URL to get the country flag. No
geoname_id string Geoname ID of the place from geonames.org Yes
isp string Name of the ISP holding the IP address. No
connection_type string Type of the connection, consuming the IP address. Yes
organization string Name of AS organization holding the IP address. Yes
country_emoji string Emoji of the Country flag. Yes
asn string Autonomous system number of the autonomous system, to which IP address belongs to. Yes
currency.code string Currency code (ISO 4217). No
currency.name string Currency name (ISO 4217). No
currency.symbol string Currency symbol. No
time_zone.name string Name (ISO 8601) of the time zone. No
time_zone.offset number Time zone offset from UTC. No
time_zone.offset_with_dst number Time zone with DST offset from UTC. No
time_zone.current_time string Current time in ‘yyyy-MM-dd HH:mm:ss.SSS±ZZZ’ format. No
time_zone.current_time_unix float Current time in seconds since 1970. No
time_zone.is_dst boolean Is the time zone in daylight savings? No
time_zone.dst_savings number Total daylight savings. No
time_zone.dst_exists boolean Whether Daylight Saving Time (DST) is observed in the region. No
time_zone.dst_start.utc_time string The date and time in UTC when DST begins. No
time_zone.dst_start.duration string The time change that occurs when DST starts. No
time_zone.dst_start.gap boolean Is there a gap when the clocks jump forward or not. No
time_zone.dst_start.dateTimeAfter string The local date and time that immediately follows the start of DST. No
time_zone.dst_start.dateTimeBefore string The local date and time immediately before DST begins. No
time_zone.dst_start.overlap boolean Whether there is an overlap of time due to clocks being set back when DST starts. No
time_zone.dst_end.utc_time string The date and time in UTC when DST ends. No
time_zone.dst_end.duration string The time change that occurs when DST ends. No
time_zone.dst_end.gap boolean Is there a gap when the clocks jump backward or not. No
time_zone.dst_end.dateTimeAfter string The local date and time that immediately follows the ends of DST. No
time_zone.dst_end.dateTimeBefore string The local date and time immediately before DST ends. No
time_zone.dst_end.overlap boolean Whether there is an overlap of time due to clocks being set back when DST ends. No
security.threat_score number IP address’ threat score. It ranges from 0 to 100. 100 indicates highest threat and vice versa for lower score. No
security.is_tor boolean Indicates if the IP address is being consumed on a Tor endpoint. No
security.is_proxy boolean Indicates if the IP address belongs to a proxy networ No
security.proxy_type string Type of the proxy network if the IP address belongs to a proxy network. Yes
security.is_anonymous boolean Indicates if the IP address is being used anonymously. No
security.is_known_attacker boolean Indicates if the IP address is enlisted as an attacking IP address. No
security.is_spam boolean Indicates if the IP address is enlisted as a spam IP address. No
security.is_bot boolean Indicates if the IP address is enlisted as a bot IP address. No
security.is_cloud_provider boolean Indicates if the IP address belongs to a cloud provider (computing infrastructure providers). No
user_agent.userAgentString string User-Agent string passed along with the query in the User-Agent header. No
user_agent.name string User-Agent Name. No
user_agent.type string User-Agent Class No
user_agent.version string User-Agent Version. No
user_agent.versionMajor string User-Agent Version Major. No
user_agent.device.name string Device Name. No
user_agent.device.type string Device Type. No
user_agent.device.brand string Device Brand. No
user_agent.device.cpu string Device CPU Model. No
user_agent.engine.name string Layout Engine Name No
user_agent.engine.type string Layout Engine Class No
user_agent.engine.version string Layout Engine Version. No
user_agent.engine.versionMajor string Layout Engine Version Major. No
user_agent.operatingSystem.name string Operating System Name. No
user_agent.operatingSystem.type string Operating System Class No
user_agent.operatingSystem.version string Operating System Version. No
user_agent.operatingSystem.versionMajor string Operating System Version Major. No

Error Codes

IP Geolocation API returns HTTP status code 200 for a successful API request along with the response.

While, in case of a bad or invalid request, IP Geolocation API returns 4xx HTTP status code along with a descriptive message explaining the reason for the error.

Below is a detailed explanation of the specific HTTP status codes and their corresponding error conditions:

HTTP StatusDescription
400
Bad Request

It is returned for one of the following reasons:

  • If the provided IPv4, IPv6 address, or domain name is invalid.

  • If special character(s) ( ) [ ] { } | ^ ` is passed in the API URL either as paramter or its value. Specially in case of API key.

  • If the IP addresses JSON list is empty, or the provided JSON does not have 'ips' field while querying /ipgeo-bulk endpoint.

  • If more than 50,000 IP addresses are provided while quering from /ipgeo-bulk endpoint.

401
Unauthorized

It is returned for one of the following reasons:

  • If API key (as apiKey URL parameter) is missing from the request to IP Geolocation API.

  • If an invalid (a random value) API key is provided.

  • If the API request is made from an unverified ipgeolocation.io account.

  • If your account has been disabled or locked to use by the admin due to abuse or illegal activity.

  • When the request to IP Geolocation API is made using API key for a database subscription

  • When the request to IP Geolocation API is made on the 'paused' subscription.

  • If you’re making API requests after your subscription trial has been expired.

  • If your active until date has passed and you need to upgrade your account.

  • If IP-hostname lookup, IP-security lookup or user-agent parsing endpoint is called using free subsciption API key.

  • If bulk IP to geolocation look-ups endpoint is called using free subscription API key.

403
Forbidden
  • If IP to geolocation look-up for a domain name is done using a free subscription API key.

404
Not Found

It is returned for one of the following reasons:

  • If the IPv4, IPv6, or domain name does not not exists in our database.

  • If the IPv4, IPv6, or domain name is passed as a path variable, instead of url parameter as ip=.

  • If the wrong endpoint is called, that does not exists in our API.

405
Method Not Allowed
  • If wrong HTTP request method is used for calling the endpoints. Only GET and POST methods are allowed. POST method for /ipgeo-bulk  endpoint and GET method for /ipgeo endpoint requests.

413
Content Too Large
  • If the passed data in the POST requests is more than the limit of the API.

415
Unsupported Media Type
  • If the payload for IPs in /ipgeo-bulk endpoint is mising, or the content type is not mentioned as JSON.

423
Locked
  • If the passed IP address is from a bogon ip ranges, or is part of a private network.

429
Too Many Requests

It is returned for one of the following reasons:

  • If the API usage limit has reached for the free subscriptions, or paid subscriptions with the status 'past due', 'deleted' or 'trial expired'.

  • If the surcharge API usage limit has reached against the subscribed plan.

499
Client Closed Request
  • If the client has set the very short request or connection timeout, leading to the server closing the request prematurely.

5XX
Server Side Error
  • If a 500 (Internal Server Error), 502 (Bad Gateway), 503 (Service Unavailable), 504 (Gateway Timeout), or 505 (HTTP Version Not Supported) status code is returned, it indicates an issue on our end. Please contact us with your request at support@ipgeolocation.io for further assistance.

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: