Join us for our Developer Platform Hackathon, May 16-17. Apply now →
import { Client } from "@notionhq/client"
const notion = new Client({ auth: process.env.NOTION_API_KEY })
const response = await notion.search({
query: "meeting notes",
filter: {
property: "object",
value: "page"
},
sort: {
direction: "descending",
timestamp: "last_edited_time"
}
}){
"type": "<string>",
"page_or_data_source": {},
"object": "<string>",
"next_cursor": "<string>",
"has_more": true,
"results": [
{
"object": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_time": "2023-11-07T05:31:56Z",
"last_edited_time": "2023-11-07T05:31:56Z",
"in_trash": true,
"is_archived": true,
"is_locked": true,
"url": "<string>",
"public_url": "<string>",
"parent": {
"type": "<string>",
"database_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"properties": {},
"icon": {
"type": "<string>",
"emoji": "<string>"
},
"cover": {
"type": "<string>",
"file": {
"url": "<string>",
"expiry_time": "2023-11-07T05:31:56Z"
}
},
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "<string>"
},
"last_edited_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "<string>"
}
}
],
"request_status": {
"type": "complete",
"incomplete_reason": "query_result_limit_reached"
}
}Searches all parent or child pages and data_sources that have been shared with a connection.
import { Client } from "@notionhq/client"
const notion = new Client({ auth: process.env.NOTION_API_KEY })
const response = await notion.search({
query: "meeting notes",
filter: {
property: "object",
value: "page"
},
sort: {
direction: "descending",
timestamp: "last_edited_time"
}
}){
"type": "<string>",
"page_or_data_source": {},
"object": "<string>",
"next_cursor": "<string>",
"has_more": true,
"results": [
{
"object": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_time": "2023-11-07T05:31:56Z",
"last_edited_time": "2023-11-07T05:31:56Z",
"in_trash": true,
"is_archived": true,
"is_locked": true,
"url": "<string>",
"public_url": "<string>",
"parent": {
"type": "<string>",
"database_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"properties": {},
"icon": {
"type": "<string>",
"emoji": "<string>"
},
"cover": {
"type": "<string>",
"file": {
"url": "<string>",
"expiry_time": "2023-11-07T05:31:56Z"
}
},
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "<string>"
},
"last_edited_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "<string>"
}
}
],
"request_status": {
"type": "complete",
"incomplete_reason": "query_result_limit_reached"
}
}Returns all pages or data_sources , excluding duplicated linked databases, that have titles that include theDocumentation Index
Fetch the complete documentation index at: https://developers.notion.com/llms.txt
Use this file to discover all available pages before exploring further.
query param. If no query param is provided, then the response contains all pages or data_sources that have been shared with the connection. The results adhere to any limitations related to an connection’s capabilities.
To limit the request to search only pages or to search only data_source, use the filter param.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The API version to use for this request. The latest version is 2026-03-11.
2026-03-11 "page_or_data_source""list"Show child attributes
Show child attributes