npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

notion-api-worker

v0.1.0

Published

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

Downloads

326

Readme

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