Similar, but plain text and, thus, easier to parse, if necessary, e.g.:
$ IP=`curl https://icanhazip.com/`
$ echo $IP $ IP=`curl https://icanhazip.com/`
$ echo $IP curl https://httpbin.org/ip
returns {
"origin" : "192.168.0.1"
}
It also supports getting the user agent [0] and headers [1], among other things.[0] https://httpbin.org/user-agent [1] https://httpbin.org/headers
$ curl -4 https://icanhazip.com/
88.…
$ curl -6 https://icanhazip.com/
2001:470:…
(for me it's worth a yay)e.g. you need your IP to tell a remote server to send you something. You connect to the IP address service to ask for your IP, it should return x.x.x.x but it returns y.y.y.y instead. Any connections to any port on IP y.y.y.y get forwarded to a similar port on IP x.x.x.x meanwhile the MitM takes a copy of all of the data going back and forth.
It's not foolproof, and there are a myriad of ways to defend against it, but it's definitely a reason why I wouldn't trust any third party service (even DDG/Google) to get my IP address.