Receiving Responses
This page outlines the structure of the API response you’ll receive from LoaderPage.
Summary
- The API response is a JSON object representing the requested Notion content.
- Key components of the response include:
- Basic metadata (type, id, url, title, timestamps)
- Content in HTML and/or Markdown format
- Parent information
- Children (child pages, child databases or database rows)
- The depth field indicates the current nesting level of the object
- The
depth
query parameter controls the inclusion of children and nested content. - The
content_format
parameter determines whether HTML, Markdown, or both formats are included. - Database rows are represented as children of the database object
Response Structure Overview
For successful requests, the API returns a JSON object representing the requested Notion content:
{ "type": "page|database|database_row", "id": "unique_identifier", "url": "https://notion.so/page_or_database_url", "title": "Page or Database Title", "last_modified": "2024-09-25T12:00:00Z", "conversion_timestamp": "2024-09-25T12:30:00Z", "parent": { "type": "parent_type", "parent_id": "parent_id" }, "depth": 2, "content": { "markdown": "<!-- Markdown content goes here -->", "html": "<!-- HTML equivalent of the markdown content -->" }, "children": [ // Child objects (child pages, child databases, or database rows) go here ]}
Key Components Explained
Basic Metadata
type
: Either “page”, “database”, or “database_row”. See Notion docs for what a page and what a database is
id
: Notion’s unique identifier for the object
url
: The Notion URL associated with the page or database
title
: The title of the page or database
last_modified
: Timestamp indicating when the object was last modified on Notion
conversion_timestamp
: Timestamp when the Notion object was converted to JSON by LoaderPage
Parent Information
The parent
field provides details about the parent object:
- For child Notion objects, it includes the
id
of the parent.
"parent": { "type": "page_id", // or database_id. NOTE that a database_row parent is of type "page_id" "parent_id": "105a7f30-3194-8040-9b3d-d97e08c6bc2a" // Parent's Notion id }
- For top-level objects, the parent is the Notion workspace. There is no parent_id for workspaces.
"parent": { "type": "workspace", "parent_id": "" }
Depth
The depth
field indicates the object’s nesting level relative to the root object in the API request.
It helps visualize the content hierarchy:
- Root object: depth = 0
- Direct children: depth = 1
- Grandchildren: depth = 2
- And so on…
Content
The content
field contains the object’s content in HTML and/or Markdown format:
- For
page
type: The main page content. - For
database
type: A table representing all rows’ cell data. - For
database_row
type:- A table with the row’s cell data.
- Any additional page content associated with the row (if present).
Format determined by the content_format
query parameter:
both
(default): Includes HTML and Markdownhtml
: Only HTMLmarkdown
: Only Markdown
Children
The children
field contains a list of child elements (pages, databases, or database rows). Each child follows the same response structure, enabling nested content representation.
For databases, the children
array includes database_row
type objects which contain both the row’s data and any associated page content.
The depth of nested children is controlled by the depth query parameter in the API request.
Query Parameters
depth
: Controls the inclusion of children
depth=0
(default): No childrendepth=1
: Immediate children onlydepth=n
: Children up to n levels deep
content_format
: Determines the format of content
both
(default): Includes HTML and Markdownhtml
: Only HTMLmarkdown
: Only Markdown