File Exchange

image thumbnail

IP address lookup of country name, city name, latitude and longitude

version 1.0 (1.51 KB) by

Finds the country name, region name, city name, latitude and longitude from an IP address.

1 Download

Updated

View License

This function finds the country name, region name, city name, latitude and longitude from an IP address. It gets html from a website containing this data and scrapes the pertinents fields for the needed data.

Comments and Ratings (1)

Lee White

If you send numerous requests using this code you might get kicked off of the free site.

Here is another service which should remain free for more requests:
http://www.hostip.info/use.html

and here is the code to get the GPS/lat-long of a random IP address:

ip_as_string = '8.8.8.8';
params = {'ip',ip_as_string,'position','true'};
s = urlread('http://api.hostip.info/get_html.php','POST',params)

MATLAB Release
MATLAB 7.12 (R2011a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video