| name | notion-md-download-skill |
| description | Download Notion pages as local Markdown files. Supports single or batch page download, output to file or stdout. Use when user wants to download/export Notion pages to markdown, or mentions "download notion page", "export notion to md", "下载Notion页面", "导出Notion为Markdown". |
Notion Markdown Download
Download Notion pages as local Markdown files. Uses the Notion 2026-03-11 API with native markdown export.
Prerequisites
- Notion API Key: Create an integration at https://notion.so/my-integrations
- Store the key:
mkdir -p ~/.config/notion
echo "ntn_your_key_here" > ~/.config/notion/api_key
- Share target page with your integration (click "..." → "Connect to" → your integration name)
First Time Setup
Dependencies are auto-installed when the script runs. No manual setup needed.
Agent Execution Instructions
CRITICAL: Always use the command pattern below.
- Determine this SKILL.md file's directory path as
SKILL_DIR
- Command pattern:
(cd "${SKILL_DIR}/scripts" && (test -d node_modules || npm install) && npx -y tsx main.ts <args>)
Usage
(cd "${SKILL_DIR}/scripts" && (test -d node_modules || npm install) && npx -y tsx main.ts <page_id_or_url> --output notes.md)
(cd "${SKILL_DIR}/scripts" && (test -d node_modules || npm install) && npx -y tsx main.ts <page_id_or_url>)
(cd "${SKILL_DIR}/scripts" && (test -d node_modules || npm install) && npx -y tsx main.ts <page_id_or_url> --output ./docs/)
(cd "${SKILL_DIR}/scripts" && (test -d node_modules || npm install) && npx -y tsx main.ts <id1> <id2> <id3> --output ./docs/)
Options
| Option | Description |
|---|
<page_id_or_url> | Notion page ID or full URL (can specify multiple) |
--output, -o <path> | Output file or directory (default: stdout) |
Input Formats
The page identifier accepts:
- 32-character ID:
abc123def456...
- ID with dashes:
abc123de-f456-...
- Notion URL:
https://www.notion.so/Page-Title-abc123def456...
How It Works
- Extract page ID from the input (URL or raw ID)
- Download the page content as markdown via
GET /v1/pages/{id}/markdown
- Save to the specified output file/directory, or print to stdout
Dependencies
- Node.js (script runs with
tsx)
- Notion API key configured
(Other dependencies auto-install on first run.)