The IP Animals API
Your public IP address as a bare string β no API key, no signup, no JSON to parse unless you want it. Point curl at it, read one line, done. The same friendly zoo, now scriptable.
$ curl https://ip.ipanimals.com
β¦
Checking the live endpointβ¦
Endpoints
| Request | Returns |
|---|---|
curl https://ip.ipanimals.com | Your connecting IP (v4 or v6) |
curl https://ipv4.ipanimals.com | Always IPv4 |
curl https://ipv6.ipanimals.com | Always IPv6 |
curl https://ip.ipanimals.com?format=json | {"ip":"β¦","family":"IPv4"} |
Forcing a family: a URL path can't change the transport β by the time the request lands, your connection is already IPv4 or IPv6. So to guarantee one, use the dedicated
ipv4. / ipv6. hosts (their DNS is single-family) or curl -4 / curl -6.
Use it anywhere
Shell
# your public IP into a variable
MYIP=$(curl -s https://ip.ipanimals.com)
# force IPv4 or IPv6
curl -s https://ipv4.ipanimals.com
curl -s https://ipv6.ipanimals.comJavaScript
const ip = await fetch('https://ip.ipanimals.com').then(r => r.text());
// or structured:
const { ip: myIp, family } =
await fetch('https://ip.ipanimals.com?format=json').then(r => r.json());Python
import urllib.request
ip = urllib.request.urlopen("https://ip.ipanimals.com").read().decode().strip()Good to know
- CORS is open (
access-control-allow-origin: *) β call it straight from a browser app. - No logging, no storage. The endpoint reads your address, returns it, and forgets it β same privacy stance as the rest of the zoo.
- Plain text by default, with a trailing newline, like
icanhazip.com. Add?format=jsonfor a small JSON object. - Be kind. It's free and unmetered; please don't hammer it in tight loops. Cache the result if you need it often.