Look Up Any IP Address: Geolocation API Quick Start
The IP Geolocation API resolves an IPv4 or IPv6 address to geographic data in one HTTP call.
It is useful for localizing content, screening fraud signals, and enriching analytics. Lookups run against a bundled GeoLite2 database, so there are no per-call data fees.
Quick start
curl "https://ip-geolocation39.p.rapidapi.com/lookup?ip=8.8.8.8" \
-H "X-RapidAPI-Key: YOUR_KEY" \
-H "X-RapidAPI-Host: ip-geolocation39.p.rapidapi.com"Response
accuracyRadiusKm tells you how precise the fix is. Country-level results are reliable; city-level precision varies by network. The timezone field lets you render local times for the visitor.
{
"ip": "8.8.8.8",
"found": true,
"country": "US",
"countryName": "United States",
"region": "",
"city": "",
"latitude": 37.751,
"longitude": -97.822,
"timezone": "America/Chicago",
"eu": false,
"accuracyRadiusKm": 1000
}Batch and distance
POST /batch geolocates up to 100 IPs per call. GET /distance?ip1=&ip2= returns the great-circle distance between two addresses.
Privacy note
Lookups are processed transiently. Request payloads are never stored.
Run it in production
IP Geolocation has a permanent free tier — 1,000 requests a month, no credit card. Paid plans start at $5/month for 100,000 requests.
FAQ
Why are region or city fields sometimes empty?
Infrastructure IPs (like public DNS resolvers) often resolve only to the country level, so region and city come back empty.
Is IPv6 supported?
Yes. The endpoint accepts both IPv4 and IPv6 addresses.
How fresh is the underlying data?
The bundled GeoLite2 database is refreshed regularly with the upstream releases.