mypublicip Python package to get the public IP address pip install mypublicip Exemple: import mypublicip ip = mypublicip.ip() print(ip)