Skip to content
notionsolutions

A practical library for building,
organizing and working in Notion.

Workflow guides

Get a Notion Page’s Content Through the API: Markdown or Nested Blocks

A page object holds metadata. Choose Markdown v2 for text or nested blocks for structure, then record gaps, references and pagination before calling the read complete.

Published
Layered paper pages with a blue divider beneath a glass sheet beside the headline Page Content.

Use GET /v1/pages/{page_id}/markdown?markdown_version=v2 for text-oriented content, or GET /v1/blocks/{page_id}/children for structured blocks. The block route needs pagination for each parent and recursion into nested children. I'd choose Markdown for summarizing a page and blocks when IDs, types and nesting matter; check for missing or inaccessible content on either route.

Choose the representation before making the request

Retrieve a page returns its metadata and properties, rather than the body. Similarly, Search by title finds accessible pages and data sources; finding a page isn't the same as reading its contents.

Start with a known page ID and a connection authorized to read the intended content. Preserve the API's record IDs instead of parsing returned human-facing URLs. The examples use Notion-Version: 2026-12-01; a Notion-Version header is required on REST requests. The connection and page-creation guide covers onboarding if you still need to arrange access.

ChooseUse it forCheck afterward
Markdown v2A text-oriented representation without writing a block-to-text converter.truncated, unknown_block_ids, placeholders and reference-only content.
Block childrenBlock IDs, types, rich text and explicit control over the nested structure.Every parent's cursor chain, nested has_children branches and special references.
Markdown request configuration with markdown_version set to v2 and include_transcript set to false.
Select v2 explicitly. Leave include_transcript false unless the transcript belongs in the requested output.

Read Markdown with v2 selected explicitly

Use the Retrieve page as Markdown endpoint with markdown_version=v2. The December API version defaults to v2 and rejects v1. Keep markdown_version=v2 explicit if the same request also runs on the March version, whose default is v1.

GET https://api.notion.com/v1/pages/{page_id}/markdown?markdown_version=v2
Authorization: Bearer {NOTION_TOKEN}
Notion-Version: 2026-12-01

Replace the placeholders with your authorized token and page ID. For meeting transcripts that belong in the output, add include_transcript=true. That option defaults to false; v2 places an included transcript inside meeting-notes-section-transcript.

The response is a page_markdown object. Inspect these content and completeness fields together:

Very large pages can encounter a record limit of approximately 20,000 blocks. A child page or other content not shared with the connection can also produce missing content. The unknown-ID array doesn't tell you which cause applies.

For each new unknown ID, you can try the same Markdown endpoint with that ID in the {page_id} position. Truncated content may return as a subtree; an inaccessible ID returns object_not_found. Keep the ID, original location and result together. I'd retain recovered subtrees with their provenance until their placement is resolved, because blindly appending them can duplicate content or change its order.

Track attempted IDs and stop retrying an inaccessible or non-progressing branch. The response schema limits unknown_block_ids to 100 entries; the documented contract doesn't explain recovery when more affected IDs exist. Inspect the Markdown placeholders as well, and keep the read marked incomplete when gaps remain. A false truncation flag alone doesn't establish faithful rendering of every block.

Block children request with an empty start_cursor field and page_size set to 100.
Start without a cursor. On later requests, pass next_cursor as start_cursor for the same parent; page_size=100 is a limit, not a completion signal.

Paginate each parent, then retrieve its nested children

Retrieve block children returns only the immediate children of a page or block. Start with the page ID:

GET https://api.notion.com/v1/blocks/{page_id}/children?page_size=100
Authorization: Bearer {NOTION_TOKEN}
Notion-Version: 2026-12-01

Use has_more to decide whether another response is needed. Pass next_cursor back unchanged as start_cursor for the same parent; omit it initially. A short result page doesn't mean the list is finished. Cursors are opaque: encode them as query-parameter values without parsing or validating their format.

For each ordinary block with has_children=true, repeat the process with that block's ID. Each child starts its own cursor chain. This pseudocode describes the traversal; get_children means the HTTP endpoint above, and budget is your shared request limit for the read:

