Effortlessly manage your geolocation needs with our Bulk IP Lookup API. Tailored for both developers and businesses, our API streamlines the process of obtaining precise geolocation data for thousands of IP addresses in real-time. Whether you are analyzing large datasets, strengthening your cybersecurity measures, or refining your targeted marketing strategies, our API delivers accurate and reliable geolocation data in your preferred language, perfectly aligning with your specific requirements.
Our Bulk IP Lookup API simplifies the management and processing of bulk IP data, enhancing your operational efficiency and providing actionable insights with ease. Benefit from seamless integration and robust performance, all backed by our dedication to delivering consistent and reliable geolocation information whenever you need it.
Our Bulk IP Lookup API supports multiple languages, delivering geolocation data in your preferred language. Enhance user experience and cater to a global audience effortlessly.
Our API supports bulk lookup of up to 50,000 IP addresses in a single request, streamlining large-scale geolocation tasks with ease. Effortlessly handle extensive data with speed and accuracy.
Specify the desired fields in your query parameter to receive only the data you need. Our response filtration feature applies your filters to each individual IP response, optimizing processing time, reducing bandwidth usage, and enhancing overall API response speed. This ensures you get precise and efficient results tailored to your requirements.
Our Bulk IP Lookup API provides comprehensive IP security data alongside geolocation information for each IP address. In addition to accurate location details, receive valuable security insights such as threat intelligence and risk assessments for every IP in your batch. Enhance your data analysis with detailed security context to improve decision-making and safeguard your network.
Our API offers flexible IP hostname lookup options alongside geolocation data. You can obtain hostname information through three methods: live sources, our extensive database, or a combination of both. This flexibility ensures you get the most accurate and up-to-date hostname data for each IP address in your bulk IP lookup, enhancing your data analysis and operational efficiency.
$ pip install requests
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
lang | No | string | en | response language. Possible values are:
(1) en (English)
(2) de (German)
(3) ru (Russian)
(4) ja (Japanese)
(5) fr (French)
(6) cn (Chinese Simplifed)
(7) es (Spanish)
(8) cs (Czech)
(9) it (Italian) |
fields | No | array | Comma separated list of fields to be included in the response. You may include an additional field labeled "geo" to represent geolocation fields, other than the individual response fields. | |
excludes | No | array | Comma separated list of fields except ip to be excluded in the response | |
include | No | array | Comma-separated list of values to include additional IP lookup information in the response. Possible values are:
(1) security - To add ip security information
(2) hostname - hostname lookup from IP-Hostname database and returns the same IP address if there is no hostname found for the queried IP address
(3) liveHostname - hostname lookup from live sources
(4) hostnameFallbackLive - hostname lookup from IP-Hostname database and if there is no hostname found for the queried IP address, then lookup through the live sources |
The request body should be in JSON format and include a comma-separated list of IP addresses or hostnames for geolocation.
{ "ips": [ "8.8.8.8", "1.1.1.1", "dns.google.com" ] }
The response will be an array of objects, with each object containing geolocation lookup data for the corresponding IP address in the request. Each object will include the following fields:
Field | Type | Requirement | Description |
---|---|---|---|
domain | String | Optional | Domain name that is used to lookup geolocation information. It is not returned if an IP address is used to query IP Geolocation API. |
ip | String | Mandatory | IP address that is used to lookup geolocation information. |
hostname | String | Mandatory | Hostname of the IP address used to query IP Geolocation API. |
continent_code | String | Mandatory | 2-letter code of the continent. |
continent_name | String | Mandatory | Name of the continent. |
country_code2 | String | Mandatory | Country code (ISO 3166-1 alpha-2) of the country. |
country_code3 | String | Mandatory | Country code (ISO 3166-1 alpha-3) of the country. |
country_name | String | Mandatory | Name of the country. |
country_capital | String | Mandatory | Name of the country's capital. |
state_prov | String | Optional | Name of the state/province/region. |
district | String | Optional | Name of the district or county. |
city | String | Optional | Name of the city. |
zipcode | String | Optional | ZIP code of the place. |
latitude | Float | Mandatory | Latitude of the place. |
longitude | Float | Mandatory | Longitude of the place. |
is_eu | Boolean | Mandatory | Is the country belong to European Union? |
calling_code | String | Mandatory | Calling code of the country. |
country_tld | String | Mandatory | Top-level domain of the country. |
languages | String | Mandatory | Comma-separated list of the languages' codes, spoken in the country. |
country_flag | String | Mandatory | URL to get the country flag. |
geoname_id | Number | Mandatory | Geoname ID of the place from geonames.org |
isp | String | Mandatory | Name of the ISP holding the IP address. |
connection_type | String | Optional | Type of the connection, consuming the IP address. |
organization | String | Optional | Name of AS organization holding the IP address. |
asn | String | Optional | Autonomous system number of the autonomous system, to which IP address belongs to. |
currency.code | String | Mandatory | Currency code (ISO 4217). |
currency.name | String | Mandatory | Currency name (ISO 4217). |
currency.symbol | String | Mandatory | Currency symbol. |
time_zone.name | String | Mandatory | Name (ISO 8601) of the time zone. |
time_zone.offset | Number | Mandatory | Time zone offset from UTC. |
time_zone.current_time | String | Mandatory | Current time in yyyy-MM-dd HH:mm:ss.SSS+ZZZ format. |
time_zone.current_time_unix | Float | Mandatory | Current time in seconds since 1970. |
time_zone.is_dst | Boolean | Mandatory | Is the time zone in daylight savings? |
time_zone.dst_savings | Number | Mandatory | Total daylight savings. |
security.threat_score | Number | Mandatory | IP address's threat score. It ranges from 0 to 100.100 indicates highest threat and vice versa for lower score. |
security.is_tor | Boolean | Mandatory | Indicates if the IP address is being consumed on a Tor endpoint. |
security.is_proxy | Boolean | Mandatory | Indicates if the IP address belongs to a proxy network. |
security.proxy_type | String | Optional | Type of the proxy network if the IP address belongs to a proxy network. |
security.is_anonymous | Boolean | Mandatory | Indicates if the IP address is being used anonymously. |
security.is_known_attacker | Boolean | Mandatory | Indicates if the IP address is enlisted as an attacking IP address. |
security.is_cloud_provider | Boolean | Mandatory | Indicates if the IP address belongs to a cloud provider (computing infrastructure providers). |
If the entire request encounters an error, the following error codes will be returned. However, if an individual IP address belongs to the bogon IP list or experiences another specific error, only the object corresponding to that IP will include a message field detailing the error. The rest of the response will still contain the geolocation data for the other IPs, ensuring you receive as much useful information as possible.
HTTP Status | Reasons |
---|---|
400 | 'ip' must not be empty or null |
Provide IPv4, IPv6, or hostnames in the request body. Our API will return the geolocation information corresponding to each input, delivering accurate and comprehensive data tailored to your needs.
[ { "ip": "1.1.1.1", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "state_prov": "California", "state_code": "US-CA", "district": "", "city": "Los Angeles", "zipcode": "90012", "latitude": "34.05361", "longitude": "-118.24550" }, { "domain": "dns.google.com", "ip": "8.8.4.4", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "state_prov": "California", "state_code": "US-CA", "district": "", "city": "Mountain View", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421" }, { "ip": "2001:4860:4860:0:0:0:0:1", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "state_prov": "California", "state_code": "US-CA", "district": "", "city": "Mountain View", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421" } ]curl --location 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&fields=geo' \ --header 'Content-Type: application/json' --data '{ "ips": [ "1.1.1.1", "dns.google.com", "2001:4860:4860::1" ] }'
To customize the response format of your Bulk IP Lookup API, use the format parameter in your request. If you do not specify a format, the default response will be in JSON. To receive the response in XML format, simply include the format query parameter with the value xml. This flexibility ensures you receive the bulk IP geolocation data in the format that best suits your needs, providing seamless integration and convenience, whether you prefer JSON or XML.
<ArrayList> <item> <ip>1.1.1.1</ip> <country_code2>US</country_code2> <country_code3>USA</country_code3> <country_name>United States</country_name> <country_name_official>United States of America</country_name_official> <state_prov>California</state_prov> <state_code>US-CA</state_code> <district></district> <city>Los Angeles</city> <zipcode>90012</zipcode> <latitude>34.05361</latitude> <longitude>-118.24550</longitude> </item> </ArrayList>curl --location 'https://api.apifreaks.com/v1.0/geolocation/lookup?fields=geo&format=xml&apiKey=API-KEY' --header 'Content-Type: application/json' --data '{ "ips": [ "1.1.1.1" ] }'
The Bulk IP Lookup API is designed for precise and efficient geolocation data retrieval. By specifying desired fields in the query parameters, you can tailor the response to include only the information you need for each IP address. This customization enhances the efficiency of your IP lookup and geolocation tasks by delivering targeted and relevant data. You can customize the API response in two effective ways:
[ { "ip": "1.1.1.1", "city": "Los Angeles" }, { "ip": "8.8.8.8", "city": "Mountain View" } ] # Get the geolocation and exclude the continent information# Get city information only curl --location 'https://api.apifreaks.com/v1.0/geolocation/lookup?fields=city&apiKey=API-KEY' --header 'Content-Type: application/json' --data '{ "ips": [ "1.1.1.1", "8.8.8.8" ] }'[ { "ip": "1.1.1.1", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "state_prov": "California", "state_code": "US-CA", "district": "", "city": "Los Angeles", "zipcode": "90012", "latitude": "34.05361", "longitude": "-118.24550" }, { "ip": "8.8.8.8", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "state_prov": "California", "state_code": "US-CA", "district": "", "city": "Mountain View", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421" } ]curl --location 'https://api.apifreaks.com/v1.0/geolocation/lookup?fields=geo&excludes=continent_code&apiKey=API-KEY' --header 'Content-Type: application/json' --data '{ "ips": [ "1.1.1.1", "8.8.8.8" ] }'
The Bulk IP Lookup API also offers valuable IP-Security information, which is not included by default. To receive detailed IP-Security insights along with your geolocation data, simply add the include=security query parameter to your request. This addition ensures that you get comprehensive security details for each IP address, significantly enhancing the value and utility of your geolocation results and providing a more complete view of your IP data.
[ { "ip": "1.1.1.1", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "state_prov": "California", "state_code": "US-CA", "district": "", "city": "Los Angeles", "zipcode": "90012", "latitude": "34.05361", "longitude": "-118.24550", "security": { "threat_score": 75, "is_tor": false, "is_proxy": true, "proxy_type": "VPN", "is_anonymous": true, "is_known_attacker": true, "is_spam": false, "is_bot": false, "is_cloud_provider": false } }, { "ip": "8.8.8.8", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "state_prov": "California", "state_code": "US-CA", "district": "", "city": "Mountain View", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421", "security": { "threat_score": 80, "is_tor": false, "is_proxy": true, "proxy_type": "VPN", "is_anonymous": true, "is_known_attacker": true, "is_spam": false, "is_bot": false, "is_cloud_provider": true } } ]curl --location 'https://api.apifreaks.com/v1.0/geolocation/lookup?fields=geo&include=security&apiKey=API-KEY' --header 'Content-Type: application/json' --data '{ "ips": [ "1.1.1.1", "8.8.8.8" ] }'
The Bulk IP Lookup API includes hostname lookup capabilities, though this feature is not enabled by default. To enhance your geolocation data with detailed hostname information, use the include query parameter with one of the following options:
By incorporating these parameters, you can enrich your bulk IP lookups with precise hostname data, enhancing the depth and accuracy of your IP geolocation results.
[ { "ip": "1.1.1.1", "hostname": "1.1.1.1", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "state_prov": "California", "state_code": "US-CA", "district": "", "city": "Los Angeles", "zipcode": "90012", "latitude": "34.05361", "longitude": "-118.24550" }, { "ip": "8.8.8.8", "hostname": "8.8.8.8", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "state_prov": "California", "state_code": "US-CA", "district": "", "city": "Mountain View", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421" } ]curl --location 'https://api.apifreaks.com/v1.0/geolocation/lookup?fields=geo&include=hostname&apiKey=API-KEY' --header 'Content-Type: application/json' --data '{ "ips": [ "1.1.1.1", "8.8.8.8" ] }'
To use the Bulk IP Lookup API, API credits are required. Charges apply only for successful queries, defined by a 2xx status code. If a request results in a 4xx or 5xx status code, no credits will be deducted, and any charges incurred will be refunded. Credits are charged based on each IP address specified in your request. If an error occurs with a specific IP address, credits will be refunded for that IP, and you will be charged only for successfully geolocated IP addresses.
Service | Credits |
---|---|
Basic Geolocation Data per IP | 1 Credit per successfully geolocated IP address |
Additional Data (e.g., IP Security, IP Hostname) per IP | 1 Additional Credit per IP address |
Utilize the Credits Usage API to efficiently monitor your recent consumption of both one-off and subscription credits. This API provides a streamlined way to track and manage your credit usage, ensuring you stay informed about your remaining balance and can optimize your resource allocation effectively.