This API service offers seamless and efficient integration of IP geolocation for your scripts or websites. Say goodbye to the hassle of configuring and maintaining local GeoIP libraries. Our AI-powered system aggregates and analyzes data from multiple sources, ensuring the most precise geolocation information. The database updates almost in real time, guaranteeing up-to-date accuracy without manual intervention. With flexible and developer-friendly integration options, you can effortlessly incorporate geolocation capabilities and focus on building better user experiences.
You can call the API by sending HTTP GET requests to http://ipwho.is/[IP address]
[IP address] can be an IPv4 or IPv6 address, or none to use the current IP address.
Our API is available over a secure HTTPS connection. Simply add https:// to the request URLs to make the requests secure.
Live demo
You can edit this query and experiment with the options:
GET
Please note: For illustration purposes, we have included all available fields in the above API response. Depending on your subscription plan, the API response may vary.
Returned data
Depending on your subscription plan and the options you choose for your API request, the response will contain a number of different fields. Below is a list of all available API response fields:
name
description
ip
IP used for the query (e.g. 8.8.4.4)
success
If the query is successful, true will be returned, and false if it fails.
message
Included only when success is false Can be one of the following: Invalid IP address, You've hit the monthly limit, Reserved range
type
IP address type (IPv4 or IPv6)
continent
The name of the continent (e.g. North America)
continent_code
Two-letter (ISO 3166-1) continent code (e.g. NA)
country
The name of the сountry (e.g. United States)
country_code
Two-letter (ISO 3166-1) country code (e.g. US)
region
The name of the region/state (e.g. California)
region_code
The state/region code (ISO 3166-2), when available (e.g. CA)
city
The name of the city (e.g. Mountain View)
latitude
The approximate (WGS84) latitude of the location associated with the IP (e.g. 37.3860517)
longitude
The approximate (WGS84) longitude of the location associated with the IP (e.g. -122.0838511)
is_eu
Returns true or false depending on whether the country associated with the IP is in the European Union.
postal
The ZIP code associated with location.
calling_code
The calling/dial code of the country (e.g. 1)
capital
The capital city of the country (e.g. Washington)
borders
Two-letter (ISO 3166-1) code of the countries that border the country associated with this IP (e.g. CA,MX)
flag > img
Returns an HTTP URL leading to an SVG-flag icon for the country.
flag > emoji
An emoji version of the flag of the country (e.g. 🇺🇸)
flag > emoji_unicode
The unicode value of the emoji icon for the flag.
connection > asn
The Autonomous System (AS) Number (e.g. 15169)
connection > org
The name of the organization that owns the Autonomous System for the IP address that is analyzed (e.g. Google LLC)
connection > isp
The name of the ISP associated with the IP (e.g. Google LLC)
connection > domain
The domain name associated with the organization that owns the connection IP (e.g. google.com)
timezone > id
The ID of the time zone associated with location (e.g. America/Los_Angeles)
timezone > abbr
The Abbreviation of the Timezone (e.g. PDT)
timezone > is_dst
true or false depending on whether or not Daylight Savings have been accounted for.
timezone > offset
The offset from UTC (in seconds) for the given location (e.g. -25200 for PDT's -7h UTC offset)
timezone > utc
The UTC offset of the Timezone (e.g. -07:00)
timezone > current_time
The exact current date and time (ISO 8601 format) associated with location (e.g. 2022-04-22T14:31:48-07:00)
currency > name
The name of the currency (e.g. US Dollar)
currency > code
The 3-letter (ISO 4217) currency code (e.g. USD)
currency > symbol
The native (local) symbol of the given currency (e.g. $)
currency > plural
The plural version of the currency (e.g. US dollars)
currency > exchange_rate
The current exchange rate against the US dollar.
security > anonymous
Boolean with true value if proxy, vpn OR tor is satisfied.
security > proxy
true or false depending on whether the IP Address is a known proxy or any type.
security > vpn
Returns true when the IP address under search is used by a VPN, false otherwise.
security > tor
true or false depending on whether the IP Address is a known Tor exit node or relay.
security > hosting
true or false depending on whether the IP address is used for hosting purposes.
Specify Output Format
Using the GET parameter output, you can switch the API result format between JSON (default), XML and CSV. If you are using JSON, this parameter can be omitted.
For example:
output=xml
output=csv
output=json
Specify response fields
You can restrict API results to specific data fields if you don’t need to keep track of all the data. In this case, you need to add the GET parameter fields to the API request's URL and set a specific field or fields list with a comma.
For example:
fields=country,city,flag.emoji
fields=city,timezone
fields=ip,timezone.current_time
JSONP Callback
API supports callback function (JSONP). Simply append the GET parameter callback to your API request URL and set it to your function name.
For example:
callback=getIPinfo
Localization
Localized city, region, country, capital and continent can be requested by setting the GET parameter lang to one of the following:
lang
description
demo
en
English (default)
ru
Русский (Russian)
de
Deutsch (German)
es
Español (Spanish)
pt-BR
Português - Brasil (Portuguese)
fr
Français (French)
zh-CN
中国 (Chinese)
ja
日本語 (Japanese)
Enable Threat Detection
Available in: Business and Premium Plan
Security Data return fields (proxy, vpn, tor, hosting) for threat detection. This will allow you to protect your site or application from abuse in the form of bypassing a ban, hiding the real IP address, site parsing, etc. In order to use this feature, append the GET parameter security to your API request URL and set it to 1.
For example:
security=1
Rate information in the API response
Available in: Basic, Business and Premium Plan
In order to use this feature, append the GET parameter rate to your API request URL and set it to 1. Here is an example (in JSON format) of the information in the API response body:
name
description
rate > limit
The total number of API requests that your account is limited to over the given time period (month).
rate > remaining
The number of API requests remaining in the given time period (month).
Usage limits
You can use our API for free up to 10,000 requests per month (identification by IP address and Referer header). See our pricing details if you need more.
We do not allow commercial use of this endpoint. Please see our pro service to access Bulk Endpoint, usage statistics, advanced features and commercial support.
Code examples
Simple code examples in popular languages are given below: