What’s My Addy?

Sometimes we need to know what our Internet-facing IPv4 address is. The fine people at ipify.org have provided an API to easily fetch your Internet address via JavaScript without any annoying ads. Your public IPv4 address is:

Fetching your IPv4 address . . .

You can easily do this yourself on your own web site as well with some simple HTML and JavaScript. Below is the actual code block used above to locate your IPv4 address.

<div id="st-my-ip">
  <em>Fetching your IPv4 address . . .</em>
</div>
<script>
  fetch("https://api.ipify.org?format=json")
    .then((response) => response.json())
    .then((data) => {
      document.getElementById("st-my-ip").innerHTML = "<h3>" + data.ip + "</h3>";
    })
  .catch((error) => {
    console.error("Error with ipify.org:", error);
  });
</script>

Both IPv4 addresses and IPv6 addresses can be fetched from ipify.org with the only difference being https://api.ipify.org is used for the IPv4 address and https://api64.ipify.org is used for the IPv6 address. Other than that, the code blocks are identical.

Previous
Previous

Getting Windows IPsec VPN to Work with OPNsense

Next
Next

Using PowerShell to Encrypt Secrets and Files