How to Get Client IP Address Using JavaScript in HTML?

Hello friends, today I will tell you through experts tool how you can get the client ip address of your system or someone else’s system through javascript.

So friends ip address is very easy to get, some third party also make their api, which we can easily get client ip address using javascript.

I am showing you the example of three api below by including it in javascript, with the help of which you can get the client ip address through javascript, so let’s go

Example 1:- Try it: http://gd.geobytes.com/GetCityDetails

$.getJSON('http://gd.geobytes.com/GetCityDetails?callback=?', function(data) { console.log(JSON.stringify(data, null, 2));
});

Example 2:-Try it: https://json.geoiplookup.io/api

$.getJSON('https://json.geoiplookup.io/api?callback=?', function(data) { console.log(JSON.stringify(data, null, 2));
});

Example 3:-Try it: https://ipapi.co/json/

$.getJSON('https://ipapi.co/json/', function(data) { console.log(JSON.stringify(data, null, 2));
});

Leave a Reply

Your email address will not be published. Required fields are marked *