REQUEST_DENIED means Google refused a geocoding request made with your API key. On a GeoDirectory site you’ll usually see it as “Google geocode failed: REQUEST_DENIED” during a CSV import, when some rows have an address but no latitude and longitude and GeoDirectory asks Google to look them up.
Your maps can work perfectly at the same time, because maps and geocoding use the key in different places.
Why the map works but geocoding fails
Maps load in the visitor’s browser, so a key restricted to your website (an HTTP referrer restriction) is accepted. Import geocoding runs on your web server, which doesn’t send your website as a referrer, so Google denies the same key. A Geocoding API that isn’t enabled, or a Google Cloud project without billing, gives the same error.
How to fix it
- In the Google Cloud console, open the project that owns your key and check the Geocoding API is enabled and billing is set up.
- Create a second API key for geocoding. Restrict it by API (Geocoding API) or by your server’s IP address, not by website.
- Paste it into Google Geocoding API Key at GeoDirectory > Settings > General, under Map Settings (click Show Advanced to see it). GeoDirectory then uses this key for geocoding and timezone requests and keeps your main key for maps.
- Import the rows that failed again.
GeoDirectory’s import looks up missing coordinates with Google even if your site displays OpenStreetMap maps, so you still need a working Google geocoding key for those rows. The simplest way to avoid the lookup is to include latitude and longitude in your CSV. See CSV imports: useful tips and Get a Google API key.
If the error is OVER_QUERY_LIMIT instead, the key works but has hit a quota. Check the quotas for the Geocoding API in the Google Cloud console.