Oguz Yildiz
Oguz Yildiz

Reputation: 51

Google Maps Distance Matrix REQUEST_DENIED

I did everything. This is my link

http://maps.googleapis.com/maps/api/distancematrix/json?origins=39.876678,32.749386&destinations=39.901374,32.760909|39.934519,32.85764&language=tr-TR&sensor=false&option=driving&units=metric

This works. But when I add my key, it gives REQUEST_DENIED error. (this is in a php code, I upload it to server, then I execute it. (I see the REQUEST_DENIED error with "echo".) So I guess I need to take a server api key) I can see the requested json properly, that's how I see REQUEST_DENIED

Key for server apps (with IP locking)
API key:    
AIzaSyAtLjmC2sNDBy8GY0ldL3QUMhXhqK*****
IPs:    
174.120.10.61 (THIS IS THE IP OF THE SERVER I'M UPLOADING MY CODES)
Activated on:   Apr 25, 2013 3:41 AM
Activated by:   *** – you 

Can someone please tell me why am I still getting REQUEST_DENIED error?

Upvotes: 2

Views: 6911

Answers (6)

Ismail Umar
Ismail Umar

Reputation: 1124

This is late but anyone might be facing the same problem now.

Here is a checklist.

Use HTTPS Make sure you are making the request over https instead of http.

API Key Make sure the application has access to the key storage and the APIs needed have been enabled on the Google Developer Console

Check Request Parameters Make sure all request parameters are correctly typed.

Upvotes: 0

Jorge Casariego
Jorge Casariego

Reputation: 22212

In my case was because I didn't enable this service for my project.

It is possible to enable here:

https://console.developers.google.com/apis/library/distance-matrix-backend.googleapis.com/

Upvotes: 2

Dennis Prins
Dennis Prins

Reputation: 11

Use https instead of http.

http://. to https://.

Upvotes: 1

geocodezip
geocodezip

Reputation: 161384

The Google Maps Distance Matrix web service does not use a key.

https://developers.google.com/maps/documentation/distancematrix/#RequestParameters

Upvotes: 0

M. Haris Azfar
M. Haris Azfar

Reputation: 618

Google Distance Matrix API has a limit of elements set to 2500. I highly doubt it that you would have gone over this limit, as you would have to have calculated the maximum 10 x 10 matrix 25 times over. I am from South Africa, and it refused to work for any local addresses until I changed the transport mode to driving (from walking, I mean seriously, we have cars). Maybe that'll help

Upvotes: 0

M. Haris Azfar
M. Haris Azfar

Reputation: 618

REQUEST_DENIED — The service denied use of the Distance Matrix service by your web page.

Upvotes: 0

Related Questions