How to get a client's IP address using JavaScript

This guide will show you how to get your local, public and IPv6 IP Addresses in pure Javascript without making server side requests as well as an example with our API.

The advantage of using our API is you can expect this method to work reliably across all browsers and it is super-fast.

$.get("https://ipforensics.net/api/v1/origin?apikey=APIKEY", function(response) {
    console.log(response.meta_data.ip);
}, "jsonp");

Always reference the API endpoint for complete response result

Last updated