13

Does Google have an API to do geocoding from ip address to latitude longitude? Similar to MaxMind. I have looked into their places api:

https://developers.google.com/maps/documentation/business/places/

And I have used Maxmind with success,

http://www.maxmind.com/en/geolocation_landing

But does Google offer ip to lat long services?

Kara
  • 6,115
  • 16
  • 50
  • 57
David Williams
  • 8,388
  • 23
  • 83
  • 171
  • This question was closed so I can't officially answer, but Google does offer a specific service that will convert IP to Lat Long. A POST to `https://www.googleapis.com/geolocation/v1/geolocate?key=API_KEY` with no fields will fallback to using IP address. – protometa Mar 02 '18 at 18:59

1 Answers1

14

Strictly just f.y.i., google's loader https://developers.google.com/loader/ which you would load with a simple script tag:

<script type="text/javascript" src="https://www.google.com/jsapi"></script>

does store info about their best guess about a users location, presumably done via i.p. lookup, within google.loader.ClientLocation object. In fact here's a fiddle example showing your own (supposed) location with a Marker http://jsfiddle.net/pTfM5/2/

It's horribly inaccurate for me, shows me to be an entire state and a couple hundred miles away from where I really am. ipinfodb and ip2location as suggested by Michael C. are a bit more accurate, they show me just two thirds as far away as reality than googles loader does, still off by a long ways.

Maxmind is much better though, only off by about 20 miles

astupidname
  • 1,837
  • 15
  • 11