kiwiz / gkeepapi

An unofficial client for the Google Keep API.
MIT License
1.54k stars 114 forks source link

Quota exceeded? #103

Closed pinkunicorn closed 3 years ago

pinkunicorn commented 3 years ago

gkeepapi 0.13.3 python 2.7.15 (MacOS system version) MacOS 10.15.7

I have a gkeepapi script that runs from cron and has done so successfully for a while. I now noticed that it's failed the last few times. The last successful run was on 2021-01-11. When I run it now (script unchanged since months back) I get this in the terminal:

Traceback (most recent call last): File "/Users/hans/Dropbox/keep.py", line 19, in (today.strftime("%Y-%m-%d"), e['code'], e['message'])) TypeError: sequence index must be integer, not 'str'

and the script then prints the raw exception it gets as this:

{u'status': u'RESOURCE_EXHAUSTED', u'message': u"Quota exceeded for quota metric 'Sync requests' and limit 'Sync requests per minute per user' of service 'notes-pa.googleapis.com' for consumer 'project_number:192748556389'.", u'code': 429, u'errors': [{u'reason': u'rateLimitExceeded', u'message': u"Quota exceeded for quota metric 'Sync requests' and limit 'Sync requests per minute per user' of service 'notes-pa.googleapis.com' for consumer 'project_number:192748556389'.", u'domain': u'global'}]}

This script runs from cron every hour in theory, but this is a laptop so it only runs if it happens to be awake at cron time which it usually isn't. In the recent data I have, I typically see one finished run per day (sometimes none, never multiple on the same day).

Is this something that I can do something about or a change in the keep service?

kiwiz commented 3 years ago

Do you do a full sync every time, or a partial one (via keep.resume)? The latter might help with the rate limiting. See this example: https://github.com/kiwiz/gkeepapi/blob/master/examples/resume.py

kiwiz commented 3 years ago

Closing due to inactivity. Feel free to reopen if you're still seeing issues.

sevetseh28 commented 1 year ago

I have around 5K notes to create, and at some ppint I get Rate limitting every time I try to run the script. I've tried running sync() in batches of 100 and with waiting between each batch but I'm still Rate limitted, any ideas on how to approach it @kiwiz ? The rate limit response doesnt even tell me when I'm able to do the next request either.