Create a Google Project and Configure Sheets API

Create a Google Project and Configure Sheets API

First, let's configure a new Google Console project to enable Sheets API.

Open the Google Cloud Console and create a new project:

Google Cloud Console, new project

Click on Enable APIs and Service, search for Sheets API, enable the service:

Enable Google Sheets API

Once enabled, we can configure the service:

Google Sheets API is enabled

We now create credentials, in this tutorial, we'll use Application data access:

Google Sheets API, create credentials

We need to create a service account (the generated email will be useful later 💡):

Google Sheets API, create service account

We edit the service account to create a new key, using the json type:

Google Sheets API, create new key for service account

We can now download the key file in local and rename it to credentials.json.

The bit tedious configuration part is over!

Create and Share a Google Sheets

We can create a Google Sheets document. In this tutorial, I use a collection of movies:

Create a new Google Sheets

A spreadsheet can contain several sheets; this one has a single sheet named Sheet1.

We have to share this document with the previously generated service account email (we set Editor permissions to allow the update of the sheets):

Share the Google Sheets document with the service account

Did you find this article useful?