SIMPLE · FAST · FREE

Public IP API

Get the public address observed by WANIP. No API key required for basic endpoints.

Plain text

Best for shell scripts, cron jobs and monitoring.

curl -4 -fsS https://wanip.ztech.dev/ip
curl -6 -fsS https://wanip.ztech.dev/ip

JSON response

curl -sS https://wanip.ztech.dev/api/ip
{
  "ip": "203.0.113.10",
  "version": 4
}

The example IP is reserved for documentation. Real responses contain the address observed for the current request. Responses use no-store caching. Basic endpoints may be rate limited to protect service availability.

Endpoints

EndpointResponsePurpose
/iptext/plainDetected client IP
/api/ipJSONIP and address family
/api/healthJSONBasic service health
/api/ipv4text/plainAddress observed over IPv4
/api/ipv6text/plainAddress observed over IPv6

JavaScript

const ip = await fetch('https://wanip.ztech.dev/api/ip', {
  cache: 'no-store'
}).then(r => r.json());
console.log(ip.ip);

Response headers