I have a program which needs to extract rows from 15 google sheets (and some other requests), but when I run the code if I do not insert a time.sleep(20) between each reading function I receive the following message:

Quota exceeded for quota group 'ReadGroup' and limit 'Read requests per user per 100 seconds' of service

The problem is that if I check on Console Cloud Google it displays me that I have called just 24 requests per 100 seconds. I read that the limits might include also others API requests, but adding up each one I have barely around 40 requests per 100 seconds vs the limit of 100 per person. The peak is 24 requests per 100 seconds for the read group of google sheet API:

Most of the google sheets don't have more than 20 rows and all have 10 columns

For references I add my code where I receive the error

GSPREAD_SCOPES =[
        'https://www.googleapis.com/auth/spreadsheets',
        'https://www.googleapis.com/auth/drive'
    ]

gc = activate_gspread(credentials_raw, GSPREAD_SCOPES)

def get_sheets(sheet):
    return gc.open_by_key(sheet)

# players_sheets is a list of all the players to read
for player in players_sheets:
    # gsheets is a dictionary that pairs player with the corresponding google sheet
    input_sheet = get_sheets(gsheets[player])
    sheet = input_sheet.sheet1.get_all_values() # Here I receive the error usually around the loop number 10-12
    table = pd.DataFrame(sheet[1:], columns = sheet[0])
0

There are 0 answers