{ "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": "# Main Page\n\nThis is the parent page content.\n\n> 📘 Note\n> This is a callout\n", "Child Page 1": "## Child Page Content\n\nThis is content from the first child page.\n", "Another Child": "## Another Child Page\n\nContent from another child page.\n" }, "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" }}
{ "status": "success", "data": { "markdown": { "parent": "# Main Page\n\nThis is the parent page content.\n\n> 📘 Note\n> This is a callout\n", "Child Page 1": "## Child Page Content\n\nThis is content from the first child page.\n", "Another Child": "## Another Child Page\n\nContent from another child page.\n" }, "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:
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
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.
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
const response = await fetch('https://api.mark2notion.com/api/notion-to-markdown', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': 'YOUR_API_KEY' }, body: JSON.stringify({ pageId: 'https://notion.so/Your-Page-Title-abc123def456' })});const data = await response.json();console.log(data.data.markdown.parent); // Parent page content// If there are child pages, they'll be available as separate properties:// console.log(data.data.markdown['Child Page Name']);
import requestsresponse = requests.post( 'https://api.mark2notion.com/api/notion-to-markdown', headers={ 'Content-Type': 'application/json', 'x-api-key': 'YOUR_API_KEY' }, json={ 'pageId': 'https://notion.so/Your-Page-Title-abc123def456' })data = response.json()print(data['data']['markdown']['parent']) # Parent page content# If there are child pages, they'll be available as separate keys:# print(data['data']['markdown']['Child Page Name'])
{ "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": "# Main Page\n\nThis is the parent page content.\n\n> 📘 Note\n> This is a callout\n", "Child Page 1": "## Child Page Content\n\nThis is content from the first child page.\n", "Another Child": "## Another Child Page\n\nContent from another child page.\n" }, "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
Connect your Notion workspace in the dashboard via OAuth. Then pass your target page as a URL or page ID in the pageId field — no manual integration tokens required.
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
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"mark2notion API","colors":{"primary":"#0F172A","light":"#1E293B","dark":"#0F172A"},"favicon":"/favicon.svg","footer":{"socials":{"github":"https://github.com/elitemaks/mark2notion-api"}},"seo":{"metatags":{"canonical":"https://docs.mark2notion.com"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"mark2notion","hasAudioNarration":false,"actualSubdomain":"mark2notion","customDomains":["docs.mark2notion.com"],"gitSource":{"type":"github","owner":"elitemaks","repo":"mark2notion-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a21e7a1572b750f6b6fc583","collectionId":"f619945e-729d-497f-a7cc-c50d3c4aa972","schemaVersion":"v2"},"entitlements":{},"buildId":"6a21e7a1572b750f6b6fc583:success","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"default","tag":"API Reference","count":6},{"language":"default","tag":"Getting Started","count":3},{"language":"default","tag":"Support","count":3},{"language":"default","tag":"Legal","count":1}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/notion-to-markdown","slug":"/api-reference/notion-to-markdown","pageMetadata":{"title":"Notion to Markdown","api":"POST https://api.mark2notion.com/api/notion-to-markdown","description":"Convert Notion page content to Markdown format","href":"/api-reference/notion-to-markdown"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Convert Notion page content to Markdown format\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,AccordionGroup,Card,CodeBlock,CodeGroup,Expandable,Heading,Info,ParamField,ResponseField,Tip,Warning}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!AccordionGroup)_missingMdxReference(`AccordionGroup`,true);if(!Card)_missingMdxReference(`Card`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsx(_components.p,{children:`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.`}),`\n`,_jsx(Heading,{level:`2`,id:`supported-block-types`,children:`Supported Block Types`}),`\n`,_jsx(_components.p,{children:`The converter supports a comprehensive set of Notion block types:`}),`\n`,_jsx(Heading,{level:`3`,id:`text-blocks`,children:`Text Blocks`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Paragraphs`}),`: Standard text blocks`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Headings`}),`: H1, H2, H3 (converted to `,_jsx(_components.code,{children:`#`}),`, `,_jsx(_components.code,{children:`##`}),`, `,_jsx(_components.code,{children:`###`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Quotes`}),`: Blockquote blocks`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Callouts`}),`: Notion callouts (converted to GFM-style alerts when possible)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Code Blocks`}),`: With language syntax support`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`lists`,children:`Lists`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Bulleted Lists`}),`: Converted to `,_jsx(_components.code,{children:`-`}),` items`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Numbered Lists`}),`: Converted to `,_jsx(_components.code,{children:`1.`}),` items`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`To-do Lists`}),`: Converted to `,_jsx(_components.code,{children:`- [ ]`}),` or `,_jsx(_components.code,{children:`- [x]`}),` checkboxes`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Nested Lists`}),`: Full nesting support`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`media-\u0026-embeds`,children:`Media \u0026 Embeds`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Images`}),`: Converted to `,_jsx(_components.code,{children:``}),` format`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`External Images`}),`: Both uploaded and external images supported`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`advanced-blocks`,children:`Advanced Blocks`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Tables`}),`: Full table support with headers`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Dividers`}),`: Converted to `,_jsx(_components.code,{children:`---`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Child Pages`}),`: Referenced in the output`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Child Databases`}),`: Referenced in the output`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`text-formatting-\u0026-colors`,children:`Text Formatting \u0026 Colors`}),`\n`,_jsx(_components.p,{children:`All rich text formatting from Notion is preserved in the Markdown output:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Bold`}),`: Converted to `,_jsx(_components.code,{children:`**bold**`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Italic`}),`: Converted to `,_jsx(_components.code,{children:`*italic*`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Code`}),`: Converted to `,_jsx(_components.code,{children:\"`code`\"})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Strikethrough`}),`: Converted to `,_jsx(_components.code,{children:`~~strikethrough~~`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Links`}),`: Converted to `,_jsx(_components.code,{children:`[text](url)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Colors`}),`: Converted to HTML `,_jsx(_components.code,{children:`\u003cspan>`}),` tags with inline styles`]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Color Support:`})}),`\n`,_jsx(_components.p,{children:`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.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Supported Colors:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`red`}),`, `,_jsx(_components.code,{children:`blue`}),`, `,_jsx(_components.code,{children:`green`}),`, `,_jsx(_components.code,{children:`yellow`}),`, `,_jsx(_components.code,{children:`orange`}),`, `,_jsx(_components.code,{children:`purple`}),`, `,_jsx(_components.code,{children:`pink`}),`, `,_jsx(_components.code,{children:`gray`}),`, `,_jsx(_components.code,{children:`brown`})]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Example:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`This is `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`span`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` style`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"color: red\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`red text`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`span`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` and `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`span`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` style`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"color: blue\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`blue text`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`span`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Features:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Works with all block types (paragraphs, headings, lists, quotes, etc.)`}),`\n`,_jsx(_components.li,{children:`Can be combined with other formatting (bold, italic, code, etc.)`}),`\n`,_jsx(_components.li,{children:`Multiple colors can be used within a single block`}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Limitations:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Background colors (e.g., `,_jsx(_components.code,{children:`red_background`}),`) are not currently supported`]}),`\n`,_jsx(_components.li,{children:`Colors are exported as HTML, which requires the Markdown renderer to support inline HTML`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`request`,children:`Request`}),`\n`,_jsx(ParamField,{header:`x-api-key`,type:`string`,required:true,id:`param-x-api-key`,children:_jsx(_components.p,{children:`Your Mark2Notion API key`})}),`\n`,_jsx(ParamField,{body:`notionToken`,type:`string`,id:`param-notion-token`,children:_jsxs(_components.p,{children:[`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 `,_jsx(_components.a,{href:`/quickstart#using-a-manual-notion-token-advanced`,children:`Using a Manual Notion Token`}),`.`]})}),`\n`,_jsx(ParamField,{body:`pageId`,type:`string`,required:true,id:`param-page-id`,children:_jsxs(_components.p,{children:[`The URL or page ID of the Notion page to convert. Pass the full `,_jsx(_components.code,{children:`notion.so`}),` page URL or just the page ID — both are accepted.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status`,children:_jsx(_components.p,{children:`Will be “success” for successful requests`})}),`\n`,_jsx(ResponseField,{name:`data`,type:`object`,id:`param-data`,children:_jsxs(Expandable,{title:`data`,children:[_jsxs(ResponseField,{name:`markdown`,type:`object`,id:`param-markdown`,children:[_jsx(_components.p,{children:`An object containing the Markdown representation of the page content`}),_jsxs(Expandable,{title:`markdown`,children:[_jsx(ResponseField,{name:`parent`,type:`string`,id:`param-parent`,children:_jsx(_components.p,{children:`The Markdown content of the main/parent page`})}),_jsx(ResponseField,{name:`[childPageTitle]`,type:`string`,id:`param-child-page-title`,children:_jsx(_components.p,{children:`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`})})]})]}),_jsx(ResponseField,{name:`pageId`,type:`string`,id:`param-page-id-1`,children:_jsx(_components.p,{children:`The ID of the page that was converted`})})]})}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`curl`,numberOfLines:`6`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.mark2notion.com/api/notion-to-markdown\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-api-key: YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"pageId\": \"https://notion.so/Your-Page-Title-abc123def456\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`15`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'https://api.mark2notion.com/api/notion-to-markdown'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'POST'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'YOUR_API_KEY'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` pageId:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://notion.so/Your-Page-Title-abc123def456'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`markdown`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`parent`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Parent page content`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// If there are child pages, they'll be available as separate properties:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// console.log(data.data.markdown['Child Page Name']);`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`17`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.mark2notion.com/api/notion-to-markdown'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'YOUR_API_KEY'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'pageId'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'https://notion.so/Your-Page-Title-abc123def456'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`data `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(data[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'data'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'markdown'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'parent'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Parent page content`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# If there are child pages, they'll be available as separate keys:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# print(data['data']['markdown']['Child Page Name'])`})}),`\n`]})})})]}),`\n`,`\n`,_jsx(Heading,{level:`2`,id:`error-responses`,children:`Error Responses`}),`\n`,_jsx(Card,{title:`Handle Errors`,icon:`triangle-exclamation`,href:`/errors`,children:_jsx(_components.p,{children:`Understand error responses and how to handle them.`})}),`\n`,_jsx(Heading,{level:`3`,id:`common-errors`,children:`Common Errors`}),`\n`,_jsxs(AccordionGroup,{children:[_jsxs(Accordion,{title:`Invalid Notion Token`,id:`invalid-notion-token`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Status Code`}),`: 401 Unauthorized`]}),_jsx(_components.p,{children:`The Notion token provided is invalid or expired. Make sure you’re using a valid integration token.`})]}),_jsxs(Accordion,{title:`Page Not Found`,id:`page-not-found`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Status Code`}),`: 404 Not Found`]}),_jsx(_components.p,{children:`The 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.`})]}),_jsxs(Accordion,{title:`Access Denied`,id:`access-denied`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Status Code`}),`: 403 Forbidden`]}),_jsx(_components.p,{children:`Your Notion integration doesn’t have permission to access this page. Share the page with your integration in Notion.`})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`response-structure`,children:`Response Structure`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`markdown`}),` field in the response is an object that separates parent and child page content:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`parent`})}),`: Contains the main page’s Markdown content`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`[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`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`This structure allows you to:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Access the main content via `,_jsx(_components.code,{children:`data.markdown.parent`})]}),`\n`,_jsx(_components.li,{children:`Iterate over child pages if they exist`}),`\n`,_jsx(_components.li,{children:`Maintain the hierarchy of your Notion page structure`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`usage-notes`,children:`Usage Notes`}),`\n`,_jsx(Info,{children:_jsx(_components.p,{children:`Each notion-to-markdown request counts as 1 API call against your quota, regardless of the page size or number of child pages.`})}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`The endpoint returns standard Markdown that’s compatible with GitHub Flavored Markdown (GFM) and most Markdown processors.`})}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Make sure your Notion workspace is connected in the dashboard and has access to the page you want to convert.`})}),`\n`,_jsx(Heading,{level:`2`,id:`setup-guide`,children:`Setup Guide`}),`\n`,_jsxs(_components.p,{children:[`Connect your Notion workspace in the `,_jsx(_components.a,{href:`https://dashboard.mark2notion.com`,children:`dashboard`}),` via OAuth. Then pass your target page as a URL or page ID in the `,_jsx(_components.code,{children:`pageId`}),` field — no manual integration tokens required.`]}),`\n`,_jsx(Heading,{level:`2`,id:`use-cases`,children:`Use Cases`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Content Backup`}),`: Export Notion pages to Markdown for backup purposes`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Static Site Generation`}),`: Convert Notion content to Markdown for static site generators`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Documentation Sync`}),`: Keep documentation in Notion and export to Markdown-based systems`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Content Migration`}),`: Move content from Notion to other platforms`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Version Control`}),`: Track Notion content changes in Git using Markdown format`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Notion to Markdown","api":"POST https://api.mark2notion.com/api/notion-to-markdown","description":"Convert Notion page content to Markdown format","href":"/api-reference/notion-to-markdown"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[398,402,"Example,ResponseFiel"],[908,923,"Example)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingM"],[25701,30523,"_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:`Example Response (Simple Page)`,numberOfLines:`9`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"markdown\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"parent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"# My Page Title`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`This is a paragraph with **bold** text and *italic* text.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`## Subheading`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`- List item 1`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`- List item 2`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` - Nested item`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`---`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"```javascript\"}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`console.log('Code block');`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"```\"}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`> This is a quote block`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`| Column 1 | Column 2 |`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`|----------|----------|`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`| Cell 1 | Cell 2 |\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"pageId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"abc123def456\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Example Response (Page with Child Pages)`,numberOfLines:`11`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"markdown\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"parent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"# Main Page`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`This is the parent page content.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`> 📘 Note`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`> This is a callout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"Child Page 1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"## Child Page Content`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`This is content from the first child page.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"Another Child\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"## Another Child Page`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Content from another child page.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"pageId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"abc123def456\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`error-responses`,children:`Error Responses`}),`\n`,_jsx(Card,{title:`Handle Errors`,icon:`triangle-exclamation`,href:`/errors`,children:_jsx(_components.p,{children:`Understand error responses and how to handle them.`})}),`\n`,_jsx(Heading,{level:`3`,id:`common-errors`,children:`Common Errors`}),`\n`,_jsxs(AccordionGroup,{children:[_jsxs(Accordion,{title:`Invalid Notion Token`,id:`invalid-notion-token`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Status Code`}),`: 401 Unauthorized`]}),_jsx(_components.p,{children:`The Notion token provided is invalid or expired. Make sure you’re using a valid integration token.`})]}),_jsxs(Accordion,{title:`Page Not Found`,id:`page-not-found`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Status Code`}),`: 404 Not Found`]}),_jsx(_components.p,{children:`The 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.`})]}),_jsxs(Accordion,{title:`Access Denied`,id:`access-denied`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Status Code`}),`: 403 Forbidden`]}),_jsx(_components.p,{children:`Your Notion integration doesn’t have permission to access this page. Share the page with your integration in Notion.`})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`response-structure`,children:`Response Structure`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`markdown`}),` field in the response is an object that separates parent and child page content:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`parent`})}),`: Contains the main page’s Markdown content`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`[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`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`This structure allows you to:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Access the main content via `,_jsx(_components.code,{children:`data.markdown.parent`})]}),`\n`,_jsx(_components.li,{children:`Iterate over child pages if they exist`}),`\n`,_jsx(_components.li,{children:`Maintain the hierarchy of your Notion page structure`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`usage-notes`,children:`Usage Notes`}),`\n`,_jsx(Info,{children:_jsx(_components.p,{children:`Each notion-to-markdown request counts as 1 API call against your quota, regardless of the page size or number of child pages.`})}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`The endpoint returns standard Markdown that’s compatible with GitHub Flavored Markdown (GFM) and most Markdown processors.`})}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Make sure your Notion workspace is connected in the dashboard and has access to the page you want to convert.`})}),`\n`,_jsx(Heading,{level:`2`,id:`setup-guide`,children:`Setup Guide`}),`\n`,_jsxs(_components.p,{children:[`Connect your Notion workspace in the `,_jsx(_components.a,{href:`https://dashboard.mark2notion.com`,children:`dashboard`}),` via OAuth. Then pass your target page as a URL or page ID in the `,_jsx(_components.code,{children:`pageId`}),` field — no manual integration tokens required.`]}),`\n`,_jsx(Heading,{level:`2`,id:`use-cases`,children:`Use Cases`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Content Backup`}),`: Export Notion pages to Markdown for backup purposes`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Static Site Generation`}),`: Convert Notion content to Markdown for static site generators`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Documentation Sync`}),`: Keep documentation in Notion and export to Markdown-based systems`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Content Migration`}),`: Move content from Notion to other platforms`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Version Control`}),`: Track Notion content changes in Git using Markdown format`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}"]]},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[]},{"title":"Supported Block Types","slug":"supported-block-types","depth":2,"children":[{"title":"Text Blocks","slug":"text-blocks","depth":3,"children":[]},{"title":"Lists","slug":"lists","depth":3,"children":[]},{"title":"Media \u0026 Embeds","slug":"media-\u0026-embeds","depth":3,"children":[]},{"title":"Advanced Blocks","slug":"advanced-blocks","depth":3,"children":[]},{"title":"Text Formatting \u0026 Colors","slug":"text-formatting-\u0026-colors","depth":3,"children":[]}]},{"title":"Request","slug":"request","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Examples","slug":"examples","depth":2,"children":[]},{"title":"Error Responses","slug":"error-responses","depth":2,"children":[{"title":"Common Errors","slug":"common-errors","depth":3,"children":[]}]},{"title":"Response Structure","slug":"response-structure","depth":2,"children":[]},{"title":"Usage Notes","slug":"usage-notes","depth":2,"children":[]},{"title":"Setup Guide","slug":"setup-guide","depth":2,"children":[]},{"title":"Use Cases","slug":"use-cases","depth":2,"children":[]}],"codeExamples":{"response":{"type":"ResponseExample","children":[{"filename":"Example Response (Simple Page)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"9\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"success\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"data\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"markdown\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"parent\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"# My Page Title\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">This is a paragraph with **bold** text and *italic* text.\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">## Subheading\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">- List item 1\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">- List item 2\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> - Nested item\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">---\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">```javascript\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">console.log('Code block');\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">```\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">> This is a quote block\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">| Column 1 | Column 2 |\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">|----------|----------|\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">| Cell 1 | Cell 2 |\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"pageId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"abc123def456\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Example Response (Page with Child Pages)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"11\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"success\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"data\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"markdown\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"parent\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"# Main Page\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">This is the parent page content.\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">> 📘 Note\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">> This is a callout\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"Child Page 1\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"## Child Page Content\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">This is content from the first child page.\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"Another Child\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"## Another Child Page\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">Content from another child page.\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"pageId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"abc123def456\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Notion to Markdown","path":"/api/notion-to-markdown","servers":[{"url":"https://api.mark2notion.com"}],"method":"post","request":{"security":[],"parameters":{"query":{},"header":{"x-api-key":{"schema":[{"type":"string","description":"Your Mark2Notion API key","required":true}]}},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"notionToken":[{"type":"string","description":"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 ."}],"pageId":[{"type":"string","description":"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.","required":true}]}}],"examples":{"example":{"value":{"notionToken":"\u003cstring>","pageId":"\u003cstring>"}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"status":[{"type":"string","description":"Will be “success” for successful requests"}],"data":[{"type":"object","properties":{"markdown":[{"type":"object","properties":{"parent":[{"type":"string","description":"The Markdown content of the main/parent page"}],"[childPageTitle]":[{"type":"string","description":"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"}]},"description":"An object containing the Markdown representation of the page content"}],"pageId":[{"type":"string","description":"The ID of the page that was converted"}]}}]}}],"examples":{"example":{"value":{"status":"\u003cstring>","data":{"markdown":{"parent":"\u003cstring>","[childPageTitle]":"\u003cstring>"},"pageId":"\u003cstring>"}}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"mark2notion","siteName":"mark2notion API","title":"Notion to Markdown - mark2notion API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-03-20T20:31:29.274Z","originalFileLocation":"api-reference/notion-to-markdown.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Convert Notion page content to Markdown format\">\u003cmeta data-mint-head name=\"application-name\" content=\"mark2notion API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/mark2notion/I_JS_eHS5dEENx6T/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/mark2notion/I_JS_eHS5dEENx6T/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/mark2notion/I_JS_eHS5dEENx6T/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/mark2notion/I_JS_eHS5dEENx6T/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/mark2notion/I_JS_eHS5dEENx6T/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/mark2notion/I_JS_eHS5dEENx6T/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/mark2notion/I_JS_eHS5dEENx6T/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/mark2notion/I_JS_eHS5dEENx6T/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/mark2notion/I_JS_eHS5dEENx6T/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Notion to Markdown - mark2notion API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Convert Notion page content to Markdown format\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"mark2notion API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.mark2notion.com/api-reference/notion-to-markdown\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://mark2notion.mintlify.app/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Notion+to+Markdown\u0026amp;description=Convert+Notion+page+content+to+Markdown+format\u0026amp;theme=76faf83ea2c0f006d8b78809\u0026amp;signature=ebd7f086695a9152f6e086bd00d0dfd6b279689772d83109b81fc42482c7a686\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Notion to Markdown - mark2notion API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Convert Notion page content to Markdown format\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://mark2notion.mintlify.app/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Notion+to+Markdown\u0026amp;description=Convert+Notion+page+content+to+Markdown+format\u0026amp;theme=76faf83ea2c0f006d8b78809\u0026amp;signature=ebd7f086695a9152f6e086bd00d0dfd6b279689772d83109b81fc42482c7a686\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/mark2notion/I_JS_eHS5dEENx6T/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"mark2notion API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0F172A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.mark2notion.com/api-reference/notion-to-markdown\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/notion-to-markdown.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.mark2notion.com/#organization\",\"name\":\"mark2notion API\",\"url\":\"https://docs.mark2notion.com\"},{\"@type\":\"WebSite\",\"@id\":\"https://docs.mark2notion.com#website\",\"name\":\"mark2notion API\",\"url\":\"https://docs.mark2notion.com\",\"publisher\":{\"@id\":\"https://docs.mark2notion.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.mark2notion.com/api-reference/notion-to-markdown#webpage\",\"url\":\"https://docs.mark2notion.com/api-reference/notion-to-markdown\",\"name\":\"Notion to Markdown\",\"description\":\"Convert Notion page content to Markdown format\",\"dateModified\":\"2026-03-20T20:31:29.274Z\",\"isPartOf\":{\"@id\":\"https://docs.mark2notion.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.mark2notion.com/api-reference/notion-to-markdown#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.mark2notion.com/api-reference/notion-to-markdown#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.mark2notion.com/api-reference/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Notion to Markdown\",\"item\":\"https://docs.mark2notion.com/api-reference/notion-to-markdown\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.mark2notion.com/api-reference/notion-to-markdown#apireference\",\"headline\":\"Notion to Markdown\",\"name\":\"Notion to Markdown\",\"description\":\"Convert Notion page content to Markdown format\",\"url\":\"https://docs.mark2notion.com/api-reference/notion-to-markdown\",\"mainEntityOfPage\":{\"@id\":\"https://docs.mark2notion.com/api-reference/notion-to-markdown#webpage\"},\"dateModified\":\"2026-03-20T20:31:29.274Z\",\"publisher\":{\"@id\":\"https://docs.mark2notion.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.mark2notion.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"mark2notion API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"mark2notion API","nav":{"global":null,"groups":[{"group":"Getting Started","pages":[{"title":"Mark2Notion API","href":"/index"},{"title":"Quickstart","href":"/quickstart"},{"title":"Authentication","href":"/authentication"}]},{"group":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"},{"title":"Convert Markdown","api":"POST https://api.mark2notion.com/api/convert","href":"/api-reference/convert"},{"title":"Append to Notion Page","api":"POST https://api.mark2notion.com/api/append","href":"/api-reference/append"},{"title":"Append Prebuilt Blocks","api":"POST https://api.mark2notion.com/api/append-blocks","href":"/api-reference/append-blocks"},{"title":"Clear Notion Page","api":"POST https://api.mark2notion.com/api/clear-page","description":"Archive all top-level blocks from a Notion page","href":"/api-reference/clear-page"},{"title":"Notion to Markdown","api":"POST https://api.mark2notion.com/api/notion-to-markdown","href":"/api-reference/notion-to-markdown"}]},{"group":"Support","pages":[{"title":"Error Handling","description":"Understanding and handling Mark2Notion API errors","href":"/errors"},{"title":"Troubleshooting","href":"/troubleshooting"},{"title":"Feedback \u0026 Support","href":"/feedback"}]},{"group":"Legal","pages":[{"title":"Open Source Credits","href":"/credits"}]}]},"title":"Notion to Markdown - mark2notion API","buildId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","deploymentId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-DmVyH30O.js","utils-BHQqGGOd.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-CD-E4BIt.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Bp5Lq9Ds.js","snippetPresets-C4xAVCFP.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CgXVLxUC.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BF8I5oUf.js","shallow-Byd0lWnC.js","getApiPlaygroundDisplay-BGOZG1OK.js","CodeSnippet-CpvQL0CY.js","CodeSnippets-B8wkBKXa.js","Page-CBCH2P7b.js","getPastedJson-Ry3scI3Y.js","icon-D7a9HcdD.js","MethodPill-CJ8pmHhz.js","DuplicateIcon-rh1HJF0t.js","createIcon-DvGznqYs.js","DynamicMarkdown-Cc6AuSHS.js","SectionHeading-B4A0S-ep.js","axios-vUo_bRtp.js"]}