Notion to Markdown
API Reference
Notion to Markdown
Convert Notion page content to Markdown format
POST
Notion to Markdown
Overview
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.Supported Block Types
The converter supports a comprehensive set of Notion block types:Text Blocks
- Paragraphs: Standard text blocks
- Headings: H1, H2, H3 (converted to
#,##,###) - Quotes: Blockquote blocks
- Callouts: Notion callouts (converted to GFM-style alerts when possible)
- Code Blocks: With language syntax support
Lists
- Bulleted Lists: Converted to
-items - Numbered Lists: Converted to
1.items - To-do Lists: Converted to
- [ ]or- [x]checkboxes - Nested Lists: Full nesting support
Media & Embeds
- Images: Converted to
format - External Images: Both uploaded and external images supported
Advanced Blocks
- Tables: Full table support with headers
- Dividers: Converted to
--- - Child Pages: Referenced in the output
- Child Databases: Referenced in the output
Text Formatting & Colors
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
red,blue,green,yellow,orange,purple,pink,gray,brown
- 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
- Background colors (e.g.,
red_background) are not currently supported - Colors are exported as HTML, which requires the Markdown renderer to support inline HTML
Request
Your Mark2Notion API key
Your Notion integration token. Optional when your workspace is connected via OAuth in the dashboard. Pass this if you prefer to authenticate with a manual integration token instead. See Using a Manual Notion Token.
The URL or page ID of the Notion page to convert. Pass the full
notion.so page URL or just the page ID — both are accepted.Response
Will be “success” for successful requests
Examples
Error Responses
Handle Errors
Understand error responses and how to handle them.
Common Errors
Invalid Notion Token
Invalid Notion Token
Status Code: 401 UnauthorizedThe Notion token provided is invalid or expired. Make sure you’re using a valid integration token.
Page Not Found
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
Access Denied
Status Code: 403 ForbiddenYour Notion integration doesn’t have permission to access this page. Share the page with your integration in Notion.
Response Structure
Themarkdown 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
- Access the main content via
data.markdown.parent - Iterate over child pages if they exist
- Maintain the hierarchy of your Notion page structure
Usage Notes
Each notion-to-markdown request counts as 1 API call against your quota, regardless of the page size or number of child pages.
Setup Guide
Connect your Notion workspace in the dashboard via OAuth. Then pass your target page as a URL or page ID in thepageId field — no manual integration tokens required.
Use Cases
- Content Backup: Export Notion pages to Markdown for backup purposes
- Static Site Generation: Convert Notion content to Markdown for static site generators
- Documentation Sync: Keep documentation in Notion and export to Markdown-based systems
- Content Migration: Move content from Notion to other platforms
- Version Control: Track Notion content changes in Git using Markdown format