Import Notion Data to Google Sheets
In this guide, we’ll walk through how to pull data from the Notion API directly into Google Sheets, using the API Connector add-on for Sheets. We’ll first get an API key from Notion, and then set up a request to pull in data to your spreadsheet.
- Before You Begin
- Part 1: Get Notion Token
- Part 2: Create your API Request URL
- Part 3: Use Notion API data with Google Sheets
- Part 4: More API Examples
- Part 5: Handle Pagination
- Part 6: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Get Your Notion Token
- Log in to Notion and click Settings & Members on the left side navigation menu
- Click Integrations and then Develop your own integrations
- Click + New Integration
- You’ll be prompted to give your integration a name and a logo. These can be anything. Click Submit.
- You will be presented with an internal token that you can use to make your API requests.
- Scroll to the bottom of the page, make sure Internal integration is selected, and click Save. Congrats, you have your token! Copy it down as we’ll use it shortly.
Part 2: Allow Access for your Token
By default, the token you’ve just created doesn’t have access to your Notion data until you explicitly share access.
To share access, navigate to your page or database, click the Share button in the upper right corner, and then into the People, emails, groups, or integrations textbox.
Select your integration and click Invite
Now your page is available via the API.
Part 2: Create Your API Request URL
For our first request, we’ll get metadata about a page.
- Base URL: https://api.notion.com/v1
- Endpoint: /pages/page_id
You can get your page ID from your page URL:
Putting it all together, we get the full API Request URL. Just substitute in your own page ID.
Part 3: Pull Notion API Data into Sheets
Now let’s get that data!
- Open up Google Sheets and click Extensions > API Connector > Open.
- In the Create Request tab, enter the Request URL we just created
- Leave OAuth set to None
- Enter three headers. Where it says Bearer secret_xxxx, substitute in your Notion token from the first part of this article.
- Authorization: Bearer secret_xxxxxxxxxxxx
- Notion-Version: 2021-08-16
- Content-Type: application/json
- Create a new tab and click Set current to use that tab as your data destination.
- Name your request and click Run. A moment later you’ll see data about your Notion page populate your Google Sheet:
Part 4: More Example API URLs
You can check the documentation for the full list of available endpoints, or try these example requests:
- List databases
- Get records within a database (substitute in your database ID, and use a request body of
- Get content from a page (substitute in your page ID)
Part 5: Handle Pagination
By default, Notion API limits 100 responses per page as shown in their documentation:
To get more records, use the start_cursor parameter as described.
In API Connector you can do this automatically with the pagination handling feature, like this:
- API Request URL: enter your request URL
- Pagination type: cursor
- Next token parameter: start_cursor
- Next token field: next_cursor (this is the column name containing the tokens)
- Number of pages: enter the number of pages you’d like to fetch
Part 6: API Documentation
Official API documentation: https://developers.notion.com/reference/intro