IP geolocation API documentation
Free JSON API for IP geolocation, ASN and risk data. IPv4 and IPv6, HTTPS, CORS enabled.
Quick start
No sign-up needed to try it. Call the endpoint below without a key to get data for your own IP (limited to 100 requests per day).
curl https://iplookinfo.com/jsonAuthentication
Create a free API key in the dashboard and send it in the Authorization header. A token query parameter also works for quick tests, but avoid it in production because URLs end up in logs.
Authorization: Bearer ipl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxEndpoints
- GET/api/v1/{ip}
- Look up any IPv4 or IPv6 address.
- GET/api/v1/me
- Look up the caller's own IP. Also available at /json.
- POST/api/v1/batch
- Look up up to 10,000 IPs in one request (paid plans). Each IP counts as one request.
Query parameters
lang — Language for place names: en, zh, es, pt, ru, ja. Default en.
Response
The risk object is only included on Pro and Business plans.
{
"ip": "8.8.8.8",
"version": "IPv4",
"type": "unicast",
"bogon": false,
"network": "8.8.8.0/24",
"continent": { "code": "NA", "name": "North America" },
"country": { "code": "US", "name": "United States", "is_eu": false },
"region": null,
"city": null,
"postal": null,
"location": { "latitude": 37.751, "longitude": -97.822, "accuracy_radius_km": 1000, "time_zone": "America/Chicago" },
"asn": { "asn": 15169, "name": "Google LLC", "domain": "google.com", "route": "8.8.8.0/24" },
"risk": { "score": 60, "is_tor": false, "is_vpn": false, "is_datacenter": true, "provider": "Google Cloud" }
}Rate limits and errors
Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers. Quotas reset at 00:00 UTC.
Errors use a consistent JSON shape with an HTTP status code:
HTTP/1.1 429 Too Many Requests
{ "error": { "code": "quota_exceeded", "message": "..." } }- 400 invalid_ip / bad_request
- 401 invalid_key
- 403 plan_required
- 413 too_many
- 429 rate_limited / quota_exceeded
Overage
Paid plans can opt in to overage in the dashboard. Requests beyond the daily quota are then served and billed per 1,000, up to a monthly spending cap you choose. Such responses carry an X-Overage-Units header.
Code examples
cURL
curl -H "Authorization: Bearer $IPLOOKINFO_KEY" https://iplookinfo.com/api/v1/8.8.8.8
# Batch (paid plans)
curl -X POST -H "Authorization: Bearer $IPLOOKINFO_KEY" \
-H "Content-Type: application/json" \
-d '{"ips":["8.8.8.8","1.1.1.1"]}' https://iplookinfo.com/api/v1/batchJavaScript
const res = await fetch("https://iplookinfo.com/api/v1/8.8.8.8", {
headers: { Authorization: `Bearer ${process.env.IPLOOKINFO_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();
console.log(data.country?.code, data.city);Python
import os, requests
r = requests.get(
"https://iplookinfo.com/api/v1/8.8.8.8",
headers={"Authorization": f"Bearer {os.environ['IPLOOKINFO_KEY']}"},
timeout=5,
)
r.raise_for_status()
data = r.json()
print(data["country"]["code"], data["asn"]["name"])PHP
$ctx = stream_context_create(["http" => [
"header" => "Authorization: Bearer " . getenv("IPLOOKINFO_KEY"),
]]);
$data = json_decode(file_get_contents("https://iplookinfo.com/api/v1/8.8.8.8", false, $ctx), true);
echo $data["country"]["code"];Go
req, _ := http.NewRequest("GET", "https://iplookinfo.com/api/v1/8.8.8.8", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("IPLOOKINFO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil { log.Fatal(err) }
defer resp.Body.Close()
var data map[string]any
json.NewDecoder(resp.Body).Decode(&data)