Notion API - Database & Page Automation avatar
Notion API - Database & Page Automation

Pricing

Pay per event

Go to Apify Store
Notion API - Database & Page Automation

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

John Rippy

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

6 hours ago

Last modified

Share

Notion API

Built by John Rippy | johnrippy.link

🏆 2025 Zapier Automation Hero of the YearProject 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

ParameterTypeRequiredDescription
taskstringYesOperation to perform (see tasks below)
accessTokenstringYes*Notion integration token (*not needed for demoMode)
databaseIdstringNoDatabase ID for database operations
pageIdstringNoPage ID for page operations
blockIdstringNoBlock ID for block operations
searchQuerystringNoSearch text for search task
searchFilterstringNoFilter by 'page' or 'database'
filterobjectNoDatabase filter (JSON)
sortsarrayNoDatabase sort configuration
pageTitlestringNoTitle for new page
propertiesobjectNoProperties for create/update
contentarrayNoBlock content array
batchPagesarrayNoPages for batch creation
webhookUrlstringNoURL for webhook delivery
demoModebooleanNoRun with sample data (default: true)

Available Tasks

TaskDescription
searchSearch pages and databases by title
query_databaseQuery database with filters and sorts
get_databaseGet database schema
create_databaseCreate new database
update_databaseUpdate database properties
get_pageGet page properties
create_pageCreate new page
update_pageUpdate page properties
get_blockGet block content
get_block_childrenList page/block children
append_block_childrenAdd blocks to page
update_blockUpdate block content
delete_blockDelete a block
list_usersList workspace users
get_userGet user by ID
get_meGet bot user info
list_commentsList comments on page/block
create_commentAdd comment to page
batch_create_pagesCreate multiple pages

Getting Your Integration Token

  1. Go to Notion Integrations
  2. Click + New integration
  3. Give it a name and select your workspace
  4. Choose capabilities (read/write content, comments, users)
  5. Copy the Internal Integration Token (starts with secret_)
  6. 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_children on 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:

OperationCost
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

Support