name: notion version: 1.0.0 description: Read, create, and update Notion pages and databases via the official API. author: ZeptoClaw license: MIT tags:
- notion
- productivity
- notes env_needed:
- name: NOTION_TOKEN description: Notion integration secret token (from notion.so/my-integrations) required: true
- name: NOTION_DATABASE_ID description: Target database ID (from the page URL) required: false metadata: {"zeptoclaw":{"emoji":"๐","requires":{"anyBins":["curl","jq"]}}}
Notion Skill
Read and write Notion pages and databases using the official Notion API.
Setup
- Go to notion.so/my-integrations โ New Integration
- Copy the Internal Integration Secret
- Open your Notion page/database โ Share โ Invite your integration
- Copy the database ID from the URL:
notion.so/workspace/DATABASE_ID?v=...
export NOTION_TOKEN="secret_xxx..."
export NOTION_DATABASE_ID="abc123..."
Query a Database
curl -s -X POST "https://api.notion.com/v1/databases/$NOTION_DATABASE_ID/query" \
-H "Authorization: Bearer $NOTION_TOKEN" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json" \
-d '{"page_size": 20}' | jq '.results[].properties.Name.title[0].text.content'
Filter by a property:
curl -s -X POST "https://api.notion.com/v1/databases/$NOTION_DATABASE_ID/query" \
-H "Authorization: Bearer $NOTION_TOKEN" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json" \
-d '{
"filter": {
"property": "Status",
"select": {"equals": "In Progress"}
}
}' | jq '.results | length'
Create a Page (Database Row)
curl -s -X POST "https://api.notion.com/v1/pages" \
-H "Authorization: Bearer $NOTION_TOKEN" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json" \
-d "{
\"parent\": {\"database_id\": \"$NOTION_DATABASE_ID\"},
\"properties\": {
\"Name\": {\"title\": [{\"text\": {\"content\": \"New Task\"}}]},
\"Status\": {\"select\": {\"name\": \"Todo\"}},
\"Priority\": {\"select\": {\"name\": \"High\"}}
}
}" | jq '.id'
Update a Page Property
PAGE_ID="page-id-from-query"
curl -s -X PATCH "https://api.notion.com/v1/pages/$PAGE_ID" \
-H "Authorization: Bearer $NOTION_TOKEN" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json" \
-d '{"properties": {"Status": {"select": {"name": "Done"}}}}' | jq '.id'
Append Content to a Page
curl -s -X PATCH "https://api.notion.com/v1/blocks/$PAGE_ID/children" \
-H "Authorization: Bearer $NOTION_TOKEN" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json" \
-d '{
"children": [{
"object": "block",
"type": "paragraph",
"paragraph": {
"rich_text": [{"type": "text", "text": {"content": "Agent appended this note."}}]
}
}]
}' | jq '.results[0].id'
Tips
- Database IDs have no hyphens in the API URL โ add hyphens in the UUID format if needed
- Rate limit: 3 requests/second per integration
- Use
jqto extract just the data you need โ API responses are verbose - Property names are case-sensitive and must match exactly