The following guide will show you how to connect BigQuery to Google Sheets in a few simple steps.
Google BigQuery is a “serverless” cloud data warehouse that can scale compute and storage resources independently and automatically across petabytes of data. BigQuery is one of Google’s core data analytics solutions, along with Google Sheets and Looker, the BI platform that the search giant acquired in 2020.
In the guide below, we’ll outline the top ways to connect BigQuery to Google Sheets, including step-by-step walkthroughs for each option.
BigQuery to Google Sheets Integration: Top Tw methods
1. Connected Sheets
In an effort to unify its various data analytics solutions, Google now packages Sheets with a built-in data connector for BigQuery called “Connected Sheets.”
You can access Connected Sheets directly from the Google Sheets interface. Before setting up the connector, make sure you have the required Google Cloud account configuration:
- You need an enterprise Google Workspace account to use Connected Sheets with BigQuery.
- You must create a new Google Cloud Project by navigating to Google Cloud Console and the Project Selector Page.
- Make sure your Cloud Project’s billing is toggled to ‘on’.
After configuration, open a Google Sheet. Click Data on the top menu, Data Connectors from the drop down, and then Connect to BigQuery.
Next, select the new Google Cloud Project.
For this example, let’s pull a public dataset from BigQuery into Google Sheets. Select Public datasets.
Input Chicago in the search box and choose the chicago_taxi_trips dataset. Then select the taxi_trips table and press Connect.
The BigQuery data will populate in your Sheet. The sample import dataset below contains 202 million rows.
You can import more data from Google BigQuery into Sheets with the Extract feature. This allows you to work off of a subset of your data on a separate Sheet.
Click the Extract button at the top of the table. Select the New Sheet option and click Create.
Choose your preferred filters, sorting order, columns, and the number of rows you want to import on the Extract Editor.
In the example below, we’ll import 25,000 rows with the fares, tips, tolls, and trip_start_timestamp columns sorted in descending order.
Click Apply to import the BigQuery data into Google Sheets.
- Yonatan Schvimer
Although Google’s built-in BigQuery connector works great for big data projects, Ops users will find Coefficient’s ease of use, flexibility, and operationalizing features such as Slack alerts superior for their business use cases.
2. API Connector by Mixed Analytics
Technical users can leverage API Connector by Mixed Analytics to connect BigQuery to Google Sheets. The add-on lets you manually integrate any API with Google Sheets.
Start by installing the API Connector in the Google Workspace Marketplace.
Then create a new Project on the Google Cloud platform. Try to use the same Google account you use for BigQuery.
Next, configure the Consent screen by navigating to APIs & Services, then OAuth consent screen. Select Internal as the User Type and click Create.
Provide your app name, user support email, and developer email address in the OAuth consent screen and leave the rest of the fields blank.
Then click ADD OR REMOVE SCOPES on the next screen and select the /auth/bigquery scope.
Scroll down and click Update. You should see your scope listed under Your sensitive scopes.
Click SAVE AND CONTINUE.
The final screen will show a summary of your settings. Click Back to Dashboard to go to the next step.
Within this same Project, click APIs & Services and Credentials. Then click +Create Credentials and OAuth client ID.
Fill in the required fields, as shown in the screenshot below.
Click Create when you’re done. Note your Client ID and Client Secret. You’ll need them for the following step.
Navigate to Extensions on the Google Sheets top menu. Then click API Connector and Manage Connections.
Scroll down the API Connector sidebar and select Add Custom OAuth. Provide the required information as shown below.
Click Save, then Manage Connections. Click Connect, then Allow, on the popup window to login and authorize the connection.
Now it’s time to create your API request URL. For example, you can start by listing a table’s content in rows. The complete API URL would look something like this:
Follow the format and use your own dataset, project, and table IDs. Now you can pull BigQuery API data into Google Sheets.
Go back to API Connector and launch the extension. Input the API URL you created in the previous step. Choose your custom BigQuery connection from the drop down menu under OAuth.
Input Key = Content-Type, Value = application/json under Headers.
Then create a new tab. Click Set current to use the specific tab as your data destination. Name your request, then click Run. You should see your BigQuery data populate in Google Sheets.
Unlock a New Dimension of Analysis: Connect Google BigQuery to Google Sheets
You can connect BigQuery to Sheets through several different methods, from one-click apps to code-based tools. While Google’s Connected Sheets is a solid option for big data use cases.