Provides powerful search capabilities. It can search by term, find backlinks, list tasks, or list favorited pages.
General Parameters for search types returning notes (e.g., q, backlinks_for_page_name, tasks):
include_parent_properties(optional, boolean): Defaults tofalse. If set totrue, each note item in theresultsarray will include aparent_propertiesfield. This field contains an object with aggregated properties from all direct and indirect parent notes. The structure mirrors the mainpropertiesfield. For search types that do not return notes (e.g.,favorites), this parameter has no effect.
GET /api/v1/search.php?q={term}
- Description: Performs a full-text search across note content. Also supports pagination parameters (
page,per_page). - Example URL:
/api/v1/search.php?q=meeting&include_parent_properties=true - Response (200 OK) when
include_parent_properties=true:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17{ "status": "success", "data": { "results": [ { "note_id": 42, "content": "The full content of the note mentioning the search term.", "page_id": 10, "page_name": "Project Alpha", "content_snippet": "... with the search <mark>term</mark> highlighted ...", "properties": { "status": [{"value": "TODO"}] }, "parent_properties": { "project_code": [{"value": "Alpha"}] } } ], "pagination": { "total_items": 1, "current_page": 1, "per_page": 20, "total_pages": 1 } } } - If
include_parent_propertiesisfalse(default), theparent_propertiesfield will be an empty object ({}) ornull.
The Search endpoint also supports other modes:
GET /api/v1/search.php?backlinks_for_page_name={page_name}
- Description: Finds all notes that link to the specified
page_name. Supports pagination andinclude_parent_properties. - (Response structure similar to
qsearch butcontent_snippetwill highlight the link)
GET /api/v1/search.php?tasks={status}
- Description: Finds all notes with a
{status::TODO}or{status::DONE}etc. property.statuscan beTODO,DONE, …, orALL. Supports pagination andinclude_parent_properties. - (Response structure similar to
qsearch butcontent_snippetwill highlight the status property)
GET /api/v1/search.php?favorites=true
- Description: Finds all pages that have a
{favorite::true}property. Supports pagination. (include_parent_propertiesis not applicable here as it returns pages, not notes). - Response (200 OK):
1 2 3 4 5 6 7 8 9 10 11 12 13{ "status": "success", "data": { "results": [ { "page_id": 15, "page_name": "My Favorite Project Page" // Other page fields might be present } ], "pagination": { "total_items": 1, "current_page": 1, "per_page": 20, "total_pages": 1 } } }