Examples

Introductory

Create a Notion block

In this introductory codebase, start by learning the basics of Notion's Public API: creating a new block.

See sample code

Create a linked Notion block

Build on the previous example by creating a block in Notion and adding a link to it.

See sample code

Create a styled/linked Notion block

Extend the previous example further by styling a block of text that links to an external website.

See sample code

Get text from any type of block

This integration shows how to get a list of blocks from a Notion page and parse the text from any type of block.

Fork repository on GitHub

Intermediate

Create a Notion database

Create your first Notion database with a defined set of properties.

See sample code

Add new pages to a database

Build on the previous example by creating a database and adding new pages to it.

See sample code

Query pages in a database

Learn how to filter your database rows (pages) after creating them from scratch.

See sample code

Filter and sort database pages

Filter and sorts pages after adding them to a new database.

See sample code

Build a full-stack Notion integration

Learn how to build a Notion integration with an interactive front-end. This codebase is referenced in the Build your first integration guide.

Fork repository on GitHub

Advanced

Sync Spotify Playlists with Notion

This integration populates a Notion database with track metadata from a Spotify playlist.

See guide here

Integrate Mailchimp Campaigns with Notion

This integration populates a Notion database with Mailchimp campaign information, including subscriber contact information.

See guide here

Log Strava Activity in Notion

This integration syncs a Strava athlete's activity metadata within a Notion database.

See guide here

Add rows (pages) to an existing database

This integration finds the first database that your bot has access to, and creates correctly-typed random rows of data.

Fork repository on GitHub

Sync Notion with GitHub issues

This Notion integration syncs GitHub Issues for a specific repo to a Notion database. This example shows a one-way sync — changes in GitHub cause an update in Notion.

Fork repository on GitHub

Send an email from a Notion trigger

This Notion integration sends an email whenever the Status property of a page in a database is updated. This sample shows how to use Notion to cause an external action. In this case, the integration sends emails using SendGrid's API.

Fork repository on GitHub

Sync Notion with GitHub PRs

This Notion integration updates Notion tasks when a linked Github PR is closed/merged. This integration requires the Notion task link be mentioned in the PR description.

Fork repository on GitHub