There are several “What’s my IP?” sites available, but most of them are full of noisy and distracting adverts, so we’ve created our own which is completely free to use and completely free of those annoying adverts. As a bonus, it can also return plain text and JSON results if you need to parse the data from code.

You can access the service here: https://myip.gw2.uk

If you access the URL above you will get HTML results, if you want to access it from a script, then you can add some request variables as follows:

https://myip.gw2.uk?output=text
This will return plain text data.

https://myip.gw2.uk?output=json
This will return JSON data.

By default if you use output=text or output=json you will only get the IPv4 data returned. If you want to view the IPv6 data you can specify the address family using the “family” variable, for example:

https://myip.gw2.uk?output=text&family=4
This will return the IPv4 data in plain text format (the default).

https://myip.gw2.uk?output=text&family=6
This will return the IPv6 data in plain text format.

https://myip.gw2.uk?output=json&family=4
This will return the IPv4 data in plain JSON format (the default).

https://myip.gw2.uk?output=json&family=6
This will return the IPv6 data in JSON format.

The reason the text and JSON outputs can only return one address family at a time is because the HTML version uses Javascript to send two queries back to our server to probe for IPv4 and IPv6 address information. When text or JSON is returned, there is no opportunity to run any Javascript code to carry out the probes, hence the need to run the script once for each address family.