Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between this two Google Maps Geocoding API URL?

i have a requirement where i just need to fetch the Latitude and Longitude by giving address here is the two different versions of Google Maps Geocoding API URL i used which outputs 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 API Key and the Second one without the API Key. i would like to know

a) Why do i need to use the API key when i could fetch the result without defining the key.

b) Which one is more feasible API for my Purpose of just fetching latitude and longitude..

like image 552
Ibrahim Azhar Armar Avatar asked May 30 '11 15:05

Ibrahim Azhar Armar


2 Answers

The first URL is for v2 of the Geocoding API, the second is for v3.

v2

  • is now deprecated
  • requires an API key
  • has (undocumented) support for JSONP

  1. Which one to use depends (at least in part) on what environment you're going to use it in - if you want to use it in a webpage with JavaScript, you'll have to use v2 since it has JSONP support (unless you want to add a server-side component to get around cross-domain issues). An alternative for JavaScript is the JavaScript API Geocoder service.

  2. If you're using the API in a desktop app or on the server-side, you can use either but v3 would be recommended.

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

like image 107
no.good.at.coding Avatar answered Oct 24 '22 03:10

no.good.at.coding


The first URL is of Google Maps v2 and the second of Google Maps v3 .
v2 is deprecated , but that doesn't mean you can't it use it , it only
indicates that "Google will continue fix bugs for 3 yrs if any ,
but no new features will be added .
You can continue using it even after that period ."

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

like image 38
vaishakh Avatar answered Oct 24 '22 04:10

vaishakh