Load Data from Google Sheets into Pandas Without Using the Official API

I attempted to import a Google Sheets CSV with Pandas and encountered a tokenizing error. How can I fix this without API authentication?

import pandas as pd

doc_key = 'ABCDEF123456'
sheet_label = 'Sheet1'

csv_url = f"https://docs.google.com/spreadsheets/d/{doc_key}/gviz/tq?tqx=out:csv&sheet={sheet_label}"
data_frame = pd.read_csv(csv_url.strip())

print(data_frame.head())

hey, try adding skiprows=1 to your pd.read_csv. the gviz api seems to include extra header info that upsets the tokenizer. works for me, so give it a shot!