Use the form above. Parameters, code examples and FAQ are grouped in the documentation section below.
| IP | |
| City | |
| Region | |
| Country/Code | |
| Zip Code | |
| Time Zone | |
| Lat/Lon |
<output> as root element
GET /v1/geolocation/format?q=ip4|ip6|hostname
- /v1/geolocation/json
- /v1/geolocation/json?q=example.com
- /v1/geolocation/xml?q=8.8.8.8
- /v1/geolocation/xml?q=2a00:1450:4006:803::200e
{
"ip": "8.8.8.8",
"country_code": "US",
"country_name": "United States",
"region_name": "Virginia",
"city": "Ashburn",
"zip_code": "20149",
"time_zone": "America/New_York",
"latitude": 39.03,
"longitude": -77.5
}
Look up the country, region, city, timezone and coordinates behind any IPv4 or IPv6 address.
| Name | Type | Default | Description |
|---|---|---|---|
q | string | optional | IPv4, IPv6 or hostname. Leave empty to use the caller's own public IP. |
curl 'https://freetools.one/v1/geolocation/json?q=8.8.8.8'const r = await fetch('https://freetools.one/v1/geolocation/json?q=8.8.8.8');
const g = await r.json();
console.log(g.city, g.country_name, g.latitude, g.longitude);import requests
g = requests.get('https://freetools.one/v1/geolocation/json', params={'q': '8.8.8.8'}).json()
print(g['city'], g['country_name'], g['latitude'], g['longitude']){
"ip": "8.8.8.8",
"country_code": "US",
"country_name": "United States",
"region_name": "Virginia",
"city": "Ashburn",
"zip_code": "20149",
"time_zone": "America/New_York",
"latitude": 39.03,
"longitude": -77.5
}
Yes. There is no API key, no account and no request signing. You only need to send the request.
No. Every endpoint on FreeTools is a plain GET request. Drop in the URL and it works.
Call /v1/geolocation/json without the q parameter and the service locates the caller's public IP address.
Yes. IPv4, IPv6 and hostnames are all accepted, and hostnames are resolved before the lookup.