> ## Documentation Index
> Fetch the complete documentation index at: https://developers.notion.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples

## Introductory

> [card] [Create a Notion block](https://github.com/makenotion/notion-cookbook/blob/main/examples/intro-to-notion-api/basic/1-add-block.ts)
>
> In this introductory codebase, start by learning the basics of Notion's Public API: creating a new block.

> [card] [Create a linked Notion block](https://github.com/makenotion/notion-cookbook/blob/main/examples/intro-to-notion-api/basic/2-add-linked-block.ts)
>
> Build on the previous example by creating a block in Notion and adding a link to it.

> [card] [Create a styled/linked Notion block](https://github.com/makenotion/notion-cookbook/blob/main/examples/intro-to-notion-api/basic/3-add-styled-block.ts)
>
> Extend the previous example further by styling a block of text that links to an external website.

> [card] [Get text from any type of block](https://github.com/makenotion/notion-cookbook/tree/main/examples/parse-text-from-any-block-type)
>
> This connection shows how to get a list of blocks from a Notion page and parse the text from any type of block.

## Intermediate

> [card] [Create a Notion database](https://github.com/makenotion/notion-cookbook/blob/main/examples/intro-to-notion-api/intermediate/1-create-a-database.ts)
>
> Create your first Notion database with a defined set of properties.

> [card] [Add new pages to a database](https://github.com/makenotion/notion-cookbook/blob/main/examples/intro-to-notion-api/intermediate/2-add-page-to-database.ts)
>
> Build on the previous example by creating a database and adding new pages to it.

> [card] [Query pages in a database](https://github.com/makenotion/notion-cookbook/blob/main/examples/intro-to-notion-api/intermediate/3-query-database.ts)
>
> Learn how to filter your database rows (pages) after creating them from scratch.

> [card] [Filter and sort database pages](https://github.com/makenotion/notion-cookbook/blob/main/examples/intro-to-notion-api/intermediate/4-sort-database.ts)
>
> Filter and sorts pages after adding them to a new database.

> [card] [Upload files to a page](https://github.com/makenotion/notion-cookbook/blob/main/examples/intro-to-notion-api/intermediate/5-upload-file.ts)
>
> Create, send, and attach a file upload to a page's contents and as a comment attachment.

> [card] [Build a full-stack Notion connection](https://github.com/makenotion/notion-cookbook/tree/main/examples/web-form-with-express)
>
> Learn how to build a Notion connection with an interactive front-end using Express.js and the Notion SDK for JavaScript.

## Advanced

> [card] [Sync Spotify Playlists with Notion](https://developers.notion.com/guides/tutorials/spotify)
>
> This connection populates a Notion database with track metadata from a Spotify playlist.

> [card] [Integrate Mailchimp Campaigns with Notion](https://developers.notion.com/guides/tutorials/integrate-mailchimp-campaigns-with-notion-databases)
>
> This connection populates a Notion database with Mailchimp campaign information, including subscriber contact information.

> [card] [Log Strava Activity in Notion](https://developers.notion.com/guides/tutorials/log-strava-activity-in-notion)
>
> This connection syncs a Strava athlete's activity metadata within a Notion database.

> [card] [Add rows (pages) to an existing database](https://github.com/makenotion/notion-cookbook/tree/main/examples/generate-random-data)
>
> This connection finds the first database that your bot has access to, and creates correctly-typed random rows of data.

> [card] [Sync Notion with GitHub issues](https://github.com/makenotion/notion-cookbook/tree/main/examples/notion-github-sync)
>
> This Notion connection 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.

> [card] [Send an email from a Notion trigger](https://github.com/makenotion/notion-cookbook/tree/main/examples/database-email-update)
>
> This Notion connection 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 connection sends emails using SendGrid's API.

> [card] [Sync Notion with GitHub PRs](https://github.com/makenotion/notion-cookbook/tree/main/examples/notion-task-github-pr-sync)
>
> This Notion connection updates Notion tasks when a linked Github PR is closed/merged. This connection requires the Notion task link be mentioned in the PR description.
