I had this problem the other day, in fact this is not a problem with this library.
First, make sure that you are using the serverβs API key, not the Android / iOS key (if you are a mobile developer). See this stackoverflow post: Google Places API request forbidden for Android autocomplete, even with the correct api key . The TL, DR version of this link is that the Google Places API does not support the key for Android / iOS, only a server option.
Secondly, and it goes without saying, make sure you pass the key to an instance of GooglePlaces.
Finally, if you are restricting the use of the API key by IP, make sure your request comes from a valid address.
Hari enaganti
source share