google-maps

Why does my Google Maps Distance Matrix API request return a 404 error?


Got my API Key and inserted it into the sample request on the Google Maps Page like this:

https://maps.googleapis.com/maps/api/distancematrix/json
  ?destinations=New%20York%20City%2C%20NY
  &origins=Washington%2C%20DC%7CBoston
  &units=imperial
  &key=[My API Key]

I pasted this, with my actual API key, into the browser URL field but it returns "404 ... was not found on this server. That's all we know."

That's all I know, too. I triple checked the key. Why does this not work?


Solution

  • You are getting this error because this feature can't be used for future usage. According to the developer docs for Distance Matrix (this is only shown on the English version of the docs):

    This product or feature is in Legacy status and cannot be enabled for new usage.

    It’s been replaced by the Routes API