{ "status": "success", "data": { "markdown": { "parent": "# My Page Title\n\nThis is a paragraph with **bold** text and *italic* text.\n\n## Subheading\n\n- List item 1\n- List item 2\n - Nested item\n\n---\n\n```javascript\nconsole.log('Code block');\n```\n\n> This is a quote block\n\n| Column 1 | Column 2 |\n|----------|----------|\n| Cell 1 | Cell 2 |" }, "pageId": "abc123def456" }}
{ "status": "success", "data": { "markdown": { "parent": "# My Page Title\n\nThis is a paragraph with **bold** text and *italic* text.\n\n## Subheading\n\n- List item 1\n- List item 2\n - Nested item\n\n---\n\n```javascript\nconsole.log('Code block');\n```\n\n> This is a quote block\n\n| Column 1 | Column 2 |\n|----------|----------|\n| Cell 1 | Cell 2 |" }, "pageId": "abc123def456" }}
The notion-to-markdown endpoint retrieves content from a Notion page and converts it to Markdown format. This is useful for exporting Notion content, creating backups, or integrating Notion content with other Markdown-based systems.
All rich text formatting from Notion is preserved in the Markdown output:
Bold: Converted to **bold**
Italic: Converted to *italic*
Code: Converted to `code`
Strikethrough: Converted to ~~strikethrough~~
Links: Converted to [text](url)
Colors: Converted to HTML <span> tags with inline styles
Color Support:Notion text colors are converted to HTML spans with inline CSS styles. This allows the colors to be preserved when the Markdown is rendered in systems that support HTML.Supported Colors:
red, blue, green, yellow, orange, purple, pink, gray, brown
Example:
Copy
This is <span style="color: red">red text</span> and <span style="color: blue">blue text</span>.
Features:
Works with all block types (paragraphs, headings, lists, quotes, etc.)
Can be combined with other formatting (bold, italic, code, etc.)
Multiple colors can be used within a single block
Limitations:
Background colors (e.g., red_background) are not currently supported
Colors are exported as HTML, which requires the Markdown renderer to support inline HTML
If the page has child pages, each child page will be included as a separate property with the child page title as the key and its Markdown content as the value
{ "status": "success", "data": { "markdown": { "parent": "# My Page Title\n\nThis is a paragraph with **bold** text and *italic* text.\n\n## Subheading\n\n- List item 1\n- List item 2\n - Nested item\n\n---\n\n```javascript\nconsole.log('Code block');\n```\n\n> This is a quote block\n\n| Column 1 | Column 2 |\n|----------|----------|\n| Cell 1 | Cell 2 |" }, "pageId": "abc123def456" }}
Status Code: 401 UnauthorizedThe Notion token provided is invalid or expired. Make sure you’re using a valid integration token.
Page Not Found
Status Code: 404 Not FoundThe page ID doesn’t exist or your integration doesn’t have access to it. Verify the page ID and ensure the page is shared with your integration.
Access Denied
Status Code: 403 ForbiddenYour Notion integration doesn’t have permission to access this page. Share the page with your integration in Notion.
The markdown field in the response is an object that separates parent and child page content:
parent: Contains the main page’s Markdown content
[Child Page Title]: If the page has child pages, each will be a separate property named after the child page title, containing that child’s Markdown content
This structure allows you to:
Access the main content via data.markdown.parent
Iterate over child pages if they exist
Maintain the hierarchy of your Notion page structure