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.

Endpoint
https://monip.lws.fr/api/{ip}
Method
GET
Parameter
{ip} — Valid IPv4 or IPv6 address
CORS
Enabled (Access-Control-Allow-Origin: *)
Cache
1 hour (Cache-Control: public, max-age=3600)
Rate limit
No strict limit — fair use required

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|nullReverse DNS (PTR) — null if absent
country string|nullCountry name
country_code string|nullISO 3166-1 alpha-2 country code
flag string|nullCountry flag emoji
region string|nullRegion / subdivision
city string|nullCity
timezone string|nullIANA time zone
latitude float|nullLatitude (~50 km accuracy)
longitude float|nullLongitude (~50 km accuracy)
asn string|nullAutonomous system number (e.g. AS15169)
asn_org string|nullNetwork owner organisation
isp string|nullInternet service provider
db_available bool true if local MMDB database is available

Errors

// HTTP 400 { "error": "Invalid IP address" }

Try it

Back to MonIP