stephan765 / Google-Search-Console-bulk-query

A script to iterate through the available filters on Google Search Console, minimising sampling issues by extracting each possible combination of filters.
66 stars 46 forks source link

rate limit exceded #2

Open garethjax opened 7 years ago

garethjax commented 7 years ago

I've been hitting the "api rate limit" during my tests, especially using an url file.

Is there a "maximum" amount of 5000 rows for the entire operation?

I've tried this specific case

python search_console_query.py https://www.xxxxxxx.it/ 2017-02-05 2017-02-06 --page_filters_file pages.txt --max-rows-per-day 5

The first day was processed completely and a csv file was created (even though there are 115 queries instead of over 500 listed per GSC).

the second day was processed at least until row 748 and then i got the api limit error and the script stopped.

Traceback (most recent call last): File "search_console_query.py", line 281, in main() File "search_console_query.py", line 250, in main response = execute_request(service, args.property_uri, request) File "search_console_query.py", line 35, in rate_limited_function ret = func(*args, kwargs) File "search_console_query.py", line 149, in execute_request response = service.searchanalytics().query(siteUrl=property_uri, body=request).execute() File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper return wrapped(*args, *kwargs) File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/site-packages/googleapiclient/http.py", line 835, in execute method=str(self.method), body=self.body, headers=self.headers) File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/site-packages/googleapiclient/http.py", line 162, in _retry_request resp, content = http.request(uri, method, args, kwargs) File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/site-packages/oauth2client/transport.py", line 175, in new_request redirections, connection_type) File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/site-packages/oauth2client/transport.py", line 282, in request connection_type=connection_type) File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/site-packages/httplib2/init.py", line 1322, in request (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/site-packages/httplib2/init.py", line 1072, in _request (response, content) = self._conn_request(conn, request_uri, method, body, headers) File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/site-packages/httplib2/init.py", line 1025, in _conn_request response = conn.getresponse() File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/http/client.py", line 1331, in getresponse response.begin() File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/http/client.py", line 297, in begin version, status, reason = self._read_status() File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/http/client.py", line 258, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/socket.py", line 586, in readinto return self._sock.recv_into(b) File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/ssl.py", line 1002, in recv_into return self.read(nbytes, buffer) File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/ssl.py", line 865, in read return self._sslobj.read(len, buffer) File "/Users/garethjax/miniconda3/envs/myenv/lib/python3.6/ssl.py", line 625, in read v = self._sslobj.read(len, buffer) ConnectionResetError: [Errno 54] Connection reset by peer

stephan765 commented 7 years ago

Are you still running into this issue? I've detected it on a very small number of occasions, but I'm fairly confident now that this isn't related to API limits, and I'm unable to re-create the error consistently.

Have you ruled out network issues?

garethjax commented 7 years ago

ah sorry i didn't try it again during the last months.