walk(parent_id, ancestors, budget):
    output = []
    if parent_id in ancestors:
        record_gap(parent_id, "cycle")
        return output
    path = ancestors + [parent_id]
    cursor = absent
    seen_cursors = set()

    repeat:
        if budget.remaining_requests == 0:
            record_gap(parent_id, "request budget exhausted")
            return output
        budget.remaining_requests -= 1
        page = get_children(parent_id, page_size=100,
                            start_cursor=cursor)  # omit when absent
        if page is an error:
            record_gap(parent_id, page.error)
            return output

        for block in page.results:
            node = {raw_block: block, children: []}
            if block.type == "synced_block" and
               block.synced_block.synced_from != null:
                record_reference(parent_id, block)
            else if block.has_children:
                node.children = walk(block.id, path, budget)
            output.append(node)

        if page.has_more == false:
            return output
        if page.next_cursor == null or
           page.next_cursor in seen_cursors:
            record_gap(parent_id, "cursor did not advance")
            return output
        seen_cursors.add(page.next_cursor)
        cursor = page.next_cursor

Keep the raw block and its parent/path so the output retains structure and provenance. The loop preserves ordinary child-list order, records incomplete branches and leaves duplicate synced blocks as references. Apply the special-content rules below separately. For large or deep pages, use a job queue or another bounded traversal design instead of relying on unlimited recursive calls.

When extracting text from supported rich-text values, plain_text gives the unformatted string. Preserve the rich-text objects too if links, mentions or styling matter. Joining only strings discards that structure.

Handle references and unsupported content explicitly

Encountered contentWhat to retain or retrieve
Child pageA child_page block is a reference without children in the containing response. Decide whether subpages belong in the task, then retrieve an included child page separately with its own access and coverage checks.
Synced blockOriginals have synced_from=null; duplicates point to the original block ID. Retain the reference and location. The documented reference shape doesn't settle duplicate-child fallback behavior, so don't silently replace it with a guessed traversal.
Meeting notesThe metadata container points to summary_block_id, notes_block_id and transcript_block_id. If those sections are in scope, wait for notes_ready, then read each section's children with pagination. Record pending or inaccessible sections.
Unsupported blockA type=unsupported placeholder doesn't expose its content. Keep the ID and informational block_type; accept new string values rather than enforcing a fixed enum.
Markdown custom blockReadback returns a definition reference, not rendered contents. Instances with binding overrides still appear as unknown. Retain that distinction in the output.

Markdown unknown tags and API unsupported-block placeholders are different signals. The block route can expose supported structure that a text representation doesn't preserve; it can't reveal content absent from an unsupported placeholder. Avoid deciding that a whole Markdown version excludes a block type from a generic example list. Inspect the returned representation.

Keep a coverage record beside the content

I'd store a small record alongside either output:

Notion-hosted file objects provide temporary URLs valid for one hour; re-fetch the object to refresh access. Markdown file links are also temporary. Refresh links near use, and treat retained text separately from saved file contents.

Keep property-value completeness separate too. If you also need full relations, people or inline references from the page object, use the property-item endpoint's pagination. Finishing block pagination doesn't finish those property reads.

Call the result complete only for the declared scope and representation once its pending work and gaps are resolved. A text extraction or completed cursor walk doesn't establish a restorable backup or a single consistent snapshot while the page is being edited.

Read content checked while Update content and Insert content are unchecked.
Read content permits a read operation. The connection still needs access to the page; a capability alone does not share it.

Treat access errors and throttling as unfinished work

The read routes require Read content capability. A missing capability returns 403; 404 can mean a missing object or missing access. Check the connection's intended access instead of treating either response as an empty page.

For 429 and 529, respect Retry-After in seconds, which can exceed one minute. Use bounded retries with backoff and jitter, preserving the parent ID and cursor so a delayed request doesn't restart the wrong branch. Don't retry public_api_request_blocked; the documented next step is to contact Notion support.