1

http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false

That url will work. However, if i include my key: http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false&key=abc123

I get request denied (i replace abc123 with my actual key). I just requested the key a few hours ago. I also turned on the maps api v2 and v3 for my domain. Even with both on i still get request_denied. Does anyone know why it doesn't accept my api key?

merk
  • 1,721
  • 5
  • 23
  • 39

3 Answers3

3

The geocoding-API doesn't require a key. Use the key only where it's needed/available(for the services listed in the API-console)

Dr.Molle
  • 116,463
  • 16
  • 195
  • 201
  • All Maps API applications* should load the Maps API using an API key see https://developers.google.com/maps/documentation/javascript/tutorial#api_key – david strachan Mar 24 '12 at 08:54
  • 1
    You are not loading the maps-API, you are requesting the geocoding-service, which is not listed inside the API-console. – Dr.Molle Mar 24 '12 at 10:21
  • damn. I was hoping i'd get the extra requests by using the api key since it says you get 25,000/day instead of 2500 – merk Mar 24 '12 at 20:39
  • @Dr.Molle, it does not require key, but does it have limit? – stkvtflw Feb 27 '16 at 16:26
  • 1. there are changes(this question is 4 years old), a key now may be used for the geocoding-API(fortunately). 2. the usage of a key doesn't affect the [limits for the geocoding-API](https://developers.google.com/maps/documentation/geocoding/usage-limits) , but it will change the target of the limits. Without a key the limits are related to the IP-address(of the server which sends the request). When you use the key it's related to your project. So when you don't use a key you will share the quota with any application on any domain which will use the same IP(it may be houndreds) – Dr.Molle Feb 27 '16 at 22:33
0

The problem there is that any request with the key needs to be over HTTPS. Trying changing to https://... and it should work.

John
  • 115
  • 4
0

API V3

<script type="text/javascript"
      src="http://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&  sensor=SET_TO_TRUE_OR_FALSE">
    </script>

API V2 deprecated

david strachan
  • 7,174
  • 2
  • 23
  • 33
  • So this is just if i want to render a map on the page, correct? I'm just looking up lat/long coordinates from an address. – merk Mar 24 '12 at 20:40