In theory your router should be able to tell you the public IP address of the network, but the way of doing this will necessarily be inconsistent/non-straightforward, if even possible with some router devices.
The easiest and still a very reliable method is to send a request to a web page that returns your IP address as the web server sees it. Dyndns.org provides a good service for this:
What is returned is an extremely simple/short HTML document, containing the text Current IP Address: 157.221.82.39
(fake IP), which is trivial to extract from the HTTP response.