APIs

How to get your current IPv6 address using wget

Also see How to get your current IPv4 address using wget

Use

wget -qO- https://ipv6.techoverflow.net/api/get-my-ip

which uses the TechOverflow get-my-ip API.

Example:

$ wget -qO- https://ipv6.techoverflow.net/api/get-my-ip
2003:ea:70a:d600:ee98:42ca:b0bb:ac75

If your computer does not have IPv6 connectivity enabled, you will not see any output.

Prefer a JSON response?

Use https://ipv6.techoverflow.net/api/get-my-ip-json instead:

wget -qO- https://ipv6.techoverflow.net/api/get-my-ip-json

Example:

$ wget -qO- https://ipv6.techoverflow.net/api/get-my-ip-json
{"ip": "2003:ea:70a:d600:ee98:42ca:b0bb:ac75"}

Want this API on your own server? Check out How to make your own ‘get my current IP address’ server using only nginx

Posted by Uli Köhler in APIs, Networking

How to get your current IPv4 address using wget

Also see How to get your current IPv6 address using wget

Use

wget -qO- https://ipv4.techoverflow.net/api/get-my-ip

which uses the TechOverflow get-my-ip API.

Example:

$ wget -qO- https://ipv4.techoverflow.net/api/get-my-ip
80.138.203.18

Prefer a JSON response?

Use https://ipv4.techoverflow.net/api/get-my-ip-json instead:

wget -qO- https://ipv4.techoverflow.net/api/get-my-ip-json

Example:

$ wget -qO- https://ipv4.techoverflow.net/api/get-my-ip-json
{"ip": "80.138.201.17"}

Want this API on your own server? Check out How to make your own ‘get my current IP address’ server using only nginx

Posted by Uli Köhler in APIs, Networking