Skip to content

Geo Lookup

Get geolocation data for an IP address

Endpoint

GET /geo?ip={ip}

Query parameters

ip
string

Response body

A JSON object with geolocation data:

ip
string
required
country_code
string
required
tz
string
required
country
string
required
city
string
lat
float
lng
float

Example request

js
const query = new URLSearchParams({
    ip: "11.22.33.44",
});

const response = await fetch(`https://api.ateratti.com/geo?${query}`, {
    headers: { "X-Api-Key": "Your API key" },
});

const geo = await response.json();
console.log(geo);

Example response

200 OK

json
{
    "ip": "11.22.33.44",
    "country_code": "DE",
    "country": "Germany",
    "city": "Stuttgart",
    "tz": "Europe/Berlin",
    "lat": 48.767,
    "lon": 9.1827
}