Ipstack API

Ipstack offers a powerful, real-time IP to geolocation API capable of looking up accurate location data and assessing security threats originating from risky IP addresses. Results are delivered within milliseconds in JSON or XML format. Using the ipstack API you will be able to locate website visitors at first glance and adjust your user experience and application accordingly.

This documentation outlines in detail API features, available options and integration guides in different programming languages.

Quickstart Guide

All registered users (free or paid) can use our Quickstart guide to try out all API functionalities at the click of a button. If you're already a customer, you will be able to go to the Quickstart guide using the button below. If not, you can use the button to quickly set up an account.

Get yourself onboarded on ipstack API and start using it in a fraction of minute.

Step 1: Get API Key

Get a free API access key to start using the ipstack API.

Get free API Access Key

Step 2: Get Started with Postman

You can make use of our Postman collection to start using the ipstack API right away.

Run in postman

Fork collection into your workspace


Step 3: Make your first API call

Ipstack API offers three endpoints:

We recommend you to start with the Standard IP Lookup endpoint as it's primary endpoint. It is used to look up single IPv4 or IPv6 addresses. To call this endpoint, simply attach any IPv4 or IPv6 address to the API's base URL.

Check out all the widely used API calls with the necessary parameters in the Postman Collection.

Getting Started

API Access Key

Your API Access Key is your unique authentication key used to gain access to the ipstack API. In order to authenticate with the API, append the access_key parameter to the API's base URL and set it to your access key value.

You can gain access to ipstack API by simpling adding your access_API_key in the based URL as a query parameter. For example,

Base URL:

https://api.ipstack.com/

Append your API Access Key: Here is an example API call illustrating how to authenticate with the ipstack API:

https://api.ipstack.com/134.201.250.155
    ? access_key = YOUR_ACCESS_KEY

API Response

Choosing How You Want Your Data

The ipstack API can give you information in two ways: either in JSON format (which is the default) or in XML format. Below is an example of what the ipstack API would return when you ask it about the IP address 134.201.250.155 using the API call mentioned in the previous section.

{ "ip": "134.201.250.155", "hostname": "134.201.250.155", "type": "ipv4", "continent_code": "NA", "continent_name": "North America", "country_code": "US", "country_name": "United States", "region_code": "CA", "region_name": "California", "city": "Los Angeles", "zip": "90013", "latitude": 34.0453, "longitude": -118.2413, "location": { "geoname_id": 5368361, "capital": "Washington D.C.", "languages": [ { "code": "en", "name": "English", "native": "English" } ], "country_flag": "https://assets.ipstack.com/images/assets/flags_svg/us.svg", "country_flag_emoji": "🇺🇸", "country_flag_emoji_unicode": "U+1F1FA U+1F1F8", "calling_code": "1", "is_eu": false }, "time_zone": { "id": "America/Los_Angeles", "current_time": "2018-03-29T07:35:08-07:00", "gmt_offset": -25200, "code": "PDT", "is_daylight_saving": true }, "currency": { "code": "USD", "name": "US Dollar", "plural": "US dollars", "symbol": "$", "symbol_native": "$" }, "connection": { "asn": 25876, "isp": "Los Angeles Department of Water & Power" }, "security": { "is_proxy": false, "proxy_type": null, "is_crawler": false, "crawler_name": null, "crawler_type": null, "is_tor": false, "threat_level": "low", "threat_types": null } }
<result> <ip>134.201.250.155</ip> <hostname>134.201.250.155</hostname> <type>ipv4</type> <continent_code>NA</continent_code> <continent_name>North America</continent_name> <country_code>US</country_code> <country_name>United States</country_name> <region_code>CA</region_code> <region_name>California</region_name> <city>Los Angeles</city> <zip>90013</zip> <latitude>34.0453</latitude> <longitude>-118.2413</longitude> <location> <geoname_id>5368361</geoname_id> <capital>Washington D.C.</capital> <languages> <code>en</code> <name>English</name> <native>English</native> </languages> <country_flag>https://assets.ipstack.com/images/assets/flags_svg/us.svg</country_flag> <country_flag_emoji>🇺🇸</country_flag_emoji> <country_flag_emoji_unicode>U+1F1FA U+1F1F8</country_flag_emoji_unicode> <calling_code>1</calling_code> <is_eu/> </location> <time_zone> <id>America/Los_Angeles</id> <current_time>2018-03-29T07:53:46-07:00</current_time> <gmt_offset>-25200</gmt_offset> <code>PDT</code> <is_daylight_saving>1</is_daylight_saving> </time_zone> <currency> <code>USD</code> <name>US Dollar</name> <plural>US dollars</plural> <symbol>$</symbol> <symbol_native>$</symbol_native> </currency> <connection> <asn>25876</asn> <isp>Los Angeles Department of Water & Power</isp> </connection> <security> <is_proxy/> <proxy_type/> <is_crawler/> <crawler_name/> <crawler_type/> <is_tor/> <threat_level>low</threat_level> <threat_types/> </security> </result>
JSONXML

