You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Are there plans to add a renderer for the official Notion API? #83
Use with caution. This is based on the private Notion API. We can not guarantee it will stay stable.
But notion-api-worker has more feature support than the official API (though perhaps more features will be launched in the future).
So should we continue using the potentially unstable Notion API which has more features?
Or switch to the official API which has fewer features but is (potentially) more stable?
My current thought is we continue using notion-api-worker until the official Notion API has more features or if Notion decided to make it harder to use their private API.
Reacted by kitze 🚀, Nicola Toledo, Shirish Veerabattini, Pooya Jaferian, Yehezkiel Gunawan, Rajeev Singh Naruka, Batandwa Mgutsi, Jean, Lucas, y.takahashi and 11 more
We also had the same issue. We instead built our own wrapper on top of the Official Notion API. Unlike react-notion, however, it transforms Notion pages to Markdown and also fetches the page media to be served with our static assets. We then run the docusaurus static site generator to render our website.
Looks like the time has come for this – would love to depend on the more stable Notion API. Notion added a lot of the missing blocks in the recent month to their API. We will start to explore this topic.
Reacted by y.takahashi, Yassine Bridi, Batandwa Mgutsi, Tobias Lins, Safi Nettah and 大木火
Reacted by Batandwa Mgutsi, Tobias Lins, Moritz Meyer, Vishwasraj, Filipe Medeiros and 大木火
We already found something in the official API that doesn't allow us to port react-notion as it is now.
The notion.blocks.children.list call doesn't return all blocks needed to render a page. We would need to fetch recursively which could potentially fail due the rate limits of Notion.
For example: A page that has 2 columns with content in it.
notion.blocks.children.list returns one column_list block.
We need to run the same request again for the column_list id. We now get 2 column blocks (again without content).
After that we will need to fetch all children for those blocks again to receive the content.
This means: 4 requests to Notion API for a single multi column page.
We try to reach out to the Notion team to talk about this. It would be great if they could allow us to fetch all blocks recursively within one request.
notion-compat may be useful here. It provides a best-effort conversion from Notion's official API to their unofficial API, which react-notion and react-notion-x both use.
As Tobias mentioned, the performance is quite poor, though. I also tried to give a concrete, block-by-block comparison to show where the official API is missing information that would be necessary to render notion content faithfully.
Activity
kitze commentedon Sep 22, 2021
Also interested in this.
bats64mgutsi commentedon Dec 11, 2021
We also had the same issue. We instead built our own wrapper on top of the Official Notion API. Unlike react-notion, however, it transforms Notion pages to Markdown and also fetches the page media to be served with our static assets. We then run the docusaurus static site generator to render our website.
timolins commentedon Dec 16, 2021
Looks like the time has come for this – would love to depend on the more stable Notion API. Notion added a lot of the missing blocks in the recent month to their API. We will start to explore this topic.
tobiaslins commentedon Dec 19, 2021
We already found something in the official API that doesn't allow us to port react-notion as it is now.
The
notion.blocks.children.listcall doesn't return all blocks needed to render a page. We would need to fetch recursively which could potentially fail due the rate limits of Notion.For example:
A page that has 2 columns with content in it.
notion.blocks.children.listreturns onecolumn_listblock.columnblocks (again without content).This means: 4 requests to Notion API for a single multi column page.
We try to reach out to the Notion team to talk about this. It would be great if they could allow us to fetch all blocks recursively within one request.
pgerlich commentedon Apr 22, 2022
Any updates on this? Is there any planned action to support the official Notion API given those limitations?
transitive-bullshit commentedon Apr 22, 2022
notion-compat may be useful here. It provides a best-effort conversion from Notion's official API to their unofficial API, which react-notion and react-notion-x both use.
As Tobias mentioned, the performance is quite poor, though. I also tried to give a concrete, block-by-block comparison to show where the official API is missing information that would be necessary to render notion content faithfully.
pgerlich commentedon Apr 23, 2022
Ooh thanks for pointing that out.. I'll check it out.