Giter Club home page Giter Club logo

notion-api-worker's Introduction

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

  • Use it as data-source for blogs and documentation. Create a table with pages and additional metadata. Query the /table endpoints everytime you want to render a list of all pages.

  • Get data of specific pages, which can be rendered with react-notion

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.

  • The recommended way is to host your own worker with the NOTION_TOKEN environment variable set. You can find more information in the Cloudflare Workers documentation.
  • Alternatively you can set the Authorization: Bearer <NOTION_TOKEN> header to authorize your requests.

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

notion-api-worker's People

Contributors

tobiaslins avatar timolins avatar transitive-bullshit avatar dependabot[bot] avatar janniks avatar pbteja1998 avatar dvdsgl avatar zephraph avatar seungminio avatar chromakode avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.