Endpoints
| Address | Response |
|---|---|
showip.fr |
your address as text (IPv4 or IPv6, depending on your connection) |
ipv4.showip.fr/ip |
your IPv4 address, as text |
ipv6.showip.fr/ip |
your IPv6 address, as text |
ipv4.showip.fr/ip.json |
{"ip":"203.0.113.7"} |
ipv6.showip.fr/ip.json |
{"ip":"2001:db8::7"} |
Text responses end with a newline. showip.fr answers with plain text to command-line tools (curl, wget, HTTPie, xh, PowerShell) and redirects browsers to the web page. The other four addresses answer the same way for everyone.
ipv4.showip.fr has only an IPv4 address and ipv6.showip.fr only an IPv6 address, so the request has to go over the family you ask for. Without IPv6 connectivity, the call to ipv6.showip.fr fails, which also makes it a quick IPv6 test.
Both HTTP and HTTPS work. Use HTTPS in scripts so the response can't be altered on the way.
Examples
In a terminal:
curl showip.fr
curl -4 showip.fr # force IPv4
curl -6 showip.fr # force IPv6
curl -s https://ipv4.showip.fr/ip.json | jq -r .ip
In a shell script:
IP=$(curl -fsS https://ipv4.showip.fr/ip) || echo "no response" >&2
In Python:
import urllib.request
ip = urllib.request.urlopen("https://ipv4.showip.fr/ip", timeout=5).read().decode().strip()
In PowerShell:
Invoke-RestMethod https://ipv4.showip.fr/ip
Terms of use
The API is free and needs no key or sign-up. It does not log addresses. Keep a reasonable pace: one request per minute is enough to notice an address change.
The JSON endpoints only allow browser calls (CORS) from the showip.fr site itself. From a server, a script or an app, there is no restriction.