Notion Exporter
Overview
Extract and transform Notion content at scale—databases, pages, and nested wikis—into portable formats for archival, CMS migration, documentation publishing, and data pipelines.
When to Use
- Exporting a Notion wiki to a static docs site (Markdown/MDX)
- Migrating Notion databases to Airtable, Supabase, or CSV
- Creating scheduled backups of Notion workspaces
- Converting Notion specs into formatted PDFs for clients
- Syncing Notion content to a CMS like Contentful or Ghost
Instructions
- Accept inputs: Notion integration token, source (database ID or page ID), export format (markdown/csv/json/pdf), include_subpages flag, schedule (optional).
- Authenticate with the Notion API using the integration token.
- Traverse the source recursively if include_subpages=true; collect all child pages and database entries.
- For databases: resolve relations, rollups, and formulas into human-readable values.
- Transform content blocks to the target format (rich text, images, code, callouts, tables).
- Write output files with proper naming convention based on page titles and timestamps.
- If scheduled, register export as a recurring job.
- Return export summary: pages exported, file paths, total size, duration.
Environment
NOTION_TOKEN=secret_your_notion_integration_token
NOTION_SOURCE_ID=your_database_or_page_id
EXPORT_FORMAT=markdown
OUTPUT_DIR=./notion_exports
INCLUDE_SUBPAGES=true
Examples
Input:
source: notion_database_id_abc123
format: csv
resolve_relations: true
output: ./exports/crm_contacts.csv
Output:
Export complete.
Pages exported: 1 database
Rows: 3,847 records
Relations resolved: supplier_id, buyer_id
File: ./exports/crm_contacts.csv (1.2 MB)
Duration: 18s
1---2name: notion-exporter3description: Export Notion databases, pages, and wikis to Markdown, PDF, CSV, or JSON. Supports recursive page traversal, property mapping, relation resolution, and scheduled automated exports.4license: MIT5---67# Notion Exporter89## Overview1011Extract and transform Notion content at scale—databases, pages, and nested wikis—into portable formats for archival, CMS migration, documentation publishing, and data pipelines.1213---1415## When to Use1617- Exporting a Notion wiki to a static docs site (Markdown/MDX)18- Migrating Notion databases to Airtable, Supabase, or CSV19- Creating scheduled backups of Notion workspaces20- Converting Notion specs into formatted PDFs for clients21- Syncing Notion content to a CMS like Contentful or Ghost2223---2425## Instructions26271. Accept inputs: Notion integration token, source (database ID or page ID), export format (markdown/csv/json/pdf), include_subpages flag, schedule (optional).282. Authenticate with the Notion API using the integration token.293. Traverse the source recursively if include_subpages=true; collect all child pages and database entries.304. For databases: resolve relations, rollups, and formulas into human-readable values.315. Transform content blocks to the target format (rich text, images, code, callouts, tables).326. Write output files with proper naming convention based on page titles and timestamps.337. If scheduled, register export as a recurring job.348. Return export summary: pages exported, file paths, total size, duration.3536---3738## Environment3940```41NOTION_TOKEN=secret_your_notion_integration_token42NOTION_SOURCE_ID=your_database_or_page_id43EXPORT_FORMAT=markdown44OUTPUT_DIR=./notion_exports45INCLUDE_SUBPAGES=true46```4748---4950## Examples5152**Input:**53```54source: notion_database_id_abc12355format: csv56resolve_relations: true57output: ./exports/crm_contacts.csv58```5960**Output:**61```62Export complete.63Pages exported: 1 database64Rows: 3,847 records65Relations resolved: supplier_id, buyer_id66File: ./exports/crm_contacts.csv (1.2 MB)67Duration: 18s68```