KNotionSearch

interface KNotionSearch

Interface for searching Notion content through the Notion API. This interface provides methods to search for pages and databases across your Notion workspace. Search results can be filtered, sorted, and paginated.

Example usage:

// Search for pages containing "meeting notes"
val pages = client.search.searchPages(
query = "meeting notes",
sort = PropertySort().apply {
timestamp("last_edited_time", "descending")
}
)

// List all databases
val databases = client.search.searchDatabases()

Functions

Link copied to clipboard
abstract suspend fun searchDatabases(query: String? = null, sort: PropertySort? = null, pagination: Pagination = Pagination()): ResultPage<Database>

Searches for databases across your Notion workspace. This method allows you to find databases by their title or other properties.

Link copied to clipboard
abstract suspend fun searchPages(query: String? = null, sort: PropertySort? = null, pagination: Pagination = Pagination()): ResultPage<Page>

Searches for pages across your Notion workspace. This method allows you to find pages by their content, title, or other properties.