UseSQL
  • Introduction
  • Getting Started
    • Source Formats
    • Output Formats
    • Managing Keys
    • Sandbox
    • Saved Queries
  • Client Libraries
    • HTML Templating
    • JavaScript Web Client
  • Tutorials
    • Integrate With Your Static Site
    • Share Data In Slack
    • Show external query results in a Google Sheet
    • Query across a Google Sheet and a CSV file
    • Securing Your Key
    • Querying Airtable
    • Integrate With ProcFu
    • Integrate with a private Google Sheet
    • Updating Google Sheets
    • Retrieving data from tables on a web page
    • Displaying reports in Google Sheets from MySQL
    • Querying StackBy Tables
  • Resources
    • Demo Sandbox
    • OpenAPI Docs
    • Redoc API Docs
    • Roadmap
    • Changelog
Powered by GitBook
On this page
  • Step 1: Add your Google Sheet's id to your key
  • Step 2: Give the UseSQL service account view permissions to your sheet
  • Step 3: Start querying your sheet

Was this helpful?

  1. Tutorials

Integrate with a private Google Sheet

PreviousIntegrate With ProcFuNextUpdating Google Sheets

Last updated 4 years ago

Was this helpful?

If you want to query a private Google Sheet you just need to do a couple of things to enable this. These steps are outlined below. If at any time you have an issue following these steps, please reach out to .

Step 1: Add your Google Sheet's id to your key

The first step is to attach your Google Sheet's id to one of your API keys. Login to your dashboard to do this, and click on the button labeled with "Sheets".

Once you have clicked on the button you should see a screen as shown below where you can find instructions for your next steps, and where you can add your Googles Sheet id.

You can find the id in the url for the Google sheet. When viewing the sheet it will follow https://docs.google.com/spreadsheets/d/ and precede /edit/ as shown below.

Step 2: Give the UseSQL service account view permissions to your sheet

The next step is to take the service account googlesheets@usesql.iam.gserviceaccount.com and give it view access to the sheet you are looking to query, by clicking on the sheet's share button as shown below.

When adding you will also want to disable the "Notify people" checkbox otherwise you will get notified of the fact that the service account cannot receive emails.

Step 3: Start querying your sheet

At this point, you are ready to query your private Google Sheet, and as many other supported sources as you please through SQL.

support@usesql.com