Sometimes we really need to visit a Internet service to get our IP address such as when we are in a LAN in a LAN in a LAN... But the other times when our server is exposed to the Internet we can get our IP address directly from ifconfig (or sudo ifconfig on fucking Debian). So additional Internet bandwith cost could be reduced.
There's some solution for getting local IP from command line: https://askubuntu.com/a/488916. However you can add an option to let users provide their command of getting IP.