API responses come with comprehensive location-related data, currency-related data, timezone-related data, connection-related data and security-related data. Throughout the Response Objects section you will learn more about the given response structure and its objects.

Please note: For illustration purposes we have included both Hostname Lookup and the Security Module in the above API response. Please refer to the sections Hostname Lookup and Security Module for details.

Available Endpoints

The ipstack API offers 3 different endpoints, each accepting a different set of parameters and returning different results. Click on the headings below to jump to the respective endpoint's description.

Connecting via HTTPS

All premium subscription plans available for the ipstack API come with support for 256-bit SSL encryption. To connect to the API via HTTPS, simply use the https protocol instead of standard http.

JSONP Callbacks

Adding a Personal Touch with JSONP Callbacks

You can make the ipstack API response even more flexible by using JSONP Callbacks. This allows you to wrap your requested API result inside a function of your choice. To make it happen, just pass the function name into the API's callback parameter when making the request.

Example Request: In our example request we are specifying the function name to be MY_FUNCTION

https://api.ipstack.com/134.201.250.155
    ? access_key = YOUR_ACCESS_KEY
    & callback = MY_FUNCTION

Example Response: Your API response will be wrapped inside your preferred callback function.

MY_FUNCTION (
  {
    "ip": "134.201.250.155",
    "type": "ipv4",
    "continent_code": "NA",
    "continent_name": "North America",
    "country_code": "US",
    "country_name": "United States",
    "region_code": "CA",
    [...]
  }
)JSON ONLY

Please note: JSONP Callbacks can only be used along with the API's output format being set to json.

Error Codes

If something goes wrong, and the resource you asked for isn't available or an API call fails, the ipstack API will send back a JSON error. This error includes two important things: an error code and a description, helping you figure out what went awry.

Example Error: The following error is returned if your monthly API request volume has been exceeded.

{
  "success": false,
  "error": {
    "code": 104,
    "type": "monthly_limit_reached",
    "info": "Your monthly API request volume has been reached. Please upgrade your plan."
  }
}

Other Errors:

Ipstack API error codes are divided into three categories 1xx – informational error, 3xx – a few additional steps are required, 4xx – resource doesn’t exists

Code Type Info
404 404_not_found The requested resource does not exist.
101 missing_access_key No API Key was specified.
101 invalid_access_key No API Key was specified or an invalid API Key was specified.
102 inactive_user The current user account is not active. User will be prompted to get in touch with Customer Support.
103 invalid_api_function The requested API endpoint does not exist.
104 usage_limit_reached The maximum allowed amount of monthly API requests has been reached.
105 function_access_restricted The current subscription plan does not support this API endpoint.
105 https_access_restricted The user's current subscription plan does not support HTTPS Encryption.
301 invalid_fields One or more invalid fields were specified using the fields parameter.
302 too_many_ips Too many IPs have been specified for the Bulk Lookup Endpoint. (max. 50)
303 batch_not_supported_on_plan The Bulk Lookup Endpoint is not supported on the current subscription plan

Endpoints

Standard IP Lookup

The ipstack's primary endpoint is called Standard Lookup and is used to look up single IPv4 or IPv6 addresses. To call this endpoint, simply attach any IPv4 or IPv6 address to the API's base URL.

API Request:

https://api.ipstack.com/134.201.250.155
    ? access_key = YOUR_ACCESS_KEY

