Google retires referrer-restricted API keys with Places Web Service

Viewed 1478

I recently received an e-mail from Google letting me know this :

You are receiving this email because your project is using Places Web Service API with an API Key with HTTP referer restrictions. (...) starting January 31 2018 the Places Web Service API will no longer accept API Keys with HTTP Referer usage restrictions.

My code only uses Javascript Maps and Places APIs, with code such as

new google.maps.places.AutocompleteService();
new google.maps.places.PlacesService(document.createElement("div"));

Digging into the API for Google Places for Javascript documentation, i found out that

Before using the Places library in the Google Maps JavaScript API, first ensure that the Google Places API Web Service is enabled in the Google API Console, in the same project you set up for the Google Maps JavaScript API.

So i'm unsure what to do there. I use http referer restricted keys to use a Google Maps JS API, which is correct and not deprecated. However, Google Maps JS API itself uses the Places API Web Service, for which i can't use the http referer restricted keys.

How am i supposed to handle this situation ?

2 Answers

Sorry for the confusion.

I reviewed your current situation, and found you don't need to update your API key.

The HTTP referer restricted API key will keep working for Places Library, which is a part of Maps JavaScript API: https://developers.google.com/maps/documentation/javascript/places

The HTTP referer restricted API key will stop to work if you are using Places API directly with the key. It will keep working for Maps JavaScript API including Places Library and Services: https://developers.google.com/maps/documentation/javascript/directions

  • Directions Service
  • Distance Matrix Service
  • Elevation Service
  • Geocoding Service

We have the same question. We use the client side Places Autocomplete library. Will this also continue to work with http referrer restrictions?

Related