1. jsonip.com: is a free utility service that returns a client's IP address in a JSON object with support for JSONP, CORS, and direct requests. It serves millions of requests each day for websites, servers, mobile devices and more from all around the world.
All you need to do is to make a call to jsonip.com.
2. Smart-IP.net: Smart IP for today is one of the leading services providing to it's users all the required information about IP-addresses and everything related to them.
Along with the IP address, this service also provide Geo location details as well like Country, latitude, longitude etc. Following are the properties which are returned as JSON response by this service.
All you need to do is to make a call to jsonip.com.
1 | $(document).ready( function () { |
2 | $.get( 'http://jsonip.com' , function (res) { |
3 | $( 'p' ).html( 'IP Address is: ' + res.ip); |
4 | }); |
5 | }); |
2. Smart-IP.net: Smart IP for today is one of the leading services providing to it's users all the required information about IP-addresses and everything related to them.
1 | $(document).ready( function () { |
2 | $.getJSON( 'http://smart-ip.net/geoip-json?callback=?' , function (data) { |
3 | $( 'p' ).html( 'My IP Address is: ' + data.host); |
4 | }); |
5 | }); |
1 | data.host; |
2 | data.countryName; |
3 | data.countryCode; |
4 | data.city; |
5 | data.region; |
6 | data.latitude; |
7 | data.longitude; |
8 | data.timezone; |
No comments:
Post a Comment