我可以使用 notion api 获取 notion 页面内容吗?

Yeu*_*mmy 7 notion-api notion

我计划使用 notion api 制作一些博客。

我想使用 notion api 将 notion 页面降价并显示在我的博客上。

但是,我找不到获取页面内容..

有没有办法使用api导入页面markdown内容?

Ily*_*ski 6

您需要使用 Notion 的 Blocks API。将页面视为一个块,并获取其子级:

curl 'https://api.notion.com/v1/blocks/<your-page-id>/children?page_size=100' \
  -H 'Authorization: Bearer '"$NOTION_API_KEY"'' \
  -H "Notion-Version: 2022-02-22"
Run Code Online (Sandbox Code Playgroud)

请记住,内容将以文本片段的形式出现,您需要将它们拼接在一起。