Create a Google Sheets integration
Build an app that connects to Google Sheets using Python. Learn how to fetch and process spreadsheet data on Replit.
Learn how to create an application that interacts with Google Sheets. This guide shows you how to access and display spreadsheet data using Python and pandas.
What you’ll learn
Google Sheets
Connect to spreadsheet data
Data Processing
Work with pandas dataframes
API Integration
Use Google’s API services
Authentication
Handle OAuth and service accounts
Create your app
Fork the template
Sign in to Replit and fork the Google Sheets to HTML Renderer. Select + Use Template and follow the prompts to create your Replit App.
Configure for public sheets
- Open
main.py
- Replace
WORKSHEET_URL
with your Google Sheet URL - Set
require_auth=False
for public sheets
A worksheet refers to a single tab in a Google Sheet. Make sure to use the correct tab’s URL.
Configure for private sheets
- Enable Google Sheets API access:
- Enable Drive and Spreadsheets APIs
- Follow the API setup guide
- Create a service account
- Add the service account JSON to your Replit App’s Secrets as
SERVICE_ACCOUNT_JSON
- Share your sheet with the service account email
Service accounts provide secure, automated access to your sheets.
Deploy your app
Configure deployment
- Select Deploy in the workspace header
- Choose Reserved VM deployment
- Select Deploy
Test
Your app will be live in a few minutes. Test it by accessing the HTML endpoint in your browser.
Customization options
Data Processing
- Modify data transformations
- Add filtering options
- Create custom views
Display
- Customize HTML rendering
- Add interactive features
- Style your output
Next steps
Related guides
Want to learn more about API integrations? Check out our deployment documentation.
Was this page helpful?