I'm behind a router, I need a simple command to discover my public ip (instead of googling what's my ip and clicking one the results)
Are there any standard protocols for this? I've heard about STUN but I don't know how can I use it?
P.S. I'm planning on writing a short python script to do it
Here are a few public services that support IPv4 and IPv6:

curl http://icanhazip.com
curl http://www.trackip.net/ip
curl https://ipapi.co/ip
curl http://api6.ipify.org
curl http://www.cloudflare.com/cdn-cgi/trace
curl http://checkip.dns.he.net

The following seem to support only IPv4 at this time:

curl http://bot.whatismyipaddress.com
curl http://checkip.dyndns.org
curl http://ifconfig.me
curl http://ip-api.com
curl http://api.infoip.io/ip

It's easy to make an HTTP call programmatically. So all should be relatively easy to use, and you can try multiple different URLs in case one fails.
Discovering public IP programmatically