Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reliable API to determine an ip address's city and country [closed]

I want a reliable API that can be used to determine a city and country from an IP address.

My search on Google led to http://ipinfodb.com/ip_location_api.php. It seems perfect but my only concern is the reliability of this service. Does google have anything like this?

I'm looking for free or paid APIs that help determine location from IP.

like image 720
Gublooo Avatar asked Mar 02 '10 10:03

Gublooo


People also ask

Is IP geolocation API free?

IPWHOIS.io offers a free real-time geolocation REST API that is used by thousands of developers around the world. This API is convenient for small projects and is free up to 1,000 requests/day (IP and Referer identification).

Can you determine country from IP address?

You may also use 3rd party websites such as Geobytes or Dnsstuff to lookup the IP address. The whois lookup will reveal name of the ISP who owns that IP address, and the country where it is originated from. If you're lucky, you might also find the city of orgin.


3 Answers

MaxMind has a lite version of their ip2country and ip2city databases: http://www.maxmind.com/app/geolitecity

http://www.maxmind.com/app/geolitecountry

If you don't mind hosting the database yourself, it's free. The paid services are more accurate.

They also provide web services for querying, but it is not free: http://www.maxmind.com/app/web_services#country

like image 160
Kjetil Watnedal Avatar answered Sep 20 '22 13:09

Kjetil Watnedal


Consider using geoplugin, it provides the most information from a single line PHP code, but requires a connection to the geoplugin.com server for every request (and it is free).

Examples :

Json : http://www.geoplugin.net/json.gp?ip=74.125.236.174

{
geoplugin_request: "74.125.236.174",
geoplugin_status: 200,
geoplugin_city: "Mountain View",
geoplugin_region: "CA",
geoplugin_areaCode: "650",
geoplugin_dmaCode: "807",
geoplugin_countryCode: "US",
geoplugin_countryName: "United States",
geoplugin_continentCode: "NA",
geoplugin_latitude: "37.419201",
geoplugin_longitude: "-122.057404",
geoplugin_regionCode: "CA",
geoplugin_regionName: "California",
geoplugin_currencyCode: "USD",
geoplugin_currencySymbol: "$",
geoplugin_currencySymbol_UTF8: "$",
geoplugin_currencyConverter: 1
}

Xml : http://www.geoplugin.net/xml.gp?ip=74.125.236.174

<geoPlugin>
<script/>
<geoplugin_request>74.125.236.174</geoplugin_request>
<geoplugin_status>200</geoplugin_status>
<geoplugin_city>Mountain View</geoplugin_city>
<geoplugin_region>CA</geoplugin_region>
<geoplugin_areaCode>650</geoplugin_areaCode>
<geoplugin_dmaCode>807</geoplugin_dmaCode>
<geoplugin_countryCode>US</geoplugin_countryCode>
<geoplugin_countryName>United States</geoplugin_countryName>
<geoplugin_continentCode>NA</geoplugin_continentCode>
<geoplugin_latitude>37.419201</geoplugin_latitude>
<geoplugin_longitude>-122.057404</geoplugin_longitude>
<geoplugin_regionCode>CA</geoplugin_regionCode>
<geoplugin_regionName>California</geoplugin_regionName>
<geoplugin_currencyCode>USD</geoplugin_currencyCode>
<geoplugin_currencySymbol>&#36;</geoplugin_currencySymbol>
<geoplugin_currencySymbol_UTF8>$</geoplugin_currencySymbol_UTF8>
<geoplugin_currencyConverter>1</geoplugin_currencyConverter>
</geoPlugin>

Other options

like image 41
Chandra Nakka Avatar answered Sep 20 '22 13:09

Chandra Nakka


http://www.ip2location.com/

Google has free service http://briancray.com/2009/05/29/find-web-visitors-location-javascript-google-api/

like image 32
Ravi Vanapalli Avatar answered Sep 18 '22 13:09

Ravi Vanapalli