IP Geolocation Lookup
Resolve an IP address to its geographic location with city-level accuracy
/v1/geo/ip-lookup
curl "https://geo.toolkitapi.io/v1/geo/ip-lookup?ip=8.8.8.8"
import httpx
resp = httpx.get(
"https://geo.toolkitapi.io/v1/geo/ip-lookup?ip=8.8.8.8",
)
print(resp.json())
const resp = await fetch("https://geo.toolkitapi.io/v1/geo/ip-lookup?ip=8.8.8.8", {
});
const data = await resp.json();
console.log(data);
# See curl example
{
"ip": "8.8.8.8",
"country": "United States",
"country_code": "US",
"city": "Mountain View",
"region": "California",
"region_code": "CA",
"postal_code": "94035",
"latitude": 37.386,
"longitude": -122.0838,
"timezone": "America/Los_Angeles",
"continent": "North America",
"continent_code": "NA",
"asn": 15169,
"asn_name": "GOOGLE"
}
Try It Live
Description
How to Use
1. Pass the IP address you want to look up in the `ip` query parameter.
2. Send a GET request — no additional configuration is needed.
3. Inspect the response for `country`, `city`, `latitude`, and `longitude` to determine the approximate location.
4. Use the `timezone` field to localise timestamps or the `asn_name` to identify the hosting provider.
About This Tool
Use IP Geolocation Lookup to resolve any public IPv4 or IPv6 address into a physical location. The response includes city, region, country, coordinates, timezone, and ASN information powered by MaxMind GeoIP databases.
This is useful for content localisation, fraud detection, analytics enrichment, and compliance workflows where you need to know the approximate origin of a request.
The endpoint rejects private, loopback, and reserved IP ranges since they cannot be geolocated.
Why Use This Tool
- Content localisation — Serve region-specific content based on visitor IP
- Fraud detection — Flag transactions originating from unexpected geographies
- Analytics enrichment — Add geographic dimensions to your analytics pipeline
- Compliance checks — Verify that users are accessing your service from permitted regions
- Ad targeting — Determine geographic segments for advertising platforms
Frequently Asked Questions
How accurate is the geolocation data?
Can I look up private or local IP addresses?
Does this endpoint support IPv6?
Start using IP Geolocation Lookup now
Get your free API key and make your first request in under a minute.