'Google Maps API request: Restrictions problem

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?



Solution 1:[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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user299697