Request Parameters:

Parameter Description
access_key [Required] Your API Access Key.
fields [optional] Set to your preferred output field(s) according to the Specify Output Fields section.
hostname [optional] Set to 1 to enable Hostname Lookup.
security [optional] Set to 1 to enable the Security module.
language [optional] Set to a 2-letter language code according to the Specify Output Language section to change output language.
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.

API Response:

{ "ip": "134.201.250.155", "type": "ipv4", "continent_code": "NA", "continent_name": "North America", "country_code": "US", "country_name": "United States", "region_code": "CA", "region_name": "California", "city": "Los Angeles", "zip": "90013", "latitude": 34.0453, "longitude": -118.2413, "location": { "geoname_id": 5368361, "capital": "Washington D.C.", "languages": [ { "code": "en", "name": "English", "native": "English" } ], "country_flag": "https://assets.ipstack.com/images/assets/flags_svg/us.svg", "country_flag_emoji": "🇺🇸", "country_flag_emoji_unicode": "U+1F1FA U+1F1F8", "calling_code": "1", "is_eu": false }, "time_zone": { "id": "America/Los_Angeles", "current_time": "2018-03-29T07:35:08-07:00", "gmt_offset": -25200, "code": "PDT", "is_daylight_saving": true }, "currency": { "code": "USD", "name": "US Dollar", "plural": "US dollars", "symbol": "$", "symbol_native": "$" }, "connection": { "asn": 25876, "isp": "Los Angeles Department of Water & Power" } }
<result> <ip>134.201.250.155</ip> <type>ipv4</type> <continent_code>NA</continent_code> <continent_name>North America</continent_name> <country_code>US</country_code> <country_name>United States</country_name> <region_code>CA</region_code> <region_name>California</region_name> <city>Los Angeles</city> <zip>90013</zip> <latitude>34.0453</latitude> <longitude>-118.2413</longitude> <location> <geoname_id>5368361</geoname_id> <capital>Washington D.C.</capital> <languages> <code>en</code> <name>English</name> <native>English</native> </languages> <country_flag>https://assets.ipstack.com/images/assets/flags_svg/us.svg</country_flag> <country_flag_emoji>🇺🇸</country_flag_emoji> <country_flag_emoji_unicode>U+1F1FA U+1F1F8</country_flag_emoji_unicode> <calling_code>1</calling_code> <is_eu/> </location> <time_zone> <id>America/Los_Angeles</id> <current_time>2018-03-29T07:53:46-07:00</current_time> <gmt_offset>-25200</gmt_offset> <code>PDT</code> <is_daylight_saving>1</is_daylight_saving> </time_zone> <currency> <code>USD</code> <name>US Dollar</name> <plural>US dollars</plural> <symbol>$</symbol> <symbol_native>$</symbol_native> </currency> <connection> <asn>25876</asn> <isp>Los Angeles Department of Water & Power</isp> </connection> </result>
JSONXML

Response Objects: See the Response Objects section to view detailed descriptions for all API response objects and their values returned by the ipstack API.



Basic Request:

Use this code snippets to look up single IPv4 or IPv6 addresses.

            
        


Get Hostname:

Add "Hostname" and set to 1 to enable Hostname Lookup.

            



Response Wrapped Inside a Custom Function:

Specify a JSONP callback function name and resposne will be wrapped inside the function name.

            



Response in Different Language:

Set to a 2-letter "language" code according to change the output language.

            



Get Specific Response Fields Only:

Suppose you want to get the Zip code of the IP Address – mention "zip" with the "fields" parameter.

Note: You can mention multiple parameters as well with the "fields" parameter.

            



Get Response in XML:

Mention xml with output parameter to get the response in XML.

            

Bulk IP Lookup

The ipstack API also offers the ability to request data for multiple IPv4 or IPv6 addresses at the same time. In order to process IP addresses in bulk, simply append multiple comma-separated IP addresses to the API's base URL.

API Request:

https://api.ipstack.com/134.201.250.155,72.229.28.185,110.174.165.78
    ? access_key = YOUR_ACCESS_KEY

Request Parameters:

