Skip to content

nettica-com/ip-nettica-com

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ip-nettica-com

This serverless app hosted on Cloudflare returns the caller's current IP address. It returns results as plain text, JSON, XML, or HTML.

History

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.

HTTP API

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.

Examples

curl

curl -H "Accept: application/json" https://ip.nettica.com
curl -H "Accept: application/xml"  https://ip.nettica.com
curl ip.nettica.com

Debugging

npx wrangler tail ${project}

About

Serverless app to return your current IP address

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published