1

According to the Notion Public API official documentation, I can retrieve a notion page. But this Page Object does not include the Icon of the page. The icon is usually a unicode character (like \u2708\ufe0f for ✈️). I was used to get this information with notion-py (the unofficial notion api client for python).

How can I retrieve this information with the public API?

nilleb
  • 967
  • 6
  • 28

2 Answers2

3

This looks to be possible now, as described in a blog post, https://developers.notion.com/changelog/page-icons-cover-images-new-block-types-and-improved-page-file-properties

Page Icons and Cover Images

When fetching a Page object or a Database object, the response will now include an icon and cover property, as shown below:

{
    "object": "database",
    "id": "96433ad8-3fbe-460f-a007-72311c4aa804",
    "cover": {
        "type": "external",
        "external": {
            "url": "https://website.domain/images/image.png"
        }
    },
    "icon": {
        "type": "emoji",
        "emoji": ""
    },
    // ... remaining properties
}
Cobertos
  • 1,953
  • 24
  • 43
  • 2
    Yes, it's possible now. Just note that the URL for the image has an expiry from the time that it was generated in your api request to get the url. – Peet Oct 06 '21 at 15:57
  • I have built a simple data extractor using the official API that used to work beautifully, exactly as @Peet described above. However, as of recent (tried today), the icon property is now not accessible anymore, see [issue](https://github.com/makenotion/notion-sdk-js/issues/213). Anybody knows if the API is being updated? This was also validated Postman. The API calls I tried include [Page](https://developers.notion.com/reference/retrieve-a-page), [Page Prop](https://developers.notion.com/reference/retrieve-a-page), and [DB](https://developers.notion.com/reference/retrieve-a-database). – Janos Oct 12 '21 at 04:30
  • @Janos sounds like they broke it... I'm using the same library for notion_export_enhancer to get the emoji icon – Cobertos Oct 12 '21 at 05:44
  • 1
    @Coburn, the [bug](https://github.com/makenotion/notion-sdk-js/issues/213) is now resolved! :) – Janos Oct 12 '21 at 21:53
2

In the current version of the API (Notion-Version: 2021-05-13) this is not supported. The page object does not have a page icon or banner image field. This may come in future iterations of the API as it is still in public beta.

adlopez15
  • 3,449
  • 2
  • 14
  • 19