Skip to content

Get all pages title and url with Notion API


To generate sitemap.xml for a Notion based website, you need list of all shared with integration pages and urls are needed.


Notion is a popular productivity tool that allows organizations and individuals to create and organize notes, databases, and projects. With the Notion API, developers can build custom integrations to automate workflows, extract data, and interact with Notion programmatically. In this blog post, we will explore how to use the Notion API to get all the pages’ titles and URLs in a Notion database.

Getting Started

Before we dive into the code, you need to set up a few things:

  1. Create a Notion account and sign in.
  2. Create a database and add some pages to it.
  3. Enable the Notion API and get an integration token.

Get all pages title and url in Notion API

curl -s -X POST '' \
  -H 'Authorization: Bearer '"$NOTION_API_KEY"'' \
  -H 'Content-Type: application/json' \
  -H 'Notion-Version: 2022-06-28' \
  --data '{
    "filter": {
        "value": "page",
        "property": "object"


Leave your message