API Documentation
IPCHECKAPI offers a user-friendly API interface that empowers users to retrieve a diverse range of information linked to both IPv4 and IPv6 addresses. When a query is made for an IP address, the API furnishes over 40 distinct data points, including geographical details, connectivity statistics, details about the Internet Service Provider (ISP), time zone, currency, and an assessment of security-related information.
This API operates on the REST architecture, where lookup requests can be initiated through simple HTTP GET URLs, and the results are delivered swiftly in a lightweight JSON or XML format, usually within just a few milliseconds.
In this API guide, you will find an exhaustive breakdown of the API's specifications, access methods, and features. Towards the end of the document, you will also discover illustrative code snippets in various programming languages. If you happen to have any lingering technical inquiries, please do not hesitate to reach out to the IPCHECKAPI Customer Support Team.
Specs & Overview
API Access Key & Authentication
After signing up, you will receive an API access key to access any of the API endpoints. To authenticate with
the
API, you must provide your API access key (YOUR_ACCESS_KEY)
in the access_key parameter of the API endpoint URL:
Copyhttps://test1.ipcheckapi.com/api/v1/check?access_key=YOUR_ACCESS_KEY
Keep your API access key safe: Your API access key is private and should at no time be shown publicly. You have the ability to reset it instantly through your account dashboard whenever you deem necessary.
API Response
After a successful API request, the API will provide over 40 distinct response objects containing result data. The API response can be delivered in either JSON or XML format and is organized into four core modules: General information, geographical data, time zone data, currency data, connectivity data, and security data. You will find a comprehensive explanation of the response objects within each module in the API Response Objects section.
Below, you can observe an illustrative API response example for an IPv4 address located in Chicago, United States .
Example API Response:
Please note: In order to provide you with a comprehensive API response, we have included Hostname and Security data in the result presented above. To enable this data for your API response, please follow the guidelines outlined in the following sections of this documentation: Hostname Lookup and Security Data .
API Endpoints
This API offers a total of 3 distinct API endpoints, each serving a unique set of functionalities. Below is a brief summary, and you can click on any of the endpoints to access more detailed information about their usage.
-
Standard Lookup
Look up any given IP address.
-
Bulk Lookup
Look up multiple IP addresses in bulk.
-
Origin Lookup
Look up the IP address the current API request is coming from.
JSONP Callbacks
The API also provides support for
JSONP
Callbacks
, allowing you to integrate the service into your JavaScript
applications. To specify the JavaScript function to be invoked, simply include the callback= parameter in your
request to any of the API endpoints.
Not sure what JSONP is? Here's an explanation Stack Overflow .
Example API Request:
Copyhttps://test1.ipcheckapi.com/api/v1/check ?access_key=YOUR_ACCESS_KEY &callback=FUNCTION_NAME
Example API Response:
CALLBACK_FUNCTION({ { "ip": "98.142.250.255", "hostname": "98.142.250.255", "type": "ipv4", "continent_code": "NA", "continent_name": "Americas", "country_code": "US", "country_name": "United States", "region_code": "IL", [...] } })JSON ONLY
API Error Codes
In case your API request encounters any issues or fails for any reason, the API will return a JSON error message that provides information about the specific error that occurred. As an illustration, here is an error message that the API will return if the monthly limit of API requests has been exceeded.
Example Error:
Common API Errors:
| Code | Type | Info |
|---|---|---|
101
|
missing_access_key
|
User did not supply an access key. |
102
|
invalid_access_key
|
User supplied an invalid access key. |
103
|
usage_limit_reached
|
User has reached his subscription's monthly request allowance. |
104
|
function_access_restricted
|
The user's current subscription does not support this API function. |
105
|
invalid_callback_function_name
|
User supplied an invalid callback function name. |
301
|
invalid_fields
|
User supplied one or more invalid fields inside the fields parameter. |
302
|
too_many_ips
|
User supplied too many IP addresses in a single Bulk Lookup request. |
303
|
invalid_ip_address
|
User supplied one or more invalid ips inside the ips parameter. |
304
|
invalid_hostname
|
User supplied an invalid value inside the hostname parameter. |
305
|
invalid_security
|
User supplied an invalid value inside the security parameter. |
306
|
invalid_output
|
User supplied an invalid value inside the output parameter. |
404
|
404_not_found
|
The requested API resource does not exist. |
405
|
method_not_allowed
|
Method not allowed. Supported methods: GET, POST |
500
|
server_error
|
Something went wrong - Internal server error. |
999
|
unexpected_error
|
An unexpected error occurred. Please contact our support team. |
Endpoints
Standard IP Lookup Available on: All plans
For a single IP address lookup of your preference, you can easily do so by adding the API's ips
parameter to your API request URL and specifying a particular IPv4 or IPv6 address. Here's an example API
request, the necessary parameters, and a sample API response:
Example API Request:
Copyhttps://test1.ipcheckapi.com/api/v1/info ?access_key=YOUR_ACCESS_KEY &ips=98.142.250.255
Request Parameters:
| Object | Description |
|---|---|
access_key
|
[Required] Your API access key, available in your account dashboard. |
ips
|
[Required] An IPv4 or IPv6 address of your choice. |
fields
|
[optional] Specify API response field(s) according to the Specify Response Fields section. |
hostname
|
[optional] Set to 1 to enable
Hostname Lookup
.
|
security
|
[optional] Set to 1 to enable
Security Data
.
|
callback
|
[optional] Specify a JSONP callback function name according to the JSONP Callbacks section. |
output
|
[optional] Set to json or xml to choose between output formats.
|
Example API Response:
A standard API response will include basic information regarding the provided IP address and its location data. If you are subscribed to the Startup Plan or a higher tier, the API will also provide additional details such as timezone, currency, and connection data.
API Response Objects: Looking for details about the response objects returned by the API? All available response objects are explained in detail in the API Response Objects section.
Bulk IP Lookup Available on: Growth Plan and higher
If you want to perform multiple IP address lookups in a single request, you can do so by adding the API's ips
parameter to your API request URL and setting it as a comma-separated list of IPv4 or IPv6 addresses. The API
will then respond with an array of results, containing one sub-array per IP address looked up.
Example API Request:
Copyhttps://test1.ipcheckapi.com/api/v1/info ?access_key=YOUR_ACCESS_KEY &ips=98.142.250.255,103.230.7.255,170.81.55.255
Request Parameters:
| Object | Description |
|---|---|
access_key
|
[Required] Your API access key, available in your account dashboard. |
ips
|
[Required] A comma-separated list of IPv4 or IPv6 addresses of your choice. (Limit: 50 values) |
fields
|
[optional] Specify API response field(s) according to the Specify Response Fields section. |
hostname
|
[optional] Set to 1 to enable
Hostname Lookup
.
|
security
|
[optional] Set to 1 to enable
Security Data
.
|
callback
|
[optional] Specify a JSONP callback function name according to the JSONP Callbacks section. |
output
|
[optional] Set to json or xmlto choose between output formats.
|
Example API Response:
In a Bulk Lookup API response, you will receive an array of results, with each result linked to one of the IP addresses included in the API request. Please note that the API results provided below have been condensed for the sake of readability.
API Response Objects: Looking for details about the response objects returned by the API? All available response objects are explained in detail in the API Response Objects section.
Origin IP Lookup Available on: All plans
If you wish to look up the IP address from which the current API request is originating, simply append check
to the API's base URL. The API will then execute a lookup request based on that IP address and furnish a
comprehensive set of API results.
Example API Request:
Copyhttps:https://test1.ipcheckapi.com/api/v1/check ?access_key=YOUR_ACCESS_KEY
Request Parameters:
| Object | Description |
|---|---|
access_key
|
[Required] Your API access key, available in your account dashboard. |
fields
|
[optional] Specify API response field(s) according to the Specify Response Fields section. |
hostname
|
[optional] Set to 1 to enable
Hostname Lookup
.
|
security
|
[optional] Set to 1 to enable
Security Data
.
|
callback
|
[optional] Specify a JSONP callback function name according to the JSONP Callbacks section. |
output
|
[optional] Set to json or xmlto choose between output formats.
|
Example API Response:
API Response Objects: Looking for details about the response objects returned by the API? All available response objects are explained in detail in the API Response Objects section.
Response Objects
Depending on the subscription plan you have and the specific options you include in your API request, the API has the capability to provide more than 40 distinct response objects. Below, you can find a comprehensive list of API response objects:
| Response Object | Description |
|---|---|
ip
|
Returns the IP address as requested. |
hostname
|
Returns the hostname the requested IP is associated with; requires Hostname Lookup to be enabled. |
type
|
Returns IPv4 or IPv6, depending on type of the requested IP address.
|
continent_code
|
Returns the 2-letter continent code associated with the IP address.
View all 2-letter continent codes |
continent_name
|
Returns the continent name associated with the IP address. |
country_code
|
Returns the 2-letter country code associated with the IP address.
List of all 2-letter country codes |
country_name
|
Returns the country name associated with the IP address. |
region_code
|
Returns the region code associated with the IP address (e.g. NY for New York).
|
region_name
|
Returns region name associated with the IP address. |
city
|
Returns the city associated with the IP address. |
zip
|
Returns the ZIP code associated with the IP address. |
latitude
|
Returns the latitude associated with the IP address. |
longitude
|
Returns the longitude associated with the IP address. |
location
|
[Object] Returns multiple objects related to location. |
location > geoname_id
|
Returns the geoname identifier in accordance with the Geonames Registry . |
location > capital
|
Returns the capital city of the country associated with the IP address. |
location > languages
|
[Object] Returns an object containing one or multiple sub-objects per language associated with the IP address. |
location > languages > code
|
Returns the 2-letter language code for the given language.
List of all 2-letter language codes |
location > languages > name
|
Returns the language name (in the API request's main language). (e.g. Spanish)
|
location > languages > native
|
Returns the native language name. (e.g. Español)
|
location > country_flag
|
Returns an HTTP URL to an SVG country flag icon associated with the IP address. |
location > country_flag_emoji
|
Returns the emoji icon for the country flag associated with the IP address. |
location > country_flag_emoji_unicode
|
Returns the unicode value of the emoji icon for the country flag associated with the IP address. (e.g.
U+1F1EA U+1F1F8 for the Spanish flag)
|
location > calling_code
|
Returns the calling/dial code associated with the IP address. (e.g. 34) for Spain.
|
location > is_eu
|
Returns true if the given country is part of the EU, false if not.
|
time_zone
|
[Object] Returns an object containing data related to time zone. |
time_zone > id
|
Returns the time zone ID associated with the IP address. (e.g. America/New_York for EDT)
|
time_zone > current_time
|
Returns the current date and time associated with the IP address.
(e.g.2023-10-29T14:55:57-05:00)
|
time_zone > gmt_offset
|
Returns the offset to GMT time of the given time zone in seconds. (e.g. -14400 for EDT)
|
time_zone > code
|
Returns the universal code of the given time zone.
List of all available codes |
time_zone > is_daylight_saving
|
Returns true if the given time zone is daylight saving time, false if not.
|
currency
|
[Object] Returns an object containing data related to currency. |
currency > code
|
Returns the 3-letter code of the main currency associated with the IP address.
Example: USD -
List of all available currency codes
|
currency > name
|
Returns the name of the given currency. |
currency > plural
|
Returns the name of the given currency in plural. |
currency > symbol
|
Returns the symbol of the given currency. |
connection
|
[Object] Returns an object containing data related to connection. |
connection > asn
|
Returns the Autonomous System Number associated with the IP address. |
connection > isp
|
Returns the ISP associated with the IP address. |
security
|
[Object] Returns an object containing data related to security. |
security > is_proxy
|
Returns true if the given IP address is associated with a proxy, false if not.
|
security > proxy_type
|
If relevant, returns the type of proxy the IP address is associated with.
View all potential proxy types |
security > is_crawler
|
Returns true if the given IP address is associated with a crawler, false if
not.
|
security > crawler_name
|
If relevant, returns the name of the crawler the IP address is associated with. |
security > crawler_type
|
If relevant, returns the type of crawler the IP address is associated with.
View all potential crawler types |
security > is_tor
|
Returns true if the given IP address is associated with the anonymous
Tor system
, false if not.
|
security > threat_level
|
Returns the level of threat the IP address is associated with.
View all threat levels |
Options
Specify Response Format Available on: All plans
The API has the ability to deliver API results in JSON format by default, but you can also specify XML format if
needed. You can control the response format by adding the output parameter to your API request URL
and setting it to either json or xml.
Example API Request - JSON:
Copyhttps://test1.ipcheckapi.com/api/v1/check ?access_key=YOUR_ACCESS_KEY &output=json
Example API Request - XML:
Copyhttps://test1.ipcheckapi.com/api/v1/check ?access_key=YOUR_ACCESS_KEY &output=xml
Would you like to see an API response? Jump to the API Response section.
Specify Response Fields Available on: All plans
API responses from IPCHECKAPI may contain extensive data. To streamline your API result set and
focus on specific fields or types of information, you can achieve this by adding the fields
parameter to your API request URL and setting it to a single field or a list of fields separated by commas.
Examples:
fields=country_code // returns only the "country_code" object fields=timezone // returns the complete "timezone" object with sub-objects fields=timezone.id // returns only the "id" object inside "timezone" fields=latitude,longitude // returns both the "latitude" and the "longitude" objects
Example API Request - JSON:
Copyhttps://test1.ipcheckapi.com/api/v1/check ?access_key=YOUR_ACCESS_KEY &fields=latitude,longitude
Would you like to see an API response? Jump to the API Response section.
Enable Hostname Lookup Available on: All plans
To enhance the efficiency of API responses and reduce bandwidth usage, standard IP lookups typically exclude
hostname information. If you wish to include hostname data in your API responses, you can easily achieve this by
adding the hostname parameter to your API request and setting it to 1.
Example API Request:
Copyhttps://test1.ipcheckapi.com/api/v1/check ?access_key=YOUR_ACCESS_KEY &hostname=1
Example API Response:
As you can see below, hostname information is now returned right after the IP address.
Please note: Enabling Hostname Lookup can lead to a slight decrease in the speed of API requests.
Enable Security Data Available on: Enterprise Plan
The API can provide important security assessment data, which includes the detection of threats such as the TOR
Network and proxies, among others. To incorporate Security Data into your API request, you can do so by adding
the security parameter to your API request URL and setting it to 1.
Example API Request:
Copyhttps://test1.ipcheckapi.com/api/v1/check ?access_key=YOUR_ACCESS_KEY &security=1
Example API Response:
Please note: In the response above, the remaining part of the API response has been omitted for the sake of readability.
Code Examples
PHP (CURL)
Standard Lookup via PHP
Find below a PHP (CURL) example making use of the Standard Lookup endpoint:
// Set IP address and API access key $ip = '98.142.250.255'; $access_key = 'YOUR_ACCESS_KEY'; // Initialize CURL: $ch = curl_init('https://test1.ipcheckapi.com/api/v1/info?access_key='.$access_key.'&ips='.$ip.''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Store the data: $json = curl_exec($ch); curl_close($ch); // Decode JSON response: $api_result = json_decode($json, true); // Output the "id" object inside "timezone" echo $api_result['data'][0]['timezone']['id'];
JavaScript (jQuery.ajax)
Standard Lookup via JavaScript (jQuery.ajax)
Find below a JS example making use of the Standard Lookup endpoint:
// Set endpoint and your access key var ip = '98.142.250.255' var access_key = 'YOUR_ACCESS_KEY'; // Get the API result via jQuery.ajax $.ajax({ url: 'https://test1.ipcheckapi.com/api/v1/info?access_key=' + access_key + '&ips=' + ip, dataType: 'jsonp', success: function(json) { // Output the "id" object inside "timezone" alert(json.data[0].timezone.id); } });