I would like to present a simple API for obtaining the public IP address of the client. the API is fairly simple.<p>JSON<p>http://ipof.candralabs.com/json<p>XML<p>http://ipof.candralabs.com/xml<p>Plain text<p>http://ipof.candralabs.com/txt<p>Please share your feedback. What features would you like to have in this simple service?
Why do you think something like this needs more "features"?<p>When I'm somewhere other than home and need to know my public IP address for some reason, I just use "icanhazip" [0] (GitHub: [1]) which I've aliased to make it even easier/quicker, e.g.:<p><pre><code> $ alias myip
alias myip='curl http://icanhazip.com'
$ myip
192.0.2.42
</code></pre>
It doesn't get much simpler than that -- just spit out the IP address in plain-text and, if needed, I'll massage it however I need to.<p>[0]: <a href="http://icanhazip.com/" rel="nofollow">http://icanhazip.com/</a><p>[1]: <a href="https://github.com/major/icanhaz" rel="nofollow">https://github.com/major/icanhaz</a>
I received a bunch of feature requests and here is the status<p>1. smaller URL : Changed it to ipof.in so the new URL is<p><a href="http://ipof.in/json" rel="nofollow">http://ipof.in/json</a>
<a href="http://ipof.in/xml" rel="nofollow">http://ipof.in/xml</a>
<a href="http://ipof.in/txt" rel="nofollow">http://ipof.in/txt</a><p>2. HTTPS support<p>Done. same URLs as above, except in HTTPS format<p>3. Return the IP in the HTTP response headers<p>Done. Added header X-IPof : <ipaddress><p>4. check if the IP is blacklisted<p>Done. Returns a blacklisted flag in the XML and JSON response.<p>5. Todo<p>IPv6
Geo location data<p>Hope this helps