Agent skill
notion-skill
Read Notion databases and pages. Use when the user asks to pull data from Notion, list databases, query database entries, or export Notion content for migration.
Install this agent skill to your Project
npx add-skill https://github.com/idanbeck/claude-skills/tree/main/notion-skill
SKILL.md
Notion Skill - Database & Page Access
Read and query Notion databases and pages. Supports multiple workspaces. Useful for data migration and export.
First-Time Setup (~3 minutes per workspace)
1. Create an Internal Integration (per workspace)
- Go to Notion Integrations
- Click + New integration
- Name it (e.g., "Claude Assistant")
- Select the workspace you want to access
- Under Capabilities, ensure "Read content" is enabled
- Click Submit
- Copy the Internal Integration Secret (starts with
ntn_orsecret_)
Note: Each Notion workspace requires its own integration. Create one integration per workspace.
2. Share Pages/Databases with the Integration
Important: Notion integrations can only access pages explicitly shared with them.
- Open any database or page you want to access
- Click ... (menu) in the top right
- Click Add connections
- Search for your integration name and select it
- Repeat for all databases/pages you need
3. Configure Accounts
Create ~/.claude/skills/notion-skill/config.json:
{
"default_account": "personal",
"accounts": {
"personal": {
"email": "you@gmail.com",
"workspace": "Personal",
"token": "ntn_..."
},
"work": {
"email": "you@company.com",
"workspace": "Company",
"token": "ntn_..."
}
}
}
Commands
List Accounts
python3 ~/.claude/skills/notion-skill/notion_skill.py accounts
List Databases
python3 ~/.claude/skills/notion-skill/notion_skill.py databases [-a ACCOUNT]
Lists all databases shared with the integration.
Examples:
# Use default account
python3 ~/.claude/skills/notion-skill/notion_skill.py databases
# Use specific account
python3 ~/.claude/skills/notion-skill/notion_skill.py databases -a epoch
Query Database
python3 ~/.claude/skills/notion-skill/notion_skill.py query DATABASE_ID [-a ACCOUNT] [--limit N] [--filter PROPERTY:VALUE]
Arguments:
DATABASE_ID- The database ID (from URL or databases command)-a/--account- Account/workspace to use--limit/-l- Number of results (default: 100)--filter/-f- Filter by property (e.g.,--filter "Status:Active")
Example:
python3 ~/.claude/skills/notion-skill/notion_skill.py query abc123 -a personal --limit 50
Get Page
python3 ~/.claude/skills/notion-skill/notion_skill.py page PAGE_ID [-a ACCOUNT]
Gets a page's properties and content.
Search
python3 ~/.claude/skills/notion-skill/notion_skill.py search "query" [-a ACCOUNT] [--type database|page]
Arguments:
query- Search term-a/--account- Account/workspace to use--type/-t- Filter by type:databaseorpage
Export Database to JSON
python3 ~/.claude/skills/notion-skill/notion_skill.py export DATABASE_ID [-a ACCOUNT] [--output FILE]
Exports all entries from a database to JSON for migration.
Arguments:
DATABASE_ID- The database to export-a/--account- Account/workspace to use--output/-o- Output file (default: stdout)
Migration Workflow
1. List Accounts
python3 ~/.claude/skills/notion-skill/notion_skill.py accounts
2. Find Your Databases
python3 ~/.claude/skills/notion-skill/notion_skill.py databases -a personal
python3 ~/.claude/skills/notion-skill/notion_skill.py databases -a epoch
3. Preview Data Structure
python3 ~/.claude/skills/notion-skill/notion_skill.py query DATABASE_ID -a personal --limit 5
4. Export Full Database
python3 ~/.claude/skills/notion-skill/notion_skill.py export DATABASE_ID -a personal --output people.json
5. Migrate to Obsidian
Use the exported JSON to create pages in the vault.
Output Format
All commands output JSON. Database entries include:
id- Page IDurl- Notion URLcreated_time- Creation timestamplast_edited_time- Last edit timestampproperties- All database properties with values
Property Types
The skill handles these Notion property types:
title- Page titlerich_text- Text contentnumber- Numeric valuesselect- Single selectmulti_select- Multiple selectionsstatus- Status fielddate- Date/date rangepeople- Notion usersemail- Email addressesphone_number- Phone numbersurl- URLscheckbox- Booleanrelation- Links to other databasesrollup- Computed valuesformula- Formula resultsfiles- File attachmentscreated_time/last_edited_time- Timestampscreated_by/last_edited_by- Users
Finding Database IDs
Database IDs can be found in the URL:
https://www.notion.so/workspace/DATABASE_ID?v=VIEW_ID
^^^^^^^^^^^^^^^^
Or use the databases command to list all accessible databases with their IDs.
Requirements
No external dependencies - uses Python standard library only.
Security Notes
- Integration tokens don't expire but can be revoked
- Token stored locally in
~/.claude/skills/notion-skill/config.json - Config file is gitignored (contains secrets)
- Revoke access: Notion Integrations > Delete integration
Sources
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
fal-video-skill
godaddy-skill
Manage GoDaddy domains and DNS records. Use when the user asks to set up DNS, manage domain records, check DNS propagation, point domains to servers, or configure A/AAAA/CNAME/MX/TXT records. Supports bulk operations for quick domain setup.
gcal-skill
Read, create, and manage Google Calendar events. Use when the user asks to check calendar, view schedule, find meetings, create events, or see what's on the agenda. Supports multiple accounts.
nano-banana-pro
Generate images using AI. Use when the user asks to create, generate, or make images, pictures, graphics, illustrations, visuals, or artwork. Also use for image editing with reference images.
google-docs-skill
Create, read, update, share, and export Google Docs. Use when the user asks to create documents, write content to Google Docs, share docs, export to PDF/DOCX, or convert markdown files to Google Docs.
film-maker-skill
Didn't find tool you were looking for?