IP Geolocation API
Geolocate any IP — country, city, coordinates, timezone — plus IP-to-IP distance.
Get it on RapidAPI ↗IP Geolocation turns any IPv4 or IPv6 address into location data — country, region, city, latitude/longitude, and timezone — a fast, free alternative to MaxMind or ipinfo. Look up a single IP, a batch of up to 100, or compute the great-circle distance between two addresses.
Great for personalization, fraud and risk signals, analytics, and geo-routing. No setup, no API-key juggling — clean JSON every time.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /ip/lookup?ip= | Geolocate a single IP address |
| POST | /ip/batch | Geolocate up to 100 IPs at once |
| GET | /ip/distance?ip1=&ip2= | Great-circle distance between two IPs |
Quick start
curl --url 'https://ip-geolocation39.p.rapidapi.com/lookup?ip=8.8.8.8' \
--header 'X-RapidAPI-Key: YOUR_KEY' \
--header 'X-RapidAPI-Host: ip-geolocation39.p.rapidapi.com'const res = await fetch('https://ip-geolocation39.p.rapidapi.com/lookup?ip=8.8.8.8', {
headers: {
'X-RapidAPI-Key': 'YOUR_KEY',
'X-RapidAPI-Host': 'ip-geolocation39.p.rapidapi.com'
}
});
const data = await res.json();{
"ip": "8.8.8.8",
"found": true,
"country": "US",
"countryName": "United States",
"city": "",
"latitude": 37.751,
"longitude": -97.822,
"timezone": "America/Chicago"
}Pricing
Subscribe on RapidAPI. Start free; upgrade as you scale.
Try it free, right now
No signup — test it in your browser with our free IP Address Lookup tool.
Open the IP Address Lookup →Frequently asked questions
How accurate is IP geolocation?
IP geolocation reliably identifies country and region and usually the city. It is not GPS-accurate — each result includes an accuracy radius so you can decide how to use it.
Does it support IPv6?
Yes, both IPv4 and IPv6 addresses are supported.
Can I look up many IPs at once?
Yes — POST up to 100 addresses to /ip/batch in a single request.
Ready to build with IP Geolocation?
Grab your key on RapidAPI and start on the free tier.
Get it on RapidAPI ↗