Using the IP Addresses database - IP Address Lookup
If you're going to be doing a lot of Geotargeting or IP Address Lookups, please take a feed instead which will preserve both our bandwidth and your bandwidth.
Alternatively, you can support us and Download a High-Accuracy Version.
Alternatively, you can support us and Download a High-Accuracy Version.
Your IP Address: 18.97.9.169
Cambridge, MA, UNITED STATES
IP found in 0.0027 seconds
Is this wrong? Make a correction
or Download a High-Accuracy Version
Are you a host? Netblock upload
Cambridge, MA, UNITED STATES
IP found in 0.0027 seconds
Is this wrong? Make a correction
or Download a High-Accuracy Version
Are you a host? Netblock upload
Simple GET
That said, there is an easy HTTP oriented API to locate IP addresses and Geocode them. If you don't supply the "?ip=aa.bb.cc.dd" bit, then the ip address lookup of the calling machine will be located instead (here, the aa,bb,cc,dd are decimal digits). If you add &position=true to the end of the URL then latitude and longitude will be returned also. Both HTML and XML formats are supplied for your convenience.https://api.hostip.info/country.php US https://api.hostip.info/get_html.php?ip=12.215.42.19 Country: UNITED STATES (US) City: Sugar Grove, IL IP: 12.215.42.19 https://api.hostip.info/get_html.php?ip=12.215.42.19&position=true Country: UNITED STATES (US) City: Sugar Grove, IL Latitude: 41.7696 Longitude: -88.4588 IP: 12.215.42.19 https://api.hostip.info/get_json.php {"country_name":"UNITED STATES","country_code":"US","city":"Sugar Grove, IL","ip":"12.215.42.19"} https://api.hostip.info/?ip=12.215.42.19 [use the URL above for an example - XML too long to paste below]
Country Flag
Paste the following code into your HTML to get a country flag of the ip address. The database is significantly more accurate (it ought to be 100%) for countries than for cities. It would be nice if y'all would make the flag a link to the www.hostip.info home page (https://www.hostip.info/) so they can come by if they're interested - it'll only benefit you in the long run. After all, the results get more accurate as more visitors submit their IP addresses!Flag of visitor's location:
Flag of any IP address:<A HREF="https://www.hostip.info"> <IMG SRC="https://api.hostip.info/flag.php" BORDER="0" ALT="IP Address Lookup"> </A>
<A HREF="https://www.hostip.info"> <IMG SRC="https://api.hostip.info/flag.php?ip=12.215.42.19" ALT="IP Address Lookup"> </A>
*NIX Shell Script
You can use the following shell script to call in your favorite *NIX environment.#!/bin/tcsh -f lynx -dump "https://api.hostip.info/get_html.php?ip=$1"
Testing your API calls
If you're looking to test your API calls through various, worldwide IP addresses you can try a proxy service like wonderproxy.com. Simply configure your browser to use the proxy and your IP address will appear as the proxy's instead of your own.Commercial Geodatabase
MaxMind - If you're looking for a commercial option, this database maintains a great level of accuracy.