phpip-geolocation

Google IP Geolocation API


Is there any way to use any of the Google APIs to get the IP Geolocation of my User in Live time?

I think it will use the Analytics Database and that is the only one, that tracks my user at city level that actually is correct (Any other IP-Location-API that I could test shows my IP address nearly 200km away from my real location. Google shows it 200m(!) away!)

I want to know the Location of my User (At Browser side and transmit it to my Server or at Server side) to serve City dependent content. But I don't want to get my users one of these annoying pop ups asking for using GPS, so I want to use the IP address.

Any suggestions?


Solution

  • If you don't want to use HTML5 style client-enabled GeoIP information, you are going to need a GeoIP database like MaxMind's GeoIP Lite database, which is free and works well for 99% of use cases. Any other service with more accurate/detailed information is going to cost you a lot of money. MaxMind is praises by many people and works well for my needs, personally. It can give you Country/Region/City/Latitude-Longitude-Coordinates/Continent information.