Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asnunes/notion-page-to-html-api
Vercel API wrapper to notion-page-to-html library
https://github.com/asnunes/notion-page-to-html-api
Last synced: 9 days ago
JSON representation
Vercel API wrapper to notion-page-to-html library
- Host: GitHub
- URL: https://github.com/asnunes/notion-page-to-html-api
- Owner: asnunes
- License: mit
- Created: 2020-11-01T23:22:23.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-11-11T20:43:58.000Z (almost 1 year ago)
- Last Synced: 2024-10-26T15:46:54.664Z (15 days ago)
- Language: TypeScript
- Homepage: notion-page-to-html-api.vercel.app
- Size: 67.4 KB
- Stars: 68
- Watchers: 4
- Forks: 15
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Cover image](_docs/cover.png)
# notion-page-to-html-api
Vercel API wrapper to [notion-page-to-html library](https://github.com/asnunes/notion-page-to-html). It converts public notion pages to html.
## Supported features
Most of native Notion blocks are currently supported:
- Headings
- Text With Decorations
- Quote
- Image
- YouTube Videos
- Code
- Math Equations
- To-do
- Checkbox
- Bulleted Lists
- Numbered Lists
- Toggle Lists
- Divider
- Callout
- Nested blocksEmbeds and tables are not supported yet.
## Basic Usage
### GET `/html`
Returns full Notion page as html.
It accepts one single query param: `id`. It's the Notion Page uuid at the end of page's link like example bellow
`https://www.notion.so/asnunes/Simple-Page-Text-2-`**4d64bbc0634d4758befa85c5a3a6c22f**
Page must be public when request is sent. It can be private afterward. All images dependencies are converted to base64 to prevent further Notion API calls.
API call example:
[https://notion-page-to-html-api.vercel.app/html?id=4d64bbc0634d4758befa85c5a3a6c22f](https://notion-page-to-html-api.vercel.app/html?id=4d64bbc0634d4758befa85c5a3a6c22f)
### GET `/cover`
Returns Notion page cover image if it exists. If no cover is found, it returns 404.
It accepts one single query param: `id`. It's exactly like `/html` route.
API call example:
[https://notion-page-to-html-api.vercel.app/cover?id=4d64bbc0634d4758befa85c5a3a6c22f](https://notion-page-to-html-api.vercel.app/cover?id=4d64bbc0634d4758befa85c5a3a6c22f)
### GET `/icon`
Returns Notion page icon if it exists. It can be an image (custom icon) or plain/text (emoji). If no icon is found, it returns 404.
It accepts one single query param: `id`. It's exactly like `/html` route.
API call example:
[https://notion-page-to-html-api.vercel.app/icon?id=4d64bbc0634d4758befa85c5a3a6c22f](https://notion-page-to-html-api.vercel.app/icon?id=4d64bbc0634d4758befa85c5a3a6c22f)
### GET `/title`
Returns Notion page title as plain text.
It accepts one single query param: `id`. It's exactly like `/html` route.
API call example:
[https://notion-page-to-html-api.vercel.app/title?id=4d64bbc0634d4758befa85c5a3a6c22f](https://notion-page-to-html-api.vercel.app/title?id=4d64bbc0634d4758befa85c5a3a6c22f)
This project was deployed on [Vercel](https://vercel.com/). Feel free to host it by yourself if it pleases you.