Parameter Description
IP Addresses [Required] A comma-separated list of IPv4 or IPv6 addresses; you can also enter a domain URLs to have ipstack resolve the domains to their underlying IP addresses. (Maxmium allowed values: 50)
access_key [Required] Your API Access Key.
fields [optional] Set to your preferred output field(s) according to the Specify Output Fields section.
hostname [optional] Set to 1 to enable Hostname Lookup.
security [optional] Set to 1 to enable the Security module.
language [optional] Set to a 2-letter language code according to the Specify Output Language section to change output language.
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.

API Response:

JSON: The API response for bulk queries will contain one IP data object per requested IP address/domain.

XML: Please note that in XML format the main response object will be <batch></batch> and contain one <result></result> with its respective index number per requested IP address/domain.

[ { "ip": "134.201.250.155", "type": "ipv4", "continent_code": "NA", "continent_name": "North America", "country_code": "US", "country_name": "United States", "region_code": "CA", "region_name": "California", "city": "Los Angeles", "zip": "90013", "latitude": 34.0453, "longitude": -118.2413, "location": { ... }, "time_zone": { ... }, "currency": { ... }, "connection": { ... }, }, { "ip": "72.229.28.185", "type": "ipv4", "continent_code": "NA", "continent_name": "North America", "country_code": "US", "country_name": "United States", "region_code": "NY", "region_name": "New York", "city": "New York", "zip": "10036", "latitude": 40.7605, "longitude": -73.9933, "location": { ... }, "time_zone": { ... }, "currency": { ... }, "connection": { ... }, }, { "ip": "110.174.165.78", "type": "ipv4", "continent_code": "OC", "continent_name": "Oceania", "country_code": "AU", "country_name": "Australia", "region_code": "NSW", "region_name": "New South Wales", "city": "Coffs Harbour", "zip": "2450", "latitude": -30.2963, "longitude": 153.1135, "location": { ... }, "time_zone": { ... }, "currency": { ... }, "connection": { ... }, } ]
<batch> <result index="0"> <ip>134.201.250.155</ip> <type>ipv4</type> <continent_code>NA</continent_code> <continent_name>North America</continent_name> <country_code>US</country_code> <country_name>United States</country_name> <region_code>CA</region_code> <region_name>California</region_name> <city>Los Angeles</city> <zip>90013</zip> <latitude>34.0453</latitude> <longitude>-118.2413</longitude> <location> [...] </location> <time_zone> [...] </time_zone> <currency> [...] </currency> <connection> [...] </connection> </result> <result index="1"> <ip>72.229.28.185</ip> <type>ipv4</type> <continent_code>NA</continent_code> <continent_name>North America</continent_name> <country_code>US</country_code> <country_name>United States</country_name> <region_code>NY</region_code> <region_name>New York</region_name> <city>New York</city> <zip>10036</zip> <latitude>40.7605</latitude> <longitude>-73.9933</longitude> <location> [...] </location> <time_zone> [...] </time_zone> <currency> [...] </currency> <connection> [...] </connection> </result> <result index="2"> <ip>110.174.165.78</ip> <type>ipv4</type> <continent_code>OC</continent_code> <continent_name>Oceania</continent_name> <country_code>AU</country_code> <country_name>Australia</country_name> <region_code>NSW</region_code> <region_name>New South Wales</region_name> <city>Coffs Harbour</city> <zip>2450</zip> <latitude>-30.2963</latitude> <longitude>153.1135</longitude> <location> [...] </location> <time_zone> [...] </time_zone> <currency> [...] </currency> <connection> [...] </connection> </result> </batch>
JSONXML

Response Objects: See the Response Objects section to view detailed descriptions for all API response objects and their values returned by the ipstack API.



Basic Request:

In order to process IP addresses in bulk, simply append multiple comma-separated IP addresses to the API's base URL.

            


Get Hostname:

Add "Hostname" and set to 1 to enable Hostname Lookup.

            



Response Wrapped Inside a Custom Function:

Specify a JSONP callback function name and resposne will be wrapped inside the function name.

            



Response in Different Language:

Set to a 2-letter "language" code according to change the output language.

            



Get Specific Response Fields Only:

Suppose you want to get the Zip code of the IP Address – mention "zip" with the "fields" parameter.

Note: You can mention multiple parameters as well with the "fields" parameter.

            



