Notion API - Database & Page Automation
Pricing
Pay per event
Notion API - Database & Page Automation
Automate your Notion workspace with the official API. Query databases, create and update pages, manage blocks, search content, and sync data. Perfect for CMS automation, content pipelines, project management, and knowledge base workflows.
Pricing
Pay per event
Rating
0.0
(0)
Developer

John Rippy
Actor stats
0
Bookmarked
2
Total users
1
Monthly active users
6 hours ago
Last modified
Categories
Share
Notion API
Built by John Rippy | johnrippy.link
🏆 2025 Zapier Automation Hero of the Year — Project Phoenix: A 95-step AI sales pipeline cutting development time by 50%. Read more →
Database & Page Automation - Query, Create & Sync Notion Content
Automate your Notion workspace with the official API. Query databases, create and update pages, manage blocks, search content, and sync data. Perfect for CMS automation, content pipelines, project management, and knowledge base workflows.
What is the Notion API?
The Notion API provides programmatic access to Notion workspaces. Create integrations that read and write to databases, pages, blocks, and more.
Features
Database Operations
- Query Database - Filter and sort database entries
- Get Database - Retrieve database schema and properties
- Create Database - Create new databases with custom properties
- Update Database - Modify database title and properties
Page Management
- Get Page - Retrieve page properties
- Create Page - Create new pages in databases or as subpages
- Update Page - Modify page properties
- Batch Create - Create multiple pages in one run
Block Operations
- Get Block - Retrieve block content
- Get Block Children - List child blocks (page content)
- Append Blocks - Add content to pages
- Update Block - Modify block content
- Delete Block - Remove blocks
Search & Discovery
- Search - Find pages and databases by title
User & Comments
- List Users - Get workspace members
- Get User - Retrieve user details
- List Comments - Get page/block comments
- Create Comment - Add comments to pages
Use Cases
CMS & Content Management
- Sync blog posts from Notion to website
- Auto-publish content based on status
- Update metadata across pages
Project Management
- Create tasks from external sources
- Update project statuses automatically
- Generate reports from databases
Knowledge Base
- Search and retrieve documentation
- Auto-organize content
- Sync with external systems
Data Pipelines
- Import data to Notion databases
- Export Notion data for analysis
- Sync between Notion and other tools
Automation Workflows
- Trigger actions on database changes
- Create pages from form submissions
- Update records from API calls
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| task | string | Yes | Operation to perform (see tasks below) |
| accessToken | string | Yes* | Notion integration token (*not needed for demoMode) |
| databaseId | string | No | Database ID for database operations |
| pageId | string | No | Page ID for page operations |
| blockId | string | No | Block ID for block operations |
| searchQuery | string | No | Search text for search task |
| searchFilter | string | No | Filter by 'page' or 'database' |
| filter | object | No | Database filter (JSON) |
| sorts | array | No | Database sort configuration |
| pageTitle | string | No | Title for new page |
| properties | object | No | Properties for create/update |
| content | array | No | Block content array |
| batchPages | array | No | Pages for batch creation |
| webhookUrl | string | No | URL for webhook delivery |
| demoMode | boolean | No | Run with sample data (default: true) |
Available Tasks
| Task | Description |
|---|---|
search | Search pages and databases by title |
query_database | Query database with filters and sorts |
get_database | Get database schema |
create_database | Create new database |
update_database | Update database properties |
get_page | Get page properties |
create_page | Create new page |
update_page | Update page properties |
get_block | Get block content |
get_block_children | List page/block children |
append_block_children | Add blocks to page |
update_block | Update block content |
delete_block | Delete a block |
list_users | List workspace users |
get_user | Get user by ID |
get_me | Get bot user info |
list_comments | List comments on page/block |
create_comment | Add comment to page |
batch_create_pages | Create multiple pages |
Getting Your Integration Token
- Go to Notion Integrations
- Click + New integration
- Give it a name and select your workspace
- Choose capabilities (read/write content, comments, users)
- Copy the Internal Integration Token (starts with
secret_) - Important: Share pages/databases with your integration!
- Open the page/database in Notion
- Click ••• → Connections → Add your integration
Example Usage
Search for Pages
{"task": "search","accessToken": "secret_abc123...","searchQuery": "Marketing","searchFilter": "page","maxResults": 20}
Query Database with Filter
{"task": "query_database","accessToken": "secret_abc123...","databaseId": "abc123...","filter": {"property": "Status","select": {"equals": "In Progress"}},"sorts": [{"property": "Due Date","direction": "ascending"}]}
Create Page in Database
{"task": "create_page","accessToken": "secret_abc123...","databaseId": "abc123...","pageTitle": "New Task","properties": {"Status": {"select": { "name": "Not Started" }},"Priority": {"select": { "name": "High" }},"Due Date": {"date": { "start": "2025-01-15" }}},"content": [{"type": "paragraph","paragraph": {"rich_text": [{"type": "text","text": { "content": "Task description here." }}]}}]}
Batch Create Pages
{"task": "batch_create_pages","accessToken": "secret_abc123...","databaseId": "abc123...","batchPages": [{"title": "Task 1","properties": { "Priority": { "select": { "name": "High" } } }},{"title": "Task 2","properties": { "Priority": { "select": { "name": "Medium" } } }},{"title": "Task 3","properties": { "Priority": { "select": { "name": "Low" } } }}]}
Update Page Status
{"task": "update_page","accessToken": "secret_abc123...","pageId": "page123...","properties": {"Status": {"select": { "name": "Complete" }}}}
Append Content to Page
{"task": "append_block_children","accessToken": "secret_abc123...","blockId": "page123...","content": [{"type": "heading_2","heading_2": {"rich_text": [{ "type": "text", "text": { "content": "New Section" } }]}},{"type": "paragraph","paragraph": {"rich_text": [{ "type": "text", "text": { "content": "Added via API!" } }]}}]}
Output
Results are saved to the default dataset:
Query Result
{"task": "query_database","success": true,"pages": [{"id": "abc123...","url": "https://notion.so/...","properties": {"Name": { "title": [{ "plain_text": "Project Alpha" }] },"Status": { "select": { "name": "In Progress" } }}}],"total": 15,"databaseId": "xyz789..."}
Page Created
{"task": "create_page","success": true,"page": {"id": "new123...","url": "https://notion.so/...","created_time": "2025-01-10T12:00:00.000Z"}}
Finding IDs
Database/Page ID from URL:
https://notion.so/workspace/DATABASE_ID?v=...https://notion.so/Page-Title-PAGE_ID
The ID is the 32-character string (with or without dashes).
Block ID:
- Use
get_block_childrenon a page to see block IDs
Webhook Integration
Send results to Zapier, Make, n8n, or any webhook:
{"task": "query_database","accessToken": "secret_abc123...","databaseId": "abc123...","webhookUrl": "https://hooks.zapier.com/hooks/catch/123456/abcdef/"}
Demo Mode
Test the actor without API credentials:
{"task": "search","demoMode": true}
Pricing
Pay-per-result pricing:
| Operation | Cost |
|---|---|
| Search | $0.01 |
| Query database | $0.02 |
| Get database/page/block | $0.01 |
| Create database | $0.05 |
| Create page | $0.03 |
| Update database/page/block | $0.02 |
| Delete block | $0.01 |
| Append blocks | $0.02 |
| List users/comments | $0.01 |
| Create comment | $0.02 |
| Batch create (per page) | $0.03 |
Related Actors
- Airtable API - Airtable database automation
- Google Sheets - Spreadsheet automation
Support
- Notion API Docs: developers.notion.com
- Issues: Report on Apify