This serverless app hosted on Cloudflare returns the caller's current IP address. It returns results as plain text, JSON, XML, or HTML.
The venerable ip.nettica.com has been serving IP addresses since 2006. It went out of service for almost 10 years until it was resurrected in 2024. It still receives an astonishing amount of traffic, even after being down for so long. It's been enhanced to support IPv6; and now will return results in JSON, XML, and HTML, in addition to the original plain text.
Both HTTP and HTTPS requests are supported.
Accept Header | Results |
---|---|
application/json | {"ip":"${ip}"} |
application/xml | <ip>${ip}</ip> |
text/html | <p>${ip}</p> |
text/plain | ${ip} |
(none) | ${ip} |
The result ${ip}
is an IPv4 or IPv6 address. You will always receive just the IP address with a text/plain
Accept
header. For HTML,
the IP address is encapsulated in a paragraph tag. There are other tags on the page to make it valid and well-formed. For new applications,
it's recommended that you set the Accept
header to your desired format. The Content-Type
response header will be set accordingly.
curl -H "Accept: application/json" https://ip.nettica.com
curl -H "Accept: application/xml" https://ip.nettica.com
curl ip.nettica.com
npx wrangler tail ${project}