| name | notion-search-retrieve |
| description | Search Notion workspaces and retrieve pages, databases, and block content
using the Notion API. Use when querying databases with filters, searching
across a workspace, paginating large result sets, or extracting page content.
Trigger with phrases like "notion search", "query notion database",
"notion retrieve page", "notion pagination", "notion filter",
"notion blocks", "notion get content".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Grep |
| version | 1.38.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","productivity","notion"] |
| compatibility | Designed for Claude Code |
Notion Search & Data Retrieval
Overview
Search across a Notion workspace, query databases with compound filters, retrieve individual pages, and extract nested block content. Covers the full read path: workspace-level search, database queries with filter/sort/pagination, page retrieval, and recursive block tree traversal.
Prerequisites
@notionhq/client installed (npm install @notionhq/client)
- Notion integration token with read access to target pages/databases
- Integration added to target pages via the Share menu in Notion
- Completed
notion-install-auth setup
Instructions
Step 1: Search the Workspace
Call notion.search() to find pages and databases. The integration only sees content explicitly shared with it.
import { Client } from '@notionhq/client';
const notion = new Client({ auth: process.env.NOTION_TOKEN });
const searchResults = await notion.search({
query: 'meeting notes',
filter: {
property: 'object',
value: 'page',
},
sort: {
direction: 'descending',
timestamp: 'last_edited_time',
},
page_size: 20,
});
for (const result of searchResults.results) {
if (result. === && result) {
titleProp = .(result.)
.( p. === );
title = titleProp?. ===
? titleProp..( t.).()
: ;
.();
}
}