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": "page_or_data_source",
"page_or_data_source": {},
"object": "list",
"next_cursor": "<string>",
"has_more": true,
"results": [
{
"object": "page",
"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": "database_id",
"database_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"properties": {},
"icon": {
"type": "emoji",
"emoji": "😀"
},
"cover": {
"type": "file",
"file": {
"url": "<string>",
"expiry_time": "2023-11-07T05:31:56Z"
}
},
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "user"
},
"last_edited_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "user"
}
}
],
"request_status": {
"type": "complete",
"incomplete_reason": "query_result_limit_reached"
}
}{
"object": "error",
"message": "<string>",
"code": "invalid_json",
"status": 400,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "unauthorized",
"status": 401,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "restricted_resource",
"status": 403,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "object_not_found",
"status": 404,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "row_limit_exceeded",
"status": 406,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "conflict_error",
"status": 409,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "rate_limited",
"status": 429,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "internal_server_error",
"status": 500,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "service_unavailable",
"status": 503,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "gateway_timeout",
"status": 504,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "service_overload",
"status": 529,
"additional_data": {}
}Search by title
Search by title
Find pages and data sources by title.
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": "page_or_data_source",
"page_or_data_source": {},
"object": "list",
"next_cursor": "<string>",
"has_more": true,
"results": [
{
"object": "page",
"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": "database_id",
"database_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"properties": {},
"icon": {
"type": "emoji",
"emoji": "😀"
},
"cover": {
"type": "file",
"file": {
"url": "<string>",
"expiry_time": "2023-11-07T05:31:56Z"
}
},
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "user"
},
"last_edited_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "user"
}
}
],
"request_status": {
"type": "complete",
"incomplete_reason": "query_result_limit_reached"
}
}{
"object": "error",
"message": "<string>",
"code": "invalid_json",
"status": 400,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "unauthorized",
"status": 401,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "restricted_resource",
"status": 403,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "object_not_found",
"status": 404,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "row_limit_exceeded",
"status": 406,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "conflict_error",
"status": 409,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "rate_limited",
"status": 429,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "internal_server_error",
"status": 500,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "service_unavailable",
"status": 503,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "gateway_timeout",
"status": 504,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "service_overload",
"status": 529,
"additional_data": {}
}Search returns pages and data sources that the connection can access. Omit
query to search without a title filter. Search excludes duplicate linked databases. See search limitations before using the results as an inventory.
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.
Results use cursor-based pagination. To filter rows in one data source, use Query a data source.
Return fewer page properties
Use thefilter_properties query parameter to return only the page properties you need. It works the same way as on Query a data source, with two differences. Search results come from many data sources, so if a name or ID doesn’t exist on a page, search skips it for that page instead of returning an error. Data source results always include their full property schema.
curl -X POST 'https://api.notion.com/v1/search?filter_properties=title&filter_properties=Status' \
-H "Authorization: Bearer $NOTION_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Notion-Version: 2026-03-11' \
--data '{"query": "Roadmap", "filter": {"property": "object", "value": "page"}}'
Errors
See status codes for error responses.Authorizations
Headers
The API version to use for this request. The latest version is 2026-03-11.
Available options:
2026-03-11 Query Parameters
Property names or IDs to include in each page's properties object. Other properties are left out. Repeat the parameter to pass more than one value, for example filter_properties=title&filter_properties=Status. Pages that aren't in a data source always return only title. Search skips names or IDs that don't exist on a page.
Body
application/json