Documentation

Endpoint reference

Both geolocation endpoints, their parameters and responses.

GET/v1/ip

Detect the caller IP

Resolves the IP of this HTTP request. In the playground that is the site server, not your browser. To look up a visitor or any other address, use GET /v1/ip/{ip}.

ParameterInRequiredDescription
localequerynoLanguage used for country and region names.
curl "https://api.geolocate-api.com/v1/ip" \
  -H "Authorization: Bearer geo_live_xxxxxxxxxxxxxxxxx"
200 OK
{
  "ip": "189.4.12.77",
  "country": { "code": "BR", "name": "Brazil" },
  "region": { "name": "São Paulo", "code": "BR-SP" },
  "city": "São Paulo",
  "postal_code": "01310",
  "coordinates": { "latitude": -23.5505, "longitude": -46.6333 },
  "timezone": { "id": "America/Sao_Paulo", "offset": "-03:00" }
}
GET/v1/ip/{ip}

Look up a specific IP

Resolves any IPv4 or IPv6 address. Available from Developer. Returns 400 for a malformed address, 403 if the plan does not include lookup, and 422 when the address cannot be resolved.

ParameterInRequiredDescription
ippathyesThe IPv4 or IPv6 address to resolve.
localequerynoLanguage used for country and region names.
curl "https://api.geolocate-api.com/v1/ip/8.8.8.8" \
  -H "Authorization: Bearer geo_live_xxxxxxxxxxxxxxxxx"
200 OK
{
  "ip": "8.8.8.8",
  "country": { "code": "US", "name": "United States" },
  "region": { "name": "California", "code": "US-CA" },
  "city": "Mountain View",
  "postal_code": "94043",
  "coordinates": { "latitude": 37.4056, "longitude": -122.0775 },
  "timezone": { "id": "America/Los_Angeles", "offset": "-07:00" }
}