http://localhost:3333/api/kiwi.
DQL, aggregations, and view refresh need the SQLite search backend (the default). With another backend they return
501.DQL query
Run a Dataview Query Language (DQL) query over the frontmatter index.GET /api/kiwi/query
string
required
DQL query. See query types and the DQL reference.
integer
default:"50"
Overrides the query’s own
LIMIT. Capped at 200.integer
default:"0"
Overrides the query’s own
OFFSET.string
default:"json"
json returns the structure below. table, list, count, or distinct return the result rendered as plain text (markdown) instead.string[]
Column names. Includes
_path first unless the query uses WITHOUT ID.object[]
One object per row, keyed by column name (or alias). Page rows also carry
path.integer
Rows in this response, or
-1 when has_more is true. It is not a count of all matches; use a COUNT query for that.boolean
true when more rows exist past this page.object[]
Present for
GROUP BY queries. Each group has key, count, and rows.Response
400 when q is missing or the query does not parse.
Query types
After the type, add any of these clauses:
FROM "folder/" or FROM #tag (also FROM RECORDS "<kind>" and FROM CLAIMS), WHERE <expression> (repeatable, AND-joined), SORT field ASC|DESC (repeatable), GROUP BY field, FLATTEN field, LIMIT n, and OFFSET n.
Aggregate frontmatter
Group pages by a frontmatter field and compute counts, sums, averages, minimums, and maximums.GET /api/kiwi/query/aggregate
string
required
Frontmatter field to group by, for example
status.string
default:"count"
Comma-separated calculations. Use
count, or func:field where func is avg, sum, min, or max, for example count,avg:priority.string
Only include pages whose path starts with this prefix.
object
Map from group value to an object of results keyed by calculation label (
count, avg:priority, and so on). Pages without the field are grouped under (none).Response
400 when group_by is missing or a field name or calculation is invalid.
Refresh a computed view
Re-run the query in a computed view page and rewrite its generated section if the result changed.POST /api/kiwi/view/refresh
A computed view is a markdown page with kiwi-view: true and a kiwi-query DQL string in its frontmatter. An optional kiwi-format (default table) picks how the result is rendered. Generated output sits after the <!-- kiwi:auto --> marker.
string
required
Path of the view page. You can also pass it as the
path query parameter.string
The view page path.
string
regenerated when the file was rewritten, unchanged otherwise.Response
400 when path is missing, the page is not a computed view, or its query fails.
Views are marked stale when pages change and regenerate the next time you read them through
GET /file. Call this endpoint to regenerate one immediately, for example after edits made outside KiwiFS. For saved DQL views stored in .kiwi/views/, see Views.Backlinks
List pages that link to a given page.GET /api/kiwi/backlinks
string
required
Target page path.
string
The target page.
object[]
Linking pages. Each has
path, count (number of links from that page), and relation for links that come from frontmatter fields such as supersedes or contradicts.Response
400 when path is missing. With the grep search backend, which keeps no link index, backlinks is always empty.
Link graph
Return every page and every wiki link as a node and edge list. This powers the graph view in the web UI.GET /api/kiwi/graph
This endpoint takes no parameters. The result is cached and rebuilt after writes.
object[]
One per file. Each has
path and, when the page has tags (or labels) in frontmatter, tags.object[]
One per link. Each has
source (page path), target (the raw text inside the wiki link, not resolved to a path), and relation when typed.Response