Ipinfo API Documentation
ipinfo provides an easy-to-use API interface allowing customers to look various pieces of information IPv4 and IPv6 addresses are associated with. For each IP address processed, the API returns more than 45 unique data points, such as location data, connection data, ISP information, time zone, currency and security assessment data.
The API is REST-based, lookup requests are made using straightforward HTTP GET URLs and results are returned in lightweight JSON or XML format within a matter of a few milliseconds.
This API documentation will outline in detail the API's specification, access and features. At the very bottom you will find code examples in different programming languages. In case any technical questions are left unanswered, please feel free to contact ipinfo Customer Service.
Specs & Overview
API Access Key & Authentication
After creating an account, you will be assigned a API access key, a unique hash consisting of 32 characters that will allow you to authenticate with the ipinfo API interface. To do this, simply append your API access key to the API's base URL using the access_key
parameter.
Sign Up to Run API Requesthttps://api.ipinfo.info/api/161.185.160.93 ? 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 can reset it with immediate effect using your account dashboard at any given time.
API Response
Following a successful API request, the API will return more than 40 unique response objects containing result data. An API response can be returned in JSON or XML format and is structured into 4 modules: General information, location data, time zone data, currency data, connection data and security data. Response objects contained in each module will be explained in detail in the API Response Objects section.
Find below an example API response for an IPv4 address in Brooklyn, New York.
Example API Response:
{ "ip": "161.185.160.93", "hostname": "161.185.160.93", "type": "ipv4", "continent_code": "NA", "continent_name": "North America", "country_code": "US", "country_name": "United States", "region_code": "NY", "region_name": "New York", "city": "Brooklyn", "zip": "11238", "latitude": 40.676, "longitude": -73.9629, "msa": "35620", "dma": "501", "radius": 30.012950897216797, "ip_routing_type": "fixed", "connection_type": "tx", "location": { "geoname_id": 5110302, "capital": "Washington D.C.", "languages": [ { "code": "en", "name": "English", "native": "English" } ], "country_flag": "http://assets.ipinfo.info/flags/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-09-24T05:07:10-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": 22252, "isp": "The City of New York", "sld": "nyc", "tld": "gov", "carrier": "the city of new york", "home": false, "organization_type": "Government (Municipal)", "isic_code": "O8411", "naics_code": "009211" }, "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, "proxy_last_detected": null, "proxy_level": null, "vpn_service": null, "anonymizer_status": null, "hosting_facility": false } }<result> <ip>161.185.160.93</ip> <hostname>161.185.160.93</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>NY</region_code> <region_name>New York</region_name> <city>Brooklyn</city> <zip>11238</zip> <latitude>40.676</latitude> <longitude>-73.9629</longitude> <msa>35620</msa> <dma>501</dma> <radius>30.01295</radius> <ip_routing_type>fixed</ip_routing_type> <connection_type>tx</connection_type> <location> <geoname_id>5110302</geoname_id> <capital>Washington D.C.</capital> <languages> <code>en</code> <name>English</name> <native>English</native> </languages> <country_flag>https://assets.ipinfo.info/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-09-24T08:27:07-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>22252</asn> <isp>The City of New York</isp> <sld>nyc</sld> <tld>gov</tld> <carrier>the city of new york</carrier> <home>false</home> <organization_type>Government (Municipal)</organization_type> <isic_code>O8411</isic_code> <naics_code>009211</naics_code> </connection> <security> <is_proxy/> <proxy_type/> <is_crawler/> <crawler_name/> <crawler_type/> <is_tor/> <threat_level>low </threat_level> <threat_types/> <proxy_last_detected/> <proxy_level/> <vpn_service/> <anonymizer_status/> <hosting_facility/> </security> </result>JSONXML
Please note: To be able to show you a comprehensive API response, Hostname and Security data have been included in the result above. To enable this data for your API response, please follow the instructions in the following sections of this documentation: Hostname Lookup and Security Data.
API Endpoints
The API comes with a total of 3 available API endpoints, each covering a different type functionality. Please find below a quick overview and click on any of the endpoints to learn more about its 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.
256-bit HTTPS Encryption Available on: All plans
You can connect to the API using industry standard HTTPS (SSL) by appending an s
to the HTTP Protocol. You can see an example API request using HTTPS below.
Example API Request:
https://api.ipinfo.info/api/161.185.160.93
JSONP Callbacks
The API supports JSONP Callbacks. To make use of this feature, simply append the API's callback
parameter to your API request URL and set it to your preferred function name. The API will then return your API results set wrapped inside the tags of the function you specified.
Example API Request:
Sign Up to Run API Requesthttps://api.ipinfo.info/api/161.185.160.93 ? access_key = YOUR_ACCESS_KEY & callback = FUNCTION_NAME
Example API Response:
CALLBACK_FUNCTION ({ { "ip": "161.185.160.93", "hostname": "161.185.160.93", "type": "ipv4", "continent_code": "NA", "continent_name": "North America", "country_code": "US", "country_name": "United States", "region_code": "NY", [...] } })JSON ONLY
Please note: The API also supports Access-Control (CORS) headers.
API Error Codes
In the event that your API request fails for any reason, the API will return a JSON error message detailing information about the error that occurred. As an example, find below an error the API responds with if the limit of monthly API requests has been reached.
Example Error:
{ "success": false, "error": { "code": 104, "type": "monthly_limit_reached", "info": "Your monthly API request volume has been reached. Please upgrade your plan." } }JSON ONLY
Common API Errors:
Code | Type | Info |
---|---|---|
404 |
404_not_found |
User requested a resource which does not exist. |
101 |
missing_access_key |
User did not supply an access key. |
101 |
invalid_access_key |
User supplied an invalid access key. |
102 |
inactive_user |
User account is inactive or blocked. |
103 |
invalid_api_function |
User requested a non-existent API function. |
104 |
usage_limit_reached |
User has reached his subscription's monthly request allowance. |
105 |
function_access_restricted |
The user's current subscription does not support this API function. |
301 |
invalid_fields |
User specified one or more invalid fields inside the fields parameter. |
302 |
too_many_ips |
User specified too many IP addresses in a single Bulk Lookup request. |
303 |
batch_not_supported_on_plan |
The user's current subscription plan does not support Bulk Lookup. |
Endpoints
Standard IP Lookup Available on: All plans
To look up a single IP address of your choice, simply append an IPv4 or IPv6 address to the API's base URL. Below you will find an example API request, required parameters and an example API response.
Example API Request:
Sign Up to Run API Requesthttps://api.ipinfo.info/api/161.185.160.93 ? access_key = YOUR_ACCESS_KEY
Request Parameters:
Object | Description |
---|---|
IP Address |
[Required] An IPv4 or IPv6 address of your choice. It is also possible to enter a domain URL to have the API resolve the domain to the underlying IP address. |
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. |
language |
[optional] Set to a 2-letter language code according to the Specify Response Language section to specify response 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. |
Example API Response:
A standard API response will come with general information about the given IP address and location data. If you are subscribed to the Standard Plan or higher, the API will additionally return time zone, currency and connection data.
{ "ip": "161.185.160.93", "type": "ipv4", "continent_code": "NA", "continent_name": "North America", "country_code": "US", "country_name": "United States", "region_code": "NY", "region_name": "New York", "city": "Brooklyn", "zip": "11238", "latitude": 40.676, "longitude": -73.9629, "msa": "35620", "dma": "501", "radius": 30.012950897216797, "ip_routing_type": "fixed", "connection_type": "tx", "location": { "geoname_id": 5110302, "capital": "Washington D.C.", "languages": [ { "code": "en", "name": "English", "native": "English" } ], "country_flag": "http://assets.ipinfo.info/flags/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-09-24T05:07:10-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": 22252, "isp": "The City of New York", "sld": "nyc", "tld": "gov", "carrier": "the city of new york", "home": false, "organization_type": "Government (Municipal)", "isic_code": "O8411", "naics_code": "009211" } }<result> <ip>161.185.160.93</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>Brooklyn</city> <zip>11238</zip> <latitude>40.676</latitude> <longitude>-73.9629</longitude> <msa>35620</msa> <dma>501</dma> <radius>30.01295</radius> <ip_routing_type>fixed</ip_routing_type> <connection_type>tx</connection_type> <location> <geoname_id>5110302</geoname_id> <capital>Washington D.C.</capital> <languages> <code>en</code> <name>English</name> <native>English</native> </languages> <country_flag>https://assets.ipinfo.info/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-09-24T08:27:07-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>22252</asn> <isp>The City of New York</isp> <sld>nyc</sld> <tld>gov</tld> <carrier>the city of new york</carrier> <home>false</home> <organization_type>Government (Municipal)</organization_type> <isic_code>O8411</isic_code> <naics_code>009211</naics_code> </connection> </result>JSONXML
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.
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 Available on: Business Plan and higher
To look up multiple IP addresses at once, simply attach a comma-separated list of IPv4 or IPv6 addresses to the API's base URL. The API will then respond with an array of results, containing one sub-array per IP address looked up.
Example API Request:
Sign Up to Run API Requesthttps://api.ipinfo.info/api/161.185.160.93,87.111.168.248,210.138.184.59 ? access_key = YOUR_ACCESS_KEY
Request Parameters:
Object | Description |
---|---|
IP Addresses |
[Required] A comma-separated list of IPv4 or IPv6 addresses of your choice. It is also possible to enter domain URLs to have the API resolve the underlying IP addresses. (Limit: 50 values) |
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. |
language |
[optional] Set to a 2-letter language code according to the Specify Response Language section to specify response 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. |
Example API Response:
A Bulk Lookup API response contains an array of results with each result associated with one of the IP addresses contained in the API request. The API results below have been shortened for readability purposes.
{ "ip": "161.185.160.93", "type": "ipv4", "continent_code": "NA", "continent_name": "North America", "country_code": "US", "country_name": "United States", "region_code": "NY", "region_name": "New York", "city": "Brooklyn", "zip": "11238", "latitude": 40.676, "longitude": -73.9629, "msa": "35620", "dma": "501", "radius": 30.012950897216797, "ip_routing_type": "fixed", "connection_type": "tx", [...] }, { "ip": "161.185.160.93", "type": "ipv4", "continent_code": "EU", "continent_name": "Europe", "country_code": "ES", "country_name": "Spain", "region_code": "GA", "region_name": "Galicia", "city": "Santiago de Compostela", "zip": "15781", "latitude": 42.88, "longitude": -8.5448, "msa": "35620", "dma": "501", "radius": 30.012950897216797, "ip_routing_type": "fixed", "connection_type": "tx", [...] }, { "ip": "210.138.184.59", "type": "ipv4", "continent_code": "AS", "continent_name": "Asia", "country_code": "JP", "country_name": "Japan", "region_code": "13", "region_name": "Tokyo", "city": "Tokyo", "zip": "102-0082", "latitude": 35.685, "longitude": 139.7514, "msa": "35620", "dma": "501", "radius": 30.012950897216797, "ip_routing_type": "fixed", "connection_type": "tx", [...] }<result> <ip>161.185.160.93</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>Brooklyn</city> <zip>11238</zip> <latitude>40.676</latitude> <longitude>-73.9629</longitude> <msa>35620</msa> <dma>501</dma> <radius>30.01295</radius> <ip_routing_type>fixed</ip_routing_type> <connection_type>tx</connection_type> [...] </result> <result> <ip>87.111.168.248</ip> <type>ipv4</type> <continent_code>EU</continent_code> <continent_name>Europe</continent_name> <country_code>ES</country_code> <country_name>Spain</country_name> <region_code>GA</region_code> <region_name>Galicia</region_name> <city>Santiago de Compostela</city> <zip>15781</zip> <latitude>42.88</latitude> <longitude>-8.5448</longitude> <msa>35620</msa> <dma>501</dma> <radius>30.01295</radius> <ip_routing_type>fixed</ip_routing_type> <connection_type>tx</connection_type> [...] </result> <result> <ip>210.138.184.59</ip> <type>ipv4</type> <continent_code>AS</continent_code> <continent_name>Asia</continent_name> <country_code>JP</country_code> <country_name>Japan</country_name> <region_code>13</region_code> <region_name>Tokyo</region_name> <city>Tokyo</city> <zip>102-0082</zip> <latitude>35.685</latitude> <longitude>139.7514</longitude> <msa>35620</msa> <dma>501</dma> <radius>30.01295</radius> <ip_routing_type>fixed</ip_routing_type> <connection_type>tx</connection_type> [...] </result>JSONXML
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.
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.
Origin IP Lookup Available on: All plans
To look up the IP address the current API request is coming from, simply attach check
to the API's base URL. The API will then perform a lookup request based on that IP address and return a full set of API results.
Example API Request:
Sign Up to Run API Requesthttps://api.ipinfo.info/api/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. |
language |
[optional] Set to a 2-letter language code according to the Specify Response Language section to specify response 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. |
Example API Response:
{ "ip": "161.185.160.93", "type": "ipv4", "continent_code": "NA", "continent_name": "North America", "country_code": "US", "country_name": "United States", "region_code": "NY", "region_name": "New York", "city": "Brooklyn", "zip": "11238", "latitude": 40.676, "longitude": -73.9629, "msa": "35620", "dma": "501", "radius": 30.012950897216797, "ip_routing_type": "fixed", "connection_type": "tx", "location": { "geoname_id": 5110302, "capital": "Washington D.C.", "languages": [ { "code": "en", "name": "English", "native": "English" } ], "country_flag": "http://assets.ipinfo.info/flags/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-09-24T05:07:10-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": 22252, "isp": "The City of New York", "sld": "nyc", "tld": "gov", "carrier": "the city of new york", "home": false, "organization_type": "Government (Municipal)", "isic_code": "O8411", "naics_code": "009211" } }<result> <ip>161.185.160.93</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>Brooklyn</city> <zip>11238</zip> <latitude>40.676</latitude> <longitude>-73.9629</longitude> <msa>35620</msa> <dma>501</dma> <radius>30.01295</radius> <ip_routing_type>fixed</ip_routing_type> <connection_type>tx</connection_type> <location> <geoname_id>5110302</geoname_id> <capital>Washington D.C.</capital> <languages> <code>en</code> <name>English</name> <native>English</native> </languages> <country_flag>https://assets.ipinfo.info/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-09-24T08:27:07-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>22252</asn> <isp>The City of New York</isp> <sld>nyc</sld> <tld>gov</tld> <carrier>the city of new york</carrier> <home>false</home> <organization_type>Government (Municipal)</organization_type> <isic_code>O8411</isic_code> <naics_code>009211</naics_code> </connection> </result>JSONXML
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.
Basic Request:
Response Objects
Based on which plan you are subscribed to and the options you specify for your API request, there are over 40 unique response objects the API is capable of responding with. Find below a complete 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. |
msa |
Returns Metropolitan Statistical Areas with extensive demographic info defined by the US OMB using Census data. |
dma |
Defined Market Areas (DMAs) are codes assigned to geographical regions where the population typically receives similar media. |
radius |
Returns the radius in miles around an IP geolocation where the user is likely to be located. |
ip_routing_type |
It specifies how the connection is routed through the Internet and determines user proximity to the IP address. |
ip_routing_type > fixed |
User connects via fixed-line (e.g., cable, DSL, fiber) and likely near IP location. |
ip_routing_type > aol |
User is part of the AOL network. Country is identifiable in most cases but precise location is not possible. |
ip_routing_type > pop |
User connects via a regional ISP and likely near IP location, possibly across boundaries. |
ip_routing_type > satellite |
User connects via satellite and hence location could be anywhere within the satellite beam, which can span a continent or more. |
ip_routing_type > cache proxy |
User is using a proxy connection. It is possible the user is located in a different country from the IP location |
ip_routing_type > international proxy |
User is connecting through a proxy that routes traffic from multiple countries. |
ip_routing_type > regional proxy |
User is connecting through a proxy that routes traffic from multiple states within a single country. |
ip_routing_type > corp proxy |
User connects via a corporate network proxy. |
ip_routing_type > mobile gateway |
User connects mobile devices through a gateway, possibly in a different country. |
connection_type |
How the user connects to the Internet. IPv6 supported. |
connection_type > ocx |
Fiber optic connections (e.g., OC-3, OC-48) used primarily by large backbone carriers. |
connection_type > tx |
Leased lines (e.g., T1, T2, T3, T4) used by many small- and medium-sized companies. |
connection_type > consumer satellite |
High-speed links via satellite. |
connection_type > framerelay |
used as a backup or alternative to T-1. |
connection_type > dsl |
Digital Subscriber Line broadband circuits. Range in speed from 256 Kbps to 20 Mbps. |
connection_type > cable |
Cable modem broadband circuits. Range in speed from 128 Kbps to 100 Mbps. |
connection_type > isdn |
ntegrated Services Digital Network. Provides 128 Kbps speed, with ISDN modems and switches offering 1 Mbps and greater speeds. |
connection_type > dialup |
Consumer dial-up modem technology, which operates at 56 Kbps. |
connection_type > fixed wireless |
Fixed wireless connections (e.g., WDSL, WiMax). |
connection_type > mobile wireless |
Cellular networks (e.g., CDMA, EDGE, 3G, 4G). Speeds vary from 19.2 Kbps to 12 Mbps. |
connection_type > unknown low |
Unknown connection type, low speed. |
connection_type > unknown medium |
Unknown connection type, medium speed. |
connection_type > unknown high |
Unknown connection type, high speed. |
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. 2018-03-29T22:31:27-07: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. |
currency > symbol_native |
Returns the native 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. |
connection > sld |
Returns the name of the second-level domain preceding the top-level domain (e.g., "home" in www.home.neustar). |
connection > tld |
Returns top-level domain, the most general part of a domain (e.g., com, net, edu, country codes). |
connection > carrier |
Returns the name of the organization owning the ASN, responsible for network traffic. |
connection > home |
Indicates if the connection is from a residential network (true/false). |
connection > organization_type |
Classification of the registering organization's type (e.g., Insurance, Banking, Education, etc). |
connection > isic_code |
Returns International Standard Industrial Classification code, Rev. 4, of the organization type. |
connection > naics_code |
Returns North American Industry Classification System code, v2007, of the organization type. |
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 |
security > threat_types |
[object] If relevant, returns an object containing all threat types associated with the IP address. View all potential threat types |
security > anonymizer_status |
Returns the anonymizing proxy status of an IP address: active, suspect, inactive, or private. |
security > anonymizer_status > Active |
Anonymizer tested positive within the last month. |
security > anonymizer_status > Suspect |
Anonymizer tested positive within the last three months. |
security > anonymizer_status > Inactive |
Anonymizer tested positive within the last six months. |
security > anonymizer_status > Private |
IP addresses with anonymous proxies, usually commercial VPNs, not routinely testable. |
security > proxy_last_detected |
Returns the last detection date of an active anonymizing proxy (format: yyyy-mm-dd). IPv6 supported. |
security > proxy_level |
Returns the degree of IP concealment by the proxy: transparent, anonymous, distorting, or elite. |
security > proxy_level > Anonymous |
|
security > proxy_level > Distorting |
|
security > proxy_level > Elite |
|
security > proxy_level > Transparent |
|
security > proxy_type |
Returns the network or protocol used by the proxy server: http, Tor, web, SOCKS, etc. |
security > proxy_type > HTTP |
Uses HTTP protocol, accessible to any Internet user. |
security > proxy_type > Service |
Operated by organizations providing VPN access to subscribers. |
security > proxy_type > SOCKS |
Uses SOCKS protocol, accessible to any Internet user. |
security > proxy_type > SOCKS HTTP |
Uses both HTTP and SOCKS protocols, accessible to any Internet user. |
security > proxy_type > Tor |
Part of the Tor network, routes traffic through changing nodes. |
security > proxy_type > Web |
Operates via a web browser, proxying user requests through a website. |
security > proxy_type > Privacy Proxy |
Used by privacy service providers to mask user IPs, with fixed country locations |
security > vpn_service |
Returns the VPN service name for IPs with anonymizer_status 'private' and proxy_type 'service' (VPN). Not applicable for IPv6. |
security > hosting_facility |
Indicates if the IP is from a hosting facility (true/false). |
Options
Specify Response Format Available on: All plans
The API is capable of delivering API results in JSON (default) and XML format. The response format can be controlled by appending the API's output
parameter to your API request URL and setting it to json
or xml
.
Example API Request - JSON:
Sign Up to Run API Requesthttps://api.ipinfo.info/api/161.185.160.93 ? access_key = YOUR_ACCESS_KEY & output = json
Example API Request - XML:
Sign Up to Run API Requesthttps://api.ipinfo.info/api/161.185.160.93 ? 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 ipinfo can be extensive in size. To limit your API result set to specific fields or types of information, simply append the API's fields
parameter to your API request URL and set it to a specific field or a comma-separated list of fields.
Examples:
fields = main // returns general API fields, only from "ip" to "longitude" fields = city // returns only the "city" object fields = location // returns the complete "location" object with sub-objects fields = location.calling_code // returns only the "calling_code" object inside "location" fields = latitude,longitude // returns both the "latitude" and the "longitude" objects
Example API Request - JSON:
Sign Up to Run API Requesthttps://api.ipinfo.info/api/161.185.160.93 ? access_key = YOUR_ACCESS_KEY & fields = latitude,longitude
Would you like to see an API response? Jump to the API Response section.
Specify Response Language Available on: All plans
The API is capable of translating certain applicable objects contained in the API response. The default language is always English; other languages can be requested by appending the API's language
to your API request URL and setting it to one of the available 2-letter language codes.
Available Language Codes:
en - English/US de - German ed - Spanish fr - French ja - Japanese pt-br - Portuguese (Brazil) ru - Russian zh - Chinese
Example API Request:
In the example request below we are specifying Spanish as language.
Sign Up to Run API Requesthttps://api.ipinfo.info/api/161.185.160.93 ? access_key = YOUR_ACCESS_KEY & language = es
Example API Response:
In the example response below you will notice that all applicable response objects have been translated to Spanish. Please note that the API response has been shortened for readability purposes.
{ "ip": "161.185.160.93", "type": "ipv4", "continent_code": "NA", "continent_name": "Norteamérica", <-- translated "country_code": "US", "country_name": "Estados Unidos", <-- translated "region_code": "NY", "region_name": "Nueva York", <-- translated "city": "Brooklyn", "zip": "11238", "latitude": 40.676, "longitude": -73.9629, "msa": "35620", "dma": "501", "radius": 30.012950897216797, "ip_routing_type": "fixed", "connection_type": "tx", [...] }<result> <ip>161.185.160.93</ip> <type>ipv4</type> <continent_code>NA</continent_code> <continent_name>Norteamérica</continent_name> <-- translated <country_code>US</country_code> <country_name>Estados Unidos</country_name> <-- translated <region_code>NY</region_code> <region_name>Nueva York</region_name> <-- translated <city>Brooklyn</city> <zip>11238</zip> <latitude>40.676</latitude> <longitude>-73.9629</longitude> <msa>35620</msa> <dma>501</dma> <radius>30.01295</radius> <ip_routing_type>fixed</ip_routing_type> <connection_type>tx</connection_type> [...] </result>JSONXML
Enable Hostname Lookup Available on: All plans
To reduce bandwidth and speed up API responses standard IP lookups do not return hostname information. To include hostname data in your API responses, simply append the API's hostname
parameter and set it to 1
.
Example API Request:
Sign Up to Run API Requesthttps://api.ipinfo.info/api/1.4.193.15 ? 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.
{ "ip": "1.4.193.15", "hostname": "node-cun.pool-1-4.dynamic.totbb.net", [...] }<result> <ip>161.185.160.93</ip> <hostname>node-cun.pool-1-4.dynamic.totbb.net</type> [...] </result>JSONXML
Please note: Enabling Hostname Lookup may cause the speed of API requests to decrease slightly.
Enable Security Data Available on: Business Pro Plan and higher
The API is capable of delivering valuable security assessment data, including the detection of threats like the TOR Network, proxies, and more. To enable Security Data in your API request, simply append the API's security
parameter to your API request URL and set it to 1
.
Example API Request:
Sign Up to Run API Requesthttps://api.ipinfo.info/api/76.8.255.114 ? access_key = YOUR_ACCESS_KEY & security = 1
Example API Response:
In the API response below you will notice that the threat types attack_source
and attack_source_mail
have been detected, indicating that the given IP address is in some way associated with spam via email.
{ [...] "security": { "is_proxy": false, "proxy_type": null, "is_crawler": false, "crawler_name": null, "crawler_type": null, "is_tor": false, "threat_level": "high", "threat_types": [ "attack_source", "attack_source_mail" ], "proxy_last_detected": null, "proxy_level": null, "vpn_service": null, "anonymizer_status": null, "hosting_facility": false } }<result> [...] <security> <is_proxy/> <proxy_type/> <is_crawler/> <crawler_name/> <crawler_type/> <is_tor/> <threat_level>high</threat_level> <threat_types>attack_source</threat_types> <threat_types>attack_source_mail</threat_types> <proxy_last_detected/> <proxy_level/> <vpn_service/> <anonymizer_status/> <hosting_facility/> </security> </result>JSONXML
Please note: In the above response the rest of the API response has been skipped for readability purposes.
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 = '161.185.160.93'; $access_key = 'YOUR_ACCESS_KEY'; // Initialize CURL: $ch = curl_init('https://api.ipinfo.info/'.$ip.'?access_key='.$access_key.''); 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 "calling_code" object inside "location" echo $api_result['location']['calling_code'];
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 = '134.201.250.155' var access_key = 'YOUR_ACCESS_KEY'; // get the API result via jQuery.ajax $.ajax({ url: 'https://api.ipinfo.info/' + ip + '?access_key=' + access_key, dataType: 'jsonp', success: function(json) { // output the "calling_code" object inside "location" alert(json.location.calling_code); } });
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.0003897 | 10,000 | $16.89 |
Professional | $59.99 | 500,000 | 0.00017997 | 10,000 | $61.79 |
Professional Plus | $99.99 | 2,000,000 | 0.0000749925 | 10,000 | $100.74 |
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 | ||
Access to knowledge base articles | ||
Email support communication | ||
Regular products updates and fixes | ||
Dedicated account team | ||
Priority Email Support with unlimited communication | ||
Priority bug and review updates | ||
Option for quarterly briefing call with product Management | ||
Features requests as priority roadmap input into product |
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!