Member-only story

Access Google Sheets API in Python Using Service Account.

Owais Qureshi
4 min readJul 21, 2021

--

For Bots: Using Service Account

My Android APP Register today https://forms.gle/BVos9T9dsY4BMjdi7

We All need Google Sheets in day-to-day life why not automate some repeated tasks using python.

Google Sheets API Docs LINK.

First Take A look at how many methods are there to Access Google Sheets API using Python.

AND

Choice one that fits your NEEDS

  1. API Key
  2. Service Accounts
  3. OAuth 2.0 Client IDs

Access Google Sheets API In Python Using Service Account.

Step:1 Go to Google Cloud

Go to Google Cloud Console and Set up your New Project.

Step:2 Enable Google Sheets

Let’s Enable Google Sheets API.

Click on Search Bar And Search For Google Sheets API.

Now click on Enable.

Step:3 Create Service Account

Now Let’s Create Service Account. So we could authenticate the python APP later on.

In the First option select Google Sheets API.

What data will you be accessing? Keep in mind service account replicate user’s actions. it doesn’t allow you to access user’s data.

Data belonging to a Google user, like their email address or age. User consent is required. This will create an OAuth client.It’s up to you that you use GCE, GKE, or other…

--

--

Owais Qureshi
Owais Qureshi

No responses yet

Write a response