Get Response in XML:

Mention xml with output parameter to get the response in XML.

            

Requester IP Lookup

The ipstack API also offers a separate API endpoint capable of detecting the IP address which the current API request is coming from. In order to use this endpoint, simply append check to the API's base URL and specify your preferred optional parameters.

API Request:

https://api.ipstack.com/check
    ? access_key = YOUR_ACCESS_KEY

Request Parameters:

Parameter Description
access_key [Required] Your API Access Key.
fields [optional] Set to your preferred output field(s) according to the Specify Output Fields section.
hostname [optional] Set to 1 to enable Hostname Lookup.
security [optional] Set to 1 to enable the Security module.
language [optional] Set to a 2-letter language code according to the Specify Output Language section to change output language.
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.

API Response:

{ "ip": "155.52.187.7", "type": "ipv4", "continent_code": "NA", "continent_name": "North America", "country_code": "US", "country_name": "United States", "region_code": "MA", "region_name": "Massachusetts", "city": "Boston", "zip": "02115", "latitude": 42.3424, "longitude": -71.0878, "location": { "geoname_id": 4930956, "capital": "Washington D.C.", "languages": [ { "code": "en", "name": "English", "native": "English" } ], "country_flag": "https://assets.ipstack.com/images/assets/flags_svg/us.svg", "country_flag_emoji": "🇺🇸", "country_flag_emoji_unicode": "U+1F1FA U+1F1F8", "calling_code": "1", "is_eu": false }, "time_zone": { "id": "America/New_York", "current_time": "2018-03-30T07:54:25-04:00", "gmt_offset": -14400, "code": "EDT", "is_daylight_saving": true }, "currency": { "code": "USD", "name": "US Dollar", "plural": "US dollars", "symbol": "$", "symbol_native": "$" }, "connection": { "asn": 40127, "isp": "Longwood Medical and Academic Area (LMA)" } }
<result> <ip>155.52.187.7</ip> <type>ipv4</type> <continent_code>NA</continent_code> <continent_name>North America</continent_name> <country_code>US</country_code> <country_name>United States</country_name> <region_code>MA</region_code> <region_name>Massachusetts</region_name> <city>Boston</city> <zip>02115</zip> <latitude>42.3424</latitude> <longitude>-71.0878</longitude> <location> <geoname_id>4930956</geoname_id> <capital>Washington D.C.</capital> <languages> <code>en</code> <name>English</name> <native>English</native> </languages> <country_flag>https://assets.ipstack.com/images/assets/flags_svg/us.svg</country_flag> <country_flag_emoji>🇺🇸</country_flag_emoji> <country_flag_emoji_unicode>U+1F1FA U+1F1F8</country_flag_emoji_unicode> <calling_code>1</calling_code> <is_eu/> </location> <time_zone> <id>America/New_York</id> <current_time>2018-03-30T07:54:25-04:00</current_time> <gmt_offset>-14400</gmt_offset> <code>EDT</code> <is_daylight_saving>1</is_daylight_saving> </time_zone> <currency> <code>USD</code> <name>US Dollar</name> <plural>US dollars</plural> <symbol>$</symbol> <symbol_native>$</symbol_native> </currency> <connection> <asn>40127</asn> <isp>Longwood Medical and Academic Area (LMA)</isp> </connection> </result>
JSONXML

Response Objects: See the Response Objects section to view detailed descriptions for all API response objects and their values returned by the ipstack API.



Basic Request:

            

Response Objects

Depending on your subscription plan and the options you choose for your API request, the ipstack API will respond using a series of different modules and objects. Find below a list of all available API response objects explained.

Scroll left & right to navigate

