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/ipcurl -6 -fsS https://wanip.ztech.dev/ipJSON 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
| Endpoint | Response | Purpose |
|---|---|---|
/ip | text/plain | Detected client IP |
/api/ip | JSON | IP and address family |
/api/health | JSON | Basic service health |
/api/ipv4 | text/plain | Address observed over IPv4 |
/api/ipv6 | text/plain | Address 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
Cache-Control: no-store— avoids shared caching of personal IP results.Content-Typereflects plain text or JSON.- Cross-origin access is available for public endpoints; sensitive tools should not be built on this API.