Use the ipwhois.io IP lookup API to quickly and simply integrate IP geolocation into your script or website. Save yourself the hassle of setting up local GeoIP libraries and having to remember to regularly update the data.

Data formats

JSON endpoint

You can call the API by sending HTTP GET requests to http://free.ipwhois.io/json/{IP}

{IP} can be an IPv4 or IPv6 address, or none to use the current IP address.


You can edit this query and experiment with the options

Actual response
  "ip": "",
  "success": true,
  "type": "IPv4",
  "continent": "North America",
  "continent_code": "NA",
  "country": "United States",
  "country_code": "US",
  "country_flag": "https://cdn.ipwhois.io/flags/us.svg",
  "country_capital": "Washington",
  "country_phone": "+1",
  "country_neighbours": "CA,MX,CU",
  "region": "New Jersey",
  "city": "Newark",
  "latitude": 40.735657,
  "longitude": -74.1723667,
  "asn": "AS15169",
  "org": "Level 3",
  "isp": "Google LLC",
  "timezone": "America/New_York",
  "timezone_name": "Eastern Standard Time",
  "timezone_dstOffset": 0,
  "timezone_gmtOffset": -18000,
  "timezone_gmt": "GMT -5:00",
  "currency": "US Dollar",
  "currency_code": "USD",
  "currency_symbol": "$",
  "currency_rates": 1,
  "currency_plural": "US dollars",
  "completed_requests": "0"

Returned data

The API can return the following fields and values

name description example type
ip IP used for the query string
success true or false true bool
message included only when success is false
Can be one of the following: invalid IP address, you've hit the monthly limit
invalid query string
type IP address type (IPv4 or IPv6) IPv4 string
continent Continent name North America string
continent_code Two-letter continent code NA string
country Country name United States string
country_code Two-letter country code US string
country_capital The capital of country Washington string
country_phone Country Phone Code +1 string
country_neighbours Neighboring countries CA,MX,CU string
region Region/state Virginia string
city City Ashburn string
latitude Latitude 39.0437567 float
longitude Longitude -77.4874416 float
as AS number AS15169 string
org Organization name Level 3 Communications string
isp ISP name Level 3 Communications string
timezone City timezone America/New_York string
timezone_name Full time zone name Eastern Standard Time string
timezone_dstOffset The offset for daylight-savings time in seconds. 0 integer
timezone_gmtOffset The offset from UTC (in seconds) for the given location. -18000 integer
timezone_gmt Timezone GMT. GMT -5:00 string
currency Country currency name. US Dollar string
currency_code Country currency code. USD string
currency_symbol Country currency symbol. $ string
currency_rates The current exchange rate against the US dollar. 1 float
currency_plural Currency plural. US dollars string
completed_requests Number of API calls for the current month (Updated every 30 seconds). 101 integer


Localized city, region, country and continent can be requested by setting the GET parameter lang to one of the following:

lang (ISO 639) description
en English (default)
de Deutsch (German)
es Español (Spanish)
pt-BR Español - Argentina (Spanish)
fr Français (French)
ja 日本語 (Japanese)
zh-CN 中国 (Chinese)
ru Русский (Russian)

Usage limits

You can use our API for free up to 10,000 requests per month. See our pricing details if you need more.

We do not allow commercial use of this endpoint. Please see our pro service for SSL access, unlimited queries and commercial support.