-1

I am getting an error notifying me of exceeding the API Quota. However, I have a quota of 150,000 requests and have only used up 12,000 of them. What is causing this error?

example of code:

from googleplaces import GooglePlaces

api_key = ''
google_places = GooglePlaces(api_key)

query_result = google_places.nearby_search(location="Vancouver, Canada", keyword="Subway")
for place in query_result.places:
    print(place.name)

Error Message:

googleplaces.GooglePlacesError: Request to URL https://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=Vancouver%2C+Canada failed with response code: OVER_QUERY_LIMIT
xomena
  • 31,125
  • 6
  • 88
  • 117
Riley Hun
  • 2,541
  • 5
  • 31
  • 77

2 Answers2

1

The request from error message is not a Places API request. This is Geocoding API request.

https://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=Vancouver%2C+Canada

It doesn't include any API key. That means you can have only 2500 daily geocoding requests without an API key. Also, geocoding requests have a query per second limits (QPS) which is 50 queries per second. You might be exceeding the QPS limit as well.

https://developers.google.com/maps/documentation/geocoding/usage-limits

Not sure why the library that supposed to be calling Places API web service in reality calls Geocoding API web service. Maybe this is some kind of fallback in case if Places API doesn't provide any result.

xomena
  • 31,125
  • 6
  • 88
  • 117
0

For anyone looking at this post in a more recent time period, Google has made it so it is NECESSARY to have an api key to use their maps api. So please ensure you have an api key for your program. Also keep in mind the different throttle limits.

See below for more info:

https://developers.google.com/maps/documentation/geocoding/usage-and-billing#:~:text=While%20there%20is%20no%20maximum,side%20and%20server%2Dside%20queries.