What is the difference between the two Google Maps Geocoding API URLs?

I have a requirement when I just need to get Latitude and Longitude by specifying here two different options for the URL of the Google Maps Geocoding API, which uses almost the same result.

http://maps.google.com/maps/geo?output=xml&key=MyApiKey&oe=utf-8&q=Bhatkal,%2CKarnataka,%2CIndia http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=Bhatkal,%2CKarnataka%2C,India 

the first one is with an API key and the second is without an API key. I'd like to know

a) Why do I need to use the API key when I can get the result without defining the key.

b) Which one is the more feasible API for my purpose is simply choosing latitude and longitude.

+7
source share
2 answers

The first URL is for v2 geocoding APIs , the second is for v3 .

v2

  • now out of date
  • API key required
  • has (undocumented) JSONP support

  • Which one depends (at least in part) on which environment you intend to use it: if you want to use it on a web page with JavaScript, you will have to use v2 because it has JSONP support (if you do not want to add a server cross-domain component). An alternative to JavaScript is the JavaScript JavaScript API service.

  • If you use the API in a desktop application or on the server side, you can use it, but v3 is recommended.

  • v3 also has a higher query limit (2500 requests per day) compared to v2 (1500 requests per day)

+6
source

The first URL is Google Maps v2 and the second is from Google Maps v3.
v2 is deprecated, but this does not mean that you cannot use it, it only indicates that "Google will fix errors within 3 years, if any, new features will be added.
You can continue to use it even after this period. "

1) Google Maps v3 does not support JSONP
2) Google Maps v2 has a higher geocoding limit of 15000, not (1500)
while Google Maps v3 has 2500 geocoding restrictions.
3) Google Maps v2 supports 4 output formats
https://code.google.com/apis/maps/documentation/geocoding/v2/index.html
4) Google Maps v3 only supports 2 json and kml formats

+2
source

All Articles