Response Object Description
ip Returns the requested IP address.
hostname Returns the hostname the requested IP resolves to, only returned if Hostname Lookup is enabled.
type Returns the IP address type IPv4 or IPv6.
continent_code Returns the 2-letter continent code associated with the IP.
View all 2-letter continent codes
continent_name Returns the name of the continent associated with the IP.
country_code Returns the 2-letter country code associated with the IP.
List of all 2-letter country codes
country_name Returns the name of the country associated with the IP.
region_code Returns the region code of the region associated with the IP (e.g. CA for California).
region_name Returns the name of the region associated with the IP.
city Returns the name of the city associated with the IP.
zip Returns the ZIP code associated with the IP.
latitude Returns the latitude value associated with the IP.
longitude Returns the longitude value associated with the IP.
location [Object] Returns multiple location-related objects
location > geoname_id Returns the unique geoname identifier in accordance with the Geonames Registry.
location > capital Returns the capital city of the country associated with the IP.
location > languages [Object] Returns an object containing one or multiple sub-objects per language spoken in the country associated with the IP.
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 name (in the API request's main language) of the given language. (e.g. Portuguese)
location > languages > native Returns the native name of the given language. (e.g. Português)
location > country_flag Returns an HTTP URL leading to an SVG-flag icon for the country associated with the IP.
location > country_flag_emoji Returns the emoji icon for the flag of the country associated with the IP.
location > country_flag_emoji_unicode Returns the unicode value of the emoji icon for the flag of the country associated with the IP. (e.g. U+1F1F5 U+1F1F9 for the Portuguese flag)
location > calling_code Returns the calling/dial code of the country associated with the IP. (e.g. 351) for Portugal.
location > is_eu Returns true or false depending on whether or not the county associated with the IP is in the European Union.
time_zone [Object] Returns an object containing timezone-related data.
time_zone > id Returns the ID of the time zone associated with the IP. (e.g. America/Los_Angeles for PST)
time_zone > current_time Returns the current date and time in the location associated with the IP. (e.g. 2018-03-29T22:31:27-07:00)
time_zone > gmt_offset Returns the GMT offset of the given time zone in seconds. (e.g. -25200 for PST's -7h GMT offset)
time_zone > code Returns the universal code of the given time zone.
List of all available codes
time_zone > is_daylight_saving Returns true or false depending on whether or not the given time zone is considered daylight saving time.
currency [Object] Returns an object containing currency-related data.
currency > code Returns the 3-letter code of the main currency associated with the IP.
Example: USD - List of all available currency codes
currency > name Returns the name of the given currency.
currency > plural Returns the plural name of the given currency.
currency > symbol Returns the symbol letter of the given currency.
currency > symbol_native Returns the native symbol letter of the given currency.
connection [Object] Returns an object containing connection-related data.
connection > asn Returns the Autonomous System Number associated with the IP.
connection > isp Returns the name of the ISP associated with the IP.
security [Object] Returns an object containing security-related data.
security > is_proxy Returns true or false depending on whether or not the given IP is associated with a proxy.
security > proxy_type Returns the type of proxy the IP is associated with.
View all potential proxy types
security > is_crawler Returns true or false depending on whether or not the given IP is associated with a crawler.
security > crawler_name Returns the name of the crawler the IP is associated with.
security > crawler_type Returns the type of crawler the IP is associated with.
View all potential crawler types
security > is_tor Returns true or false depending on whether or not the given IP is associated with the anonymous Tor system.
security > threat_level Returns the type of threat level the IP is associated with.
View all threat levels
security > threat_types [object] Returns an object containing all threat types associated with the IP.
View all potential threat types

Options

Specify Output Format

Using the ipstack API's output parameter the API result format can be switched between JSON (default) and XML. Set the output parameter to json or xml depending on your preference.

Requesting JSON Format

https://api.ipstack.com/134.201.250.155
    ? access_key = YOUR_ACCESS_KEY
    & output = json

Requesting XML Format

https://api.ipstack.com/134.201.250.155
    ? access_key = YOUR_ACCESS_KEY
    & output = xml

To see the API response, navigate to the API Response section.

Specify Response Fields

To save bandwidth and speed up response times, the ipstack API's fields parameter can be used to limit API results to a certain object or set of objects.

This parameter is supported by all 3 API endpoints. To use this feature, append the fields parameter to your API request URL and specify one of the following options:

fields = main // returns main API objects from "ip" to "longitude"

fields = country_code // returns only the "country_code" object

fields = location // returns the entire "location" object with sub-objects
fields = location.capital // returns only the "capital" object inside "location"

fields = country_code,location.capital // returns both the "country_code" and the "capital" object

Example Request:
Setting the fields object to country_code causes the ipstack API to return only the country_code object.

https://api.ipstack.com/134.201.250.155
    ? access_key = YOUR_ACCESS_KEY
    & fields = country_code

Example Response:

{ "country_code": "US" }

Important: Please note that modules not supported by your subscription plan (e.g. time_zone on the Free Plan) will cause error 301 to be returned by the API. The same error will be shown when trying to access the Security Module without having set &security=1 in the API request.

Specify Response Language

The ipstack API is capable of delivering its result set in different languages. To request data in a language other than English (default), append the API's language parameter to your API request URL and set it to one of the supported 2-letter language codes.

Supported languages:

  • en - English/US
  • de - German
  • es - Spanish
  • fr - French
  • ja - Japanese
  • pt-br - Portugues (Brazil)
  • ru - Russian
  • zh - Chinese

Example Request: In the following example request the language is set to de for German.

https://api.ipstack.com/134.201.250.155
    ? access_key = YOUR_ACCESS_KEY
    & language = de

Example Response: The API now responds in German.

{ "ip": "134.201.250.155", "type": "ipv4", "continent_code": "NA", "continent_name": "Nordamerika", <-- translated "country_code": "US", "country_name": "United States", "region_code": "CA", "region_name": "Kalifornien", <-- translated "city": "Los Angeles", "zip": "90013", "latitude": 34.0453, "longitude": -118.2413, "location": { ... }, "time_zone": { ... }, "currency": { ... }, "connection": { ... }, }
<result> <ip>134.201.250.155</ip> <type>ipv4</type> <continent_code>NA</continent_code> <continent_name>Nordamerika</continent_name> <country_code>US</country_code> <country_name>United States</country_name> <region_code>CA</region_code> <region_name>Kalifornien</region_name> <city>Los Angeles</city> <zip>90013</zip> <latitude>34.0453</latitude> <longitude>-118.2413</longitude> <location> [...] </location> <time_zone> [...] </time_zone> <currency> [...] </currency> <connection> [...] </connection> </result>
JSONXML

Please note that certain objects may not be subject to translation.

Enable Security Module

Customers subscribed to the Professional Plus Plan may access the ipstack API's Security Module, which can be used to assess risks and threats originating from certain IP addresses before any harm can be done to a website or web application.

In order to use this feature, append the API's security parameter and set it to 1.

Example Request:

https://api.ipstack.com/103.3.61.114
    ? access_key = YOUR_ACCESS_KEY
    & security = 1

Example Response: If the Security Module is supported by your subscription plan, the API response will now contain a security object. For illustration purposes the IP address 103.3.61.114, which is known to be used by the Tor system, has been used for this example API request.

[...] "security": { "is_proxy": false, "proxy_type": null, "is_crawler": false, "crawler_name": null, "crawler_type": null, "is_tor": true, "threat_level": "high", "threat_types": [ "tor" ] } [...]
[...] <security> <is_proxy/> <proxy_type/> <is_crawler/> <crawler_name/> <crawler_type/> <is_tor/> <threat_level>low</threat_level> <threat_types/> </security> [...]
JSONXML

To learn more about each security response object, please refer to the Response Objects section.

Enable Hostname Lookup

By default, the ipstack API does not return information about the hostname the given IP address resolves to. In order to include the hostname object in your API result, append the API's hostname parameter and set it to 1.

Example Request:

https://api.ipstack.com/160.39.144.19
    ? access_key = YOUR_ACCESS_KEY
    & hostname = 1

Example Response: If Hostname Lookup is enabled, the API response will now come with a hostname object containing the given hostname value.

{ "ip": "160.39.144.19", "hostname": "dyn-160-39-144-19.dyn.columbia.edu", [...] }
<result> <ip>160.39.144.19</ip> <hostname>dyn-160-39-144-19.dyn.columbia.edu</type> [...] </result>
JSONXML

Important: Hostname Lookup is disabled by default to reduce bandwidth. Please note that enabling Hostname Lookup may increase API response times.

Business Continuity - API Overages

Ensuring our customers achieve success is paramount to what we do at APILayer. For this reason, we will be rolling out our Business Continuity plan guaranteeing your end users will never see a drop in coverage. Every plan has a certain amount of API calls that you can make in the given month. However, we would never want to cut your traffic or impact user experience negatively for your website or application in case you get more traffic.

What is an overage?

An overage occurs when you go over a quota for your API plan. When you reach your API calls limit, we will charge you a small amount for each new API call so we can make sure there will be no disruption in the service we provide to you and your website or application can continue running smoothly.

Prices for additional API calls will vary based on your plan. See table below for prices per call and example of an overage billing.

Plan Name Monthly Price Number of Calls Overage Price per call Overage Total price
Basic $12.99 50,000 0.00031176 10,000 $16.11
Professional $59.99 500,000 0.000143976 10,000 $61.43
Professional Plus $99.99 2,000,000 0.000059994 10,000 $100.59

Why does APILayer have overage fees?

Overage fees allow developers to continue using an API once a quota limit is reached and give them time to upgrade their plan based on projected future use while ensuring API providers get paid for higher usage.

How do I know if I will be charged for overages?

When you are close to reaching your API calls limit for the month, you will receive an automatic notification (at 75%, 90% and 100% of your monthly quota). However, it is your responsibility to review and monitor for the plan’s usage limitations. You are required to keep track of your quota usage to prevent overages. You can do this by tracking the number of API calls you make and checking the dashboard for up-to-date usage statistics.

How will I be charged for my API subscription?

You will be charged for your monthly subscription plan, plus any overage fees applied. Your credit card will be billed after the billing period has ended.

What happens if I don’t have any overage fees?

In this case, there will be no change to your monthly invoice. Only billing cycles that incur overages will see any difference in monthly charges. The Business Continuity plan is an insurance plan to be used only if needed and guarantees your end users never see a drop in coverage from you.

What if I consistently have more API calls than my plan allows?

If your site consistently surpasses the set limits each month, you may face additional charges for the excess usage. Nevertheless, as your monthly usage reaches a certain threshold, it becomes more practical to consider upgrading to the next plan. By doing so, you ensure a smoother and more accommodating experience for your growing customer base.

I would like to upgrade my plan. How can I do that?

You can easily upgrade your plan by going to your Dashboard and selecting the new plan that would be more suitable for your business needs. Additionally, you may contact your Account Manager to discuss a custom plan if you expect a continuous increase in usage.

Introducing Platinum Support - Enterprise-grade support for APILayer

Upgrade your APIlayer subscription with our exclusive Platinum Support, an exceptional offering designed to enhance your business’ API management journey. With Platinum Support, you gain access to a host of premium features that take your support experience to a whole new level.

What does Platinum Support include?

Standard Support Platinum Support
General review on the issue Tick icon Tick icon
Access to knowledge base articles Tick icon Tick icon
Email support communication Tick icon Tick icon
Regular products updates and fixes Tick icon Tick icon
Dedicated account team Cross icon Tick icon
Priority Email Support with unlimited communication Cross icon Tick icon
Priority bug and review updates Cross icon Tick icon
Option for quarterly briefing call with product Management Cross icon Tick icon
Features requests as priority roadmap input into product Cross icon Tick icon

Priority Email Support: Experience unrivaled responsiveness with our priority email support. Rest assured that your inquiries receive top-priority attention, ensuring swift resolutions to any issues.

Unlimited Communication: Communication is key, and with Platinum Support, you enjoy unlimited access to our support team. No matter how complex your challenges are, our experts are here to assist you every step of the way.

Priority Bug Review and Fixes: Bugs can be a headache, but not with Platinum Support. Benefit from accelerated bug review and fixes, minimizing disruptions and maximizing your API performance.

Dedicated Account Team: We understand the value of personalized attention. That's why Platinum Support grants you a dedicated account team, ready to cater to your specific needs and provide tailored solutions.

Quarterly Briefing Call with Product Team: Stay in the loop with the latest updates and insights from our Product team. Engage in a quarterly briefing call to discuss new features, enhancements, and upcoming developments.

Priority Roadmap Input: Your input matters! As a Platinum Support subscriber, your feature requests receive top priority, shaping our product roadmap to align with your evolving requirements.

Don't settle for the standard when you can experience the exceptional. Upgrade to Platinum Support today and supercharge your APIlayer experience!

Any questions? We're happy to help!

Contact Support