I wanted to use Notion as a CMS for this Blog, so i searched for a way to implement this. Currently there is no official public API for Notion, so I had to search for an unofficial way.
Luckily, someone else already built Potion, an unofficial Notion API which gives you the content of your notion pages.
All I had to do now was to create a Table in Notion:
Each entry in this table represents a blog post. Each entry is also a normal Notion page which you can edit.
To retrieve the data of all pages I had to pass in the page-id of the table to the /table/:id endpoint of Potion. You can find the page-id in the Share Menu as shown below:
This gives you the page-id and other properties available in the table.
To get the html of the blog posts (pages inside of the table), all you have to do now is to pass a page-id to the `html/:page-id` endpoint of Potion.
You can use the html to inject it directly into your website. If you have a React Application for example, you could use dangerouslySetInnerHTML to use the html coming from Potion.