Search allows querying across all pages and databases that the integration has access to. Results can be filtered by object type and sorted by relevance or last edited time.
Find out more here: https://developers.notion.com/reference/post-search
search_api = client.searchSearchApi
Searches all parent or child pages and databases that have been shared with an integration. Returns results based on the query, filter, and sort parameters. Results are sorted by relevance by default but can be sorted by last_edited_time. The search indexing may not be immediate, so recently created or updated objects may not appear right away.
Find out more here: https://developers.notion.com/reference/post-search
def search(notion_version,
body: nil)This endpoint requires bearerAuth
| Parameter | Type | Tags | Description |
|---|---|---|---|
notion_version |
String |
Header, Required | The version of the Notion API to use. The current version is 2022-06-28. This header is required for all API requests. |
body |
SearchRequest |
Body, Optional | - |
200: Search results successfully returned.
This method returns an ApiResponse instance. The data property of this instance returns the response data which is of type PaginatedList.
notion_version = '2022-06-28'
body = SearchRequest.new(
page_size: 100
)
result = search_api.search(
notion_version,
body: body
)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end| HTTP Status Code | Error Description | Exception Class |
|---|---|---|
| 400 | The request was invalid or malformed. | ErrorException |
| 401 | The bearer token is missing, invalid, or the integration lacks access. | ErrorException |
| 429 | The request has been rate limited. Notion enforces rate limits of 3 requests per second for integrations. Retry after the specified delay. | ErrorException |