How to connect the Notion API to Google Sheets

Notion helps users schedule tasks, manage files, save documents, set reminders, keep agendas, organize their work. We can use the Notion API to import data from Notion into Google Sheets. In this tutorial, we’ll show you how to connect the Notion REST API to Google Sheets in 5 steps:

  1. Install the Apipheny add-on
  2. Obtain an integration token
  3. Choose a Notion endpoint
  4. Enter your Notion API request into Apipheny
  5. Run the Notion API request in your Google Sheet

Step 1.) Install and open the Apipheny add-on for Google Sheets

Apipheny is an API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to unlimited API data sources, make unlimited API requests, and more. There is a 30 day free trial included.

1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace: https://apipheny.io/install

2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.

In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.

open apipheny

Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new

Step 2.) Obtain an integration token

Go to https://www.notion.so/my-integrations and click the + New integration button:

My integrations section
My integrations section

Complete all the basic information and then click the Submit → button:

Basic information part1
Basic information part1
 Basic information part2
Basic information part2

In the Integration type section, check the Internal integration radio button and then click the Save Changes button:

Secrets section
Secrets section
Saving the changes
Saving the changes

From the Secrets section above, copy the Internal integration token to a safe location, because you’ll need it in the next steps.

A very important step that enables your interation to access your account’s databases is to share those databases with the integration. Begin by opening your database in Notion and going to the Share menu in the upper-right corner.

You’ll see a popup, where you must click Invite:

Your database
Your database

Click on your newly created integration:

Searching your integration
Searching your integration

Your integration has been added, now click the Invite button:

Integration inviting
Integration inviting

Now, your integration will be displayed in the Share popup:

Share popup
Share popup

Step 3.) Choose a Notion endpoint

In this section, we’ll show you how to browse the Notion API documentation to find the endpoint that retrieves the information you need from your account. If you already know your API URL, or you want to use the same example URL as us, just skip to Step 4.

First, open the Notion API documentation page: https://developers.notion.com/reference/intro

The menu on the left contains an Introduction section and a list of endpoints for this API:

Notion API documentation page
Notion API documentation page

An example endpoint is Retrieve a page, which displays a page by id. The URL for this endpoint is:

https://api.notion.com/v1/pages/page_id

If you use this URL don’t forget to replace page_id with a real page id.

The endpoint’s documentation contains its HTTP method (GET) and URI, a list of accepted path parameters, an example cURL command and its associated response:

Retrieve a page endpoint documentation
Retrieve a page endpoint documentation

All endpoints can be accessed with the following base domain: https://api.notion.com/v1/

Step 4.) Enter your Notion API request into Apipheny

Now go back to your Google Sheet and make sure that the Apipheny add-on is open on the Import tab. With the Import tab open, enter these details into the add-on:

Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) required by your API endpoint. For this example, we are using the GET method.

API URL: In Step 3, we explained how you can find the Notion API endpoint that you need. Now copy and paste your complete API URL into the Apipheny add-on, where it says API URL Path, followed by any parameters required for your query (if applicable).

For this example, we are using the Retrieve a database endpoint, which displays a database by id. This is what the whole URL looks like:

https://api.notion.com/v1/databases/database_id

If you use this URL, don’t forget to replace database_id with your database id.

Headers: In the Headers section of Apipheny, add two rows with the following keys and values:

Header 1
Key: 
Notion-Version
Value: 
2021-08-16

Header 2
Key:
Authorization
Value:
Bearer api_key

In Header 1, make sure to check the current Notion API version and replace header 1’s value with the most current version, if it has changed.

In Header 2, make sure to replace api_key wth the value you previously obtained in Step 2. There should be a space between Bearer and your API key.

Here’s what our API request looks like in Apipheny:

Notion API request entered into Apipheny
Notion API request entered into Apipheny

Step 5.) Run the Notion API request in your Google Sheet

Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the Notion API data to be imported into your Google Sheet. Here’s what our request looked like when completed:

Notion data imported into Google Sheets
Notion data imported into Google Sheets

That’s it! You’ve successfully connected your Notion account to Google Sheets using the Notion API, Google Sheets API, and the Apipheny add-on.

After making a successful request to the Notion API, try querying a different Notion API endpoint, or try using one of the more advanced features in the Apipheny add-on.


Crypto API tutorials and more:


API Tutorials



API Knowledge

What is an API?

What is an API URL?

What are parameters?

What is an endpoint?

What is an API key/token?

What is basic authentication?

What are headers?

What is a GET request?

What is a POST request?


Sponsored by Zink Virtual Tip Jar & Rewording.io Paraphrasing Tool

Accept donations on Twitch | Accept donations on Discord | Accept donations on YouTube | Accept donations on Telegram | Accept donations on Twitter | Accept donations on TikTok | Accept donations on Instagram | Accept donations on LinkedIn | Accept donations on Facebook | Accept donations on your Website