TypeScript SDK
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"
}
})curl --request POST \
--url https://api.notion.com/v1/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Notion-Version: <notion-version>' \
--data '
{
"sort": {
"timestamp": "last_edited_time"
},
"query": "<string>",
"start_cursor": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"page_size": 123,
"filter": {
"property": "object",
"in_trash": true
}
}
'import requests
url = "https://api.notion.com/v1/search"
payload = {
"sort": { "timestamp": "last_edited_time" },
"query": "<string>",
"start_cursor": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"page_size": 123,
"filter": {
"property": "object",
"in_trash": True
}
}
headers = {
"Notion-Version": "<notion-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.notion.com/v1/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sort' => [
'timestamp' => 'last_edited_time'
],
'query' => '<string>',
'start_cursor' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'page_size' => 123,
'filter' => [
'property' => 'object',
'in_trash' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Notion-Version: <notion-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notion.com/v1/search"
payload := strings.NewReader("{\n \"sort\": {\n \"timestamp\": \"last_edited_time\"\n },\n \"query\": \"<string>\",\n \"start_cursor\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"page_size\": 123,\n \"filter\": {\n \"property\": \"object\",\n \"in_trash\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Notion-Version", "<notion-version>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.notion.com/v1/search")
.header("Notion-Version", "<notion-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sort\": {\n \"timestamp\": \"last_edited_time\"\n },\n \"query\": \"<string>\",\n \"start_cursor\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"page_size\": 123,\n \"filter\": {\n \"property\": \"object\",\n \"in_trash\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.notion.com/v1/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Notion-Version"] = '<notion-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sort\": {\n \"timestamp\": \"last_edited_time\"\n },\n \"query\": \"<string>\",\n \"start_cursor\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"page_size\": 123,\n \"filter\": {\n \"property\": \"object\",\n \"in_trash\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"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": {
"incomplete_reason": "query_result_limit_reached"
}
}{
"object": "<unknown>",
"message": "<string>",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "unauthorized",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "restricted_resource",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "row_limit_exceeded",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "conflict_error",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "rate_limited",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "internal_server_error",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "service_unavailable",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "gateway_timeout",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "service_overload",
"status": "<unknown>",
"additional_data": {}
}Search by title
Search by title
Searches all parent or child pages and data_sources that have been shared with a connection.
POST
/
v1
/
search
TypeScript SDK
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"
}
})curl --request POST \
--url https://api.notion.com/v1/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Notion-Version: <notion-version>' \
--data '
{
"sort": {
"timestamp": "last_edited_time"
},
"query": "<string>",
"start_cursor": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"page_size": 123,
"filter": {
"property": "object",
"in_trash": true
}
}
'import requests
url = "https://api.notion.com/v1/search"
payload = {
"sort": { "timestamp": "last_edited_time" },
"query": "<string>",
"start_cursor": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"page_size": 123,
"filter": {
"property": "object",
"in_trash": True
}
}
headers = {
"Notion-Version": "<notion-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.notion.com/v1/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sort' => [
'timestamp' => 'last_edited_time'
],
'query' => '<string>',
'start_cursor' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'page_size' => 123,
'filter' => [
'property' => 'object',
'in_trash' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Notion-Version: <notion-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notion.com/v1/search"
payload := strings.NewReader("{\n \"sort\": {\n \"timestamp\": \"last_edited_time\"\n },\n \"query\": \"<string>\",\n \"start_cursor\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"page_size\": 123,\n \"filter\": {\n \"property\": \"object\",\n \"in_trash\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Notion-Version", "<notion-version>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.notion.com/v1/search")
.header("Notion-Version", "<notion-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sort\": {\n \"timestamp\": \"last_edited_time\"\n },\n \"query\": \"<string>\",\n \"start_cursor\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"page_size\": 123,\n \"filter\": {\n \"property\": \"object\",\n \"in_trash\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.notion.com/v1/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Notion-Version"] = '<notion-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sort\": {\n \"timestamp\": \"last_edited_time\"\n },\n \"query\": \"<string>\",\n \"start_cursor\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"page_size\": 123,\n \"filter\": {\n \"property\": \"object\",\n \"in_trash\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"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": {
"incomplete_reason": "query_result_limit_reached"
}
}{
"object": "<unknown>",
"message": "<string>",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "unauthorized",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "restricted_resource",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "row_limit_exceeded",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "conflict_error",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "rate_limited",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "internal_server_error",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "service_unavailable",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "gateway_timeout",
"status": "<unknown>",
"additional_data": {}
}{
"object": "<unknown>",
"message": "<string>",
"code": "service_overload",
"status": "<unknown>",
"additional_data": {}
}Returns all pages or data_sources , excluding duplicated linked databases, that have titles that include the
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 pages or data sources, use the filter parameter with property: "object" and a value of "page" or "data_source".
To list content in the trash, set filter.in_trash to true. You can combine in_trash with the object filter or use it by itself.
Errors
Each Public API endpoint can return several possible error codes. See the Error codes section of the Status codes documentation for more information.The Search endpoint supports pagination. To learn more about working with paginated responses, see the pagination section of the Notion API Introduction.
To search a specific data_source — not all sources shared with the connection — use the Query a data_source endpoint instead.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The API version to use for this request. The latest version is 2026-03-11.
Available options:
2026-03-11 Body
application/json
Response
Allowed value:
"page_or_data_source"Allowed value:
"list"- Option 1
- Option 2
- Option 3
- Option 4
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I