• Stars
    star
    339
  • Rank 124,632 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿงช Reverse-engineered Notion API.

Potion

Potion is a reverse-engineered API for Notion. Write your content in Notion, and use Potion's hosted API endpoints to read your content.

I no longer maintain Potion, since the official Notion API has been released and is more stable than Notionโ€™s internal API, which Potion relies on.

Guides

I've written a couple of blog posts on my website for using this API.

Endpoints

All endpoints are relative to the base URL: https://potion-api.now.sh

Responses are cached for 10 seconds, so it'll take up to 10 seconds for changes made in Notion to show up.

<notion-page-id> refers to the 32 character alphanumeric string in the URL of a Notion doc (but not a query parameter, so not the string after ?v=).

/table

Lists all entries in a full-page Notion table, along with additional details about each page.

The only query parameter is ?id=<notion-page-id>.

/table-description

Generates HTML for the description of a table.

The only query parameter is ?id=<notion-page-id>.

/html

Generates HTML for a given Notion page. You can insert it as the contents of a blog post, for example.

The only query parameter is ?id=<notion-page-id>, which can be obtained from the /table endpoint or just by copy-and-pasting from the URL.

Syntax Highlighting

Potion gives you syntax highlighting of Notion code blocks for free, when using the /html endpoint!

How to use syntax highlighting

You'll notice that the code block HTML that Potion returns is given CSS classes that make it compatible with Prism.js.

  1. Pick a theme you like from this README.
  2. Select the CSS file for that theme from this list and click View Raw.
  3. Include that stylesheet in the head of your HTML page to activate syntax highlighting. For example:
<link rel="stylesheet" href="https://unpkg.com/[email protected]/themes/prism-ghcolors.css" />

Language support

Potion supports syntax highlighting for most popular languages, and you can open an issue if you'd like to see a language supported that isn't currently.

Limitations

Most, but not all, of the common Notion blocks are supported at the moment:

  • Text
  • To-do List
  • Heading 1
  • Heading 2
  • Heading 3
  • Bulleted List
  • Numbered List
  • Toggle List
  • Quote
  • Divider
  • Link to Page
  • Callout
  • Image
  • Embed
  • Web Bookmark
  • Video
  • Audio
  • Code
  • File
  • Math Equation
  • Inline Equation

Development and Deployment

This project is built to be deployed on Vercel.

For local development, install Vercel's CLI and run vercel dev.

More Repositories

1

opensheet

๐Ÿ’พ An API to get a Google Sheet as JSON, no authentication required.
JavaScript
604
star
2

emojicdn

๐Ÿฅณ A fast, global content delivery network for emojis.
Ruby
141
star
3

driver

๐ŸŽ A quick and simple API for reading Google Drive and Google Docs.
JavaScript
12
star
4

glitch-proxy

๐Ÿ•ณ Proxy server for Glitch.
11
star
5

ben.page

๐Ÿ™ My personal website!
Astro
10
star
6

notion-api

๐Ÿช„ Notion API client for Node.js
JavaScript
8
star
7

stickies

๐Ÿ“’ Note-taking app built around a board of virtual sticky notes.
TypeScript
6
star
8

figure

๐Ÿ–ผ An asset pipeline for using your Figma files.
JavaScript
3
star
9

swipes

๐ŸŒฏ I want to use all of my meal swipes.
TypeScript
3
star
10

progress

๐Ÿ•ฐ Keeping track of progress towards the end of the school year.
JavaScript
3
star
11

ap-chem

๐Ÿงช Summaries for AP Chemistry units.
JavaScript
2
star
12

callout

๐Ÿ’ก A wrapper around the Notion API.
TypeScript
2
star
13

borg-image

๐Ÿ–ผ Microservice that generates og:images for my sites.
JavaScript
2
star
14

big-bang

๐Ÿช Final project for Big Bang to Humankind, Fall 2022.
Astro
2
star
15

nota-viewer

๐Ÿ“ƒ Website that publishes my notes from Nota.
TypeScript
2
star
16

ben.cv-craft

๐Ÿ™ Bits of writing
TypeScript
2
star
17

ben.cv-ghost

๐Ÿ™ Ghost theme for ben.cv
Handlebars
2
star
18

photos

๐Ÿ™ Photo of the Day website
PHP
2
star
19

brain

๐Ÿง  Notes on notecards.
PHP
1
star
20

henrynitzberg

Website for Henry Nitzberg.
TypeScript
1
star
21

media-literacy

Final project for Children & Mass Media, Fall 2022.
Astro
1
star
22

1984

๐Ÿ“บ 1984 Final Assignment for Dystopias class
JavaScript
1
star
23

tiny-notion-api

A small HTTP wrapper around the Notion API.
TypeScript
1
star
24

brain2

๐Ÿง  Notes on notecards.
TypeScript
1
star
25

slowmochristian

๐Ÿข Fun site for @slowmochristian.
JavaScript
1
star
26

build-button

๐Ÿ”ด A simple utility that creates a user-friendly link for building a Netlify site.
HTML
1
star