So for example if you're on an remote server and want to check the public IP address you could go for an ifconfig and if you have an public IP this works. But if you're behind an NAT or something you need something else. I just use:

  • Check up via commandline: curl

There are other services:


This you could use in an Webhook or something to Mail you the current Ip Address (for example if you don't want to use dyndns or something) delivers your IPv6 Address if you have one.

Amazon Checkup delivers your IPv4 Address. delivers your IPv4 Address when used with curl

With you also get an more advanced api, for example:

  • Get the header from your http request: curl

You also get a machine readable json with all the meta data like this:

  • curl

This is how you get your IP with Python

In Python your request:

import json
import requests

url = ""

r = requests.get(url)

response = json.loads(r.text)