Member-only story
How to Integrate the Google Sheets API With Python Flask
Build an API that does CRUD operations on your Google Sheet

In this tutorial, I will show how to integrate Google Sheets API with Python Flask by building your own API that essentially does CRUD (Create, Read, Update and Delete) operations in your Google Sheet.
Initial Setup
Create a new project on Google Cloud Console
Log into console.cloud.google.com and create a new project. You should be automatically redirected to the main dashboard of your new project.
Then, navigate to APIs & Services > Library:

Scroll down to the G Suite section and click on the Google Drive API, then enable it.

You’ll be redirected to the following page:

Click on “create credentials”, and fill in the form with the following details.

Replace “service account name” with a name you like.

After clicking “continue” a JSON file containing your credentials should automatically be downloaded. The name of the JSON file is probably something complicated. For the purposes of simplicity and consistency when setting up our API later, rename the file to credentials.json
.
Finally, do the same for the Google Sheets API by searching for it in the G Suite section and enabling it. However, unlike the Google…