No longer working
opened this issue · comments
Even the most basic queries return this even using a new google account and API key
Traceback (most recent call last):
File "C:\Python3\lib\site-packages\populartimes\__init__.py", line 56, in get_id
return get_populartimes(api_key, place_id)
File "C:\Python3\lib\site-packages\populartimes\crawler.py", line 374, in get_populartimes
check_response_code(resp)
File "C:\Python3\lib\site-packages\populartimes\crawler.py", line 413, in check_response_code
"You exceeded your Query Limit for Google Places API Web Service, "
populartimes.crawler.PopulartimesException: ('Google Places OVER_QUERY_LIMIT', 'You exceeded your Query Limit for Google Places API Web Service, check https://developers.google.com/places/web-service/usage to upgrade your quota.')
Anyone worked this out?
Thanks
I did some freelance work with a company called StormCloud, and they built a commercial offering of the populartimes API. It was decently inexpensive, but they built a communal database that allowed caching of place results so you didn't have to re-search every time which saves a ton of money. Either way, if you're looking for something that's actively developed for so you won't have to wait for fixes I might give them a look, they hired me on to help with the new Google Places API transition so I know at least have that figured out, and it seemed pretty solid when I was trying it. (https://stormcloud.one)
Thanks - that's useful to know and something I will probably use in the future with the right client. A shame this isn't working though...
@mapman1980 it seems like you exceeded you quota, check https://developers.google.com/places/web-service/usage-and-billing
I thought that too but the API console showed 24 requests (small area) of which it said 22 failed
Hang on, I have to enable billing now?!
Could you provide more information how you exceeded the limit so fast (if it's not the general activation of billig)?
Since the API updates especially the areal search requires more requests.
Hi, plot thickens.
I activated the free $300 of credit and entered billing details so all should be fine at the Google API console now.
I re-ran the code I was using and now I am getting this response:
Exception in thread Thread-19:
Traceback (most recent call last):
File "C:\Users\Jakesa~1\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "C:\Users\Jakesa~1\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Jakesa~1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\populartimes\crawler.py", line 106, in worker_radar
get_radar(item)
File "C:\Users\Jakesa~1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\populartimes\crawler.py", line 125, in get_radar
check_response_code(resp)
File "C:\Users\Jakesa~1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\populartimes\crawler.py", line 409, in check_response_code
"Request was denied, the API key is invalid.")
populartimes.crawler.PopulartimesException: ('Google Places REQUEST_DENIED', 'Request was denied, the API key is invalid.')
I checked my API key and it should be fine. Again, I'm getting 97% errors on the API console using populartimes.
This is the request in my code:
populartimes.get(apiKey,["bar"], (51.45527, -0.01907), (51.46753, -0.00407))
I'm borrowing some code someone wrote in the issues to test if this works. Can't see anything wrong with the code:
import populartimes
apiKey = "#####"
def hello_world():
lat1 = 51.45527
long1 = -0.01907
lat2 = 51.46753
long2 = -0.00407
data = populartimes.get(apiKey,["bar"], (lat1, long1), (lat2, long2))
print(data)
for location in data:
if('current_popularity' in location):
print("Location name: " + location['name'] + " is has current popularity of: " +
str(location['current_popularity']))
hello_world()
Running the code you specified above i got a normal response: https://pastebin.com/hRMfWMvp. Are you using the key for Google Places API Web Service?
Ok, silly me. In the Google API console, it's not good enough to simply activate billing, enter credit card details etc. You have to then link the billing account to the project!!!
All working well now - thanks for your help all!