Endpoints
Method | Endpoint | Description |
---|
GET | /me | Returns geolocation data of the caller |
GET | /ip/:ip | Returns data for a specific IP address |
GET | /ip/:ip?get=country,city,currency | Filters response to specific fields only |
GET | /ip/8.8.8.8?format=json | Returns data for in multiple formats such as json,csv and xml |
GET | /bulk/:ip1,ip2,... | Returns geolocation data for multiple IPs |
Example Requests
Get your own IP info:GET https://api.ipwho.org/me
Get info for a specific IP:GET https://api.ipwho.org/ip/8.8.8.8
Filter response (only country, city, currency):GET https://api.ipwho.org/ip/8.8.8.8?get=country,city,currency
Get Response in Multiple format (json,csv,xml):GET https://api.ipwho.org/ip/8.8.8.8?format=json
or
GET https://api.ipwho.org/ip/8.8.8.8?format=xml
or
GET https://api.ipwho.org/ip/8.8.8.8?format=csv
Bulk lookup:GET https://api.ipwho.org/bulk/8.8.8.8,1.1.1.1
JavaScript Fetch Example
fetch('https://api.ipwho.org/8.8.8.8?get=country,city,currency')
.then(res => res.json())
.then(data => console.log(data));
cURL Examples
curl "https://api.ipwho.org/me"
curl "https://api.ipwho.org/1.1.1.1"
curl "https://api.ipwho.org/1.1.1.1?get=country,city"
curl "https://api.ipwho.org/bulk/1.1.1.1,8.8.8.8"
Example Response
Field | Type | Description |
---|
success | boolean | Query Result |
ip | string | IP address queried |
continent | string | Continent name |
continentCode | string | ISO continent code |
country | string | Country name |
countryCode | string | 2-letter ISO country code |
capital | string | Capital city of the country |
region | string | Region/state name |
regionCode | string | Region/state code |
city | string | City name |
postal_Code | string | Postal/ZIP code |
time_zone | string | IANA time zone (e.g. America/New_York) |
latitude | number | Geographic latitude |
longitude | number | Geographic longitude |
accuracy_radius | number | Estimated accuracy in kilometers |
is_in_eu | boolean | True if country is in the EU |
dial_code | string | Country dialing code |
flag | string | Country emoji flag |
flag_unicode | string | Unicode code for the flag |
currency.code | string | Currency code (e.g. USD) |
currency.symbol | string | Currency symbol (e.g. $) |
currency.name | string | Full currency name |
currency.name_plural | string | Plural currency name |
asn.number | number | Autonomous System Number |
asn.org | string | ASN organization or ISP name |
{
"success": true,
"data": {
"ip": "12.34.2.0",
"continent": "North America",
"continentCode": "NA",
"country": "United States",
"countryCode": "US",
"capital": "Washington",
"region": "Maryland",
"regionCode": "MD",
"city": "Baltimore",
"postal_Code": "21275",
"time_zone": "America/New_York",
"latitude": 39.2889,
"longitude": -76.623,
"accuracy_radius": 20,
"is_in_eu": false,
"dial_code": "+1",
"flag": "🇺🇸",
"flag_unicode": "U+1F1FA U+1F1F8",
"currency": {
"code": "USD",
"symbol": "$",
"name": "US Dollar",
"name_plural": "US dollars"
},
"asn": {
"number": 7018,
"org": "ATT-INTERNET4"
}
}
}