If you’re using the new Places API rather than the legacy version, ensure you’re making requests to the correct endpoint:
POST https://places.googleapis.com/v1/places:autocomplete
instead of the deprecated one.
For more details, refer to the official documentation: https://developers.google.com/maps/documentation/places/web-service/place-autocomplete