Free IP Geolocation API — IP Lookup in JSON
Query any IPv4 or IPv6 address and receive its geolocation, ISP, ASN and hostname in JSON format. Free, no API key, no signup, CORS enabled.
Request example
With cURL
curl https://monip.lws.fr/api/8.8.8.8
With JavaScript (fetch)
fetch('https://monip.lws.fr/api/8.8.8.8')
.then(r => r.json())
.then(data => console.log(data));
Response
{
"ip": "8.8.8.8",
"version": 4,
"is_private": false,
"hostname": "dns.google",
"country": "United States",
"country_code": "US",
"flag": "🇺🇸",
"region": "California",
"city": "Mountain View",
"timezone": "America/Los_Angeles",
"latitude": 37.386,
"longitude": -122.0838,
"asn": "AS15169",
"asn_org": "Google",
"isp": "Google",
"db_available": true
}
Response fields
| Champ | Type | Description |
|---|---|---|
ip | string | Queried IP address |
version | int | Protocol version (4 or 6) |
is_private | bool | true if the address is private / reserved |
hostname | string|null | Reverse DNS (PTR) — null if absent |
country | string|null | Country name |
country_code | string|null | ISO 3166-1 alpha-2 country code |
flag | string|null | Country flag emoji |
region | string|null | Region / subdivision |
city | string|null | City |
timezone | string|null | IANA time zone |
latitude | float|null | Latitude (~50 km accuracy) |
longitude | float|null | Longitude (~50 km accuracy) |
asn | string|null | Autonomous system number (e.g. AS15169) |
asn_org | string|null | Network owner organisation |
isp | string|null | Internet service provider |
db_available | bool | true if local MMDB database is available |
Errors
// HTTP 400
{
"error": "Invalid IP address"
}