---
title: "Typeahead page suggestions (typo-tolerant; role&#58; viewer+)"
method: GET
path: "/api/search/suggest"
tags: ["Search"]
---

# Typeahead page suggestions (typo-tolerant; role&#58; viewer+)

`GET /api/search/suggest`

## Request

- Base URL: `https://api.witwiki.app`
- URL: `https://api.witwiki.app/api/search/suggest`
- Auth: HTTP bearer

Ranked suggestions for a partial query, combining stemmed full-text matches on page content with trigram (fuzzy) matches on titles and paths, so a typo still finds the page. Content matches carry a snippet whose matched runs are wrapped in the plain-text sentinels ⟪ and ⟫ — never HTML. Limit defaults to 8 and is clamped to 20.

## Query parameters

- `q` string, required
- `limit` integer

## Headers

- `X-Project-ID` string

## Response `200`

Ranked suggestions, best match first

- object
  - `suggestions` Suggestion[]
    - `path` string
    - `title` string
    - `snippet` string: Content excerpt with matched runs wrapped in ⟪ and ⟫. Plain text, never HTML. Empty for title/path matches.
    - `source` 'content' | 'title': content = full-text body match; title = fuzzy title/path match

## Other responses

- `400`: Invalid input
- `403`: Authenticated but lacks the required role or scope

---

[API](https://skmtc.dev/witwiki/apis/witwiki-api.md) · [All operations](https://skmtc.dev/witwiki/apis/witwiki-api/llms.txt) · [OpenAPI document](https://skmtc.dev/witwiki/apis/witwiki-api/revisions/cc93279a2dff?raw)
