Links

Get blocks from page

Tags: #notion #productivity #naas_drivers #operations #snippet #page
Author: Florent Ravenel
Description: This notebook allows users to quickly and easily add blocks from a page to their Notion workspace.

Input

Import libraries

from naas_drivers import notion

Setup Notion

# Enter Token API
NOTION_TOKEN = "ENTER_YOUR_NOTION_TOKEN_HERE" # EXAMPLE: "secret_xxxxxxxxxxxxxxxxxx"
# Enter Page URL
PAGE_URL = "ENTER_YOUR_PAGE_URL_HERE" # EXAMPLE: "https://www.notion.so/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Model

Get page

page = notion.connect(NOTION_TOKEN).page.get(PAGE_URL)

Get all blocks from page

blocks = page.get_blocks()

Output

Display blocks

blocks