Aperçu

Search docs

GET/api/v1/search_docs
Features

LITERAL-string search over the workspace's documentation files — for an exact token you already know: an error message, a CLI flag, a config key, a regex, a file path. In 'text' mode on a project with a semantic index the literal matches are fused with the index's meaning matches (engine: "hybrid"), so a section worded differently still surfaces; without an index it matches words only (engine: "literal"). Still NOT for a question or a topic ('where do we describe…', 'find the page about…', «где у нас описано», «найди в документации») — that is search_project_docs, which takes the whole question, splits it into its parts and ranks pages by MEANING; do not hunt for an answer here mode by mode. Modes: 'text' (default — full-text with snippets, hybrid when indexed), 'grep' (regex), 'symbol' (fuzzy heading match), 'paths' (glob over file paths). Returns numbered hits {n, title, headingPath, snippet, url}: 280-character snippets, not pages — call read_project_doc for the whole page before editing it. Available to any token regardless of read/write scope.

Price — $0.00009 per call (twice what serving it costs us), charged to the workspace balance, the same as over MCP.

Also reachable by name at POST /api/v1/tools/search_docs.

Input3
Authorizationheaderrequired
Your API key, sent as Authorization: Bearer dbk_YOUR_API_KEY.Sent from your browser straight to the API — never to Docsbook, never stored.
querystring · queryrequired
What to find. For 'text'/'grep' a phrase or pattern; for 'symbol' a heading hint; for 'paths' a glob.
modestring · query
Search mode (default 'text').
path_prefixstring · query
Optional: restrict 'text'/'grep' results to files under this path prefix.
Output3
okboolean
Whether the tool itself succeeded. A tool that ran and refused — an exhausted balance, a plan restriction, a bad argument — answers 200 with ok: false: the call was made and billed, and that refusal is its answer.
resultobject
The tool's own JSON answer, already parsed — not a string to parse a second time.
Show child attributes5
modestring
text | grep | symbol | paths.
docs_languagestring
null
countnumber
resultsobject[]
{ n, title, headingPath, snippet, url, path }.
notestring
duration_msinteger
Server-side wall time for the call.
Responses
200The tool ran. Read ok to see whether it succeeded.
401Missing or invalid API key.
Example input
curl 'https://docsbook.io/api/v1/search_docs?query=<query>' \
  -H 'Authorization: Bearer dbk_YOUR_API_KEY'
Example output
{
  "ok": true,
  "result": {
    "mode": "<mode>",
    "docs_language": "<docs_language>",
    "count": 0,
    "results": [],
    "note": "<note>"
  },
  "duration_ms": 0
}

Mis à jour

Cette page vous a-t-elle été utile ?