- Create a Google API project from cloud console
- Click on select project, or create new project
- Enable Google Sheets API from the API Menu
- Create credentials for service accounts with the needed access from the
Sheets Overview
page
- click on
create credentials
- click on
- Fill the information as shown here
- Select your service account name
- This information can be left blank
- Click on the newly created service account and navigate to the keys tab
- Click on
Add Key
and selectCreate new key
- Select JSON and click create, a json file will be downloaded in your
downloads
folder
Once a service account has been created, individual Google Sheet files should be
shared with the account in order to retrieve data from the sheets. To do that,
the share
functionality of Google Sheets can be used where the service account
email address should be given edit access to the file.
Please note that you should use the service account email setup when creating the service account