splitbee / notion-api-worker

Notion as CMS with easy API access
MIT License
1.56k stars 197 forks source link
api cloudflare-workers cms notion

Notion API Worker API Version

A serverless wrapper for the private Notion API. It provides fast and easy access to your Notion content. Ideal to make Notion your CMS.

We provide a hosted version of this project on https://notion-api.splitbee.io. You can also host it yourself. Cloudflare offers a generous free plan with up to 100,000 request per day.

Use with caution. This is based on the private Notion API. We can not gurantee it will stay stable.

Features

🍭 Easy to use – Receive Notion data with a single GET request

🗄 Table Access – Get structured data from tables & databases

Blazing Fast – Built-in SWR caching for instant results

🛫 CORS Friendly – Access your data where you need it

Use Cases

Endpoints

Load page data

/v1/page/<PAGE_ID>

Example (Source Notion Page)

https://notion-api.splitbee.io/v1/page/2e22de6b770e4166be301490f6ffd420

Returns all block data for a given page. For example, you can render this data with react-notion.

Load data from table

/v1/table/<PAGE_ID>

Example (Source Notion Page)

https://notion-api.splitbee.io/v1/table/20720198ca7a4e1b92af0a007d3b45a4

Authentication for private pages

All public pages can be accessed without authorization. If you want to fetch private pages there are two options.

Receiving the token

To obtain your token, login to Notion and open your DevTools and find your cookies. There should be a cookie called token_v2, which is used for the authorization.

Credits