Parse a search query
const url = 'https://example.com/api/v1/search/parse?q=example';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/api/v1/search/parse?q=example'Parses a search query. It requires a signed-in User with the data scope. It can return 400 if the request is invalid, 401 if the session is missing or expired and 403 if access is denied. Route: /api/v1/search/parse. Inputs: q. Safe reads can use bounded retries.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Text to search for.
Responses
Section titled “Responses”Parsed search words and filters
The parsed form of a search query. This shape is the cross-client contract for operators; clients can use it to render removable filter pills.
object
Filters in query order. Repeated filters are preserved.
A tag that must match exactly.
object
A result type from the search grammar.
object
An absolute or natural date expression.
object
A path relative to one of the caller’s allowed roots.
object
A result state such as todo, done, shared, favorite, or a Notes
link-health state.
object
A person who created the result.
object
A person associated with the result.
object
A file extension without a leading dot.
object
A file-size comparison in bytes.
object
Direction for a size filter.
A result with a selected content kind or Notes reference form.
object
Plain words and quoted phrases, in query order.
Example
{ "filters": [ { "operator": "tag" } ]}Invalid search query
The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}