JSON API
Free, public API — no authentication required. Returns JSON.
All API responses include an ok boolean and a data object. The API is CORS-enabled — use it directly from front-end JavaScript.
{
"ok": true,
"data": { ... }
}
Please be kind with rate limits. For high-volume use, run your own instance or use a caching layer.
GET
/api/ip
Returns geolocation and network information for the requester's own IP address.
Example
curl https://www.ipmonkey.co.uk/api/ip
Response
{
"ok": true,
"data": {
"ip": "203.0.113.42",
"ip_version": "IPv4",
"hostname": "host.example.com",
"country": "United Kingdom",
"country_code": "GB",
"region": "ENG",
"region_name": "England",
"city": "London",
"zip": "EC1A",
"lat": 51.5085,
"lon": -0.1257,
"timezone": "Europe/London",
"isp": "Example ISP Ltd",
"org": "Example Org",
"asn": "AS12345",
"asn_name": "EXAMPLE-ASN",
"is_proxy": false,
"is_mobile": false,
"is_hosting": false,
"is_private": false
}
}
GET
/api/ip/{ip}
Returns information for a specific IPv4 or IPv6 address.
Parameters
| Parameter | Type | Description |
|---|---|---|
ip | path | A valid IPv4 or IPv6 address |
Example
curl https://www.ipmonkey.co.uk/api/ip/8.8.8.8
GET
/api/dns/{domain}
Returns DNS records for a domain. All record types are returned by default.
Parameters
| Parameter | Type | Description |
|---|---|---|
domain | path | The domain name to query |
type | query | Record type: A, AAAA, MX, NS, TXT, SOA, CNAME, SRV, CAA (default: ALL) |
Example
curl "https://www.ipmonkey.co.uk/api/dns/example.com?type=MX"
Response
{
"ok": true,
"domain": "example.com",
"type": "MX",
"data": {
"MX": [
{ "host": "example.com", "target": "mail.example.com", "pri": 10, "ttl": 3600 }
]
}
}
GET
/api/whois/{query}
Returns WHOIS registration data for a domain or IP address.
Parameters
| Parameter | Type | Description |
|---|---|---|
query | path | A domain name or IP address |
Example
curl https://www.ipmonkey.co.uk/api/whois/example.com
GET
/api/reverse/{ip}
Performs a reverse DNS lookup on the given IP address.
Example
curl https://www.ipmonkey.co.uk/api/reverse/8.8.8.8
Response
{
"ok": true,
"ip": "8.8.8.8",
"hostname": "dns.google"
}
JavaScript Example
// Get visitor IP info
const res = await fetch('https://www.ipmonkey.co.uk/api/ip');
const { ok, data } = await res.json();
if (ok) {
console.log(`Your IP: ${data.ip} (${data.country})`);
}