-1

I am building PowerApps application with few requests to Google Maps API. First is generating static maps (it's working correctly). Second thing is building flow to get places near specific location (by type).

My request to API: https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=XXX,YYY&radius=1500&type=restaurant&key=MY_KEY

But in response I got error response:

{
  "error_message": "This API project is not authorized to use this API.",
  "html_attributions": [],
  "results": [],
  "status": "REQUEST_DENIED"
}

Problem is that, we set API Key without any restrictions - specific without restrictions about using API interfaces.

Maybe someone resolve similar issue?

  • 1
    Do you have the Places API enabled for your account that contains that key? Restrictions tend to apply as to where you can use the key, not what services you can access. See: https://developers.google.com/maps/documentation/javascript/cloud-setup – geocodezip Mar 11 '22 at 13:17
  • We have set this as "no restrictions". Other api key with same settings working ok. – Marcin Wojcik Mar 11 '22 at 13:47
  • Is the Places API enabled? https://console.cloud.google.com/apis/library/places-backend.googleapis.com – geocodezip Mar 11 '22 at 14:22
  • Thank you - now it's obvious, that it need to be open for projects also, not only for keys. – Marcin Wojcik Mar 14 '22 at 09:14

1 Answers1

1

@geocodezip is correct. Each project within Google Cloud must have API's enabled separately. This is different from the restrictions you put on an API key.

https://console.cloud.google.com/apis/library/places-backend.googleapis.com

If you'll notice that your error message says your project is not authorized, not the key. The key is fine, you just need to enable the Places API within the Google Cloud Project.

user299697
  • 78
  • 1
  • 3