Skip to content

Full-text search across an EPUB's chapters

GET
/assets/{id}/epub/search

Scans every spine chapter for the query (case-insensitive), returning up to 5 hits per chapter and 200 hits total. Each hit carries the chapter idx (jump target), a label (display), a snippet (~60 chars on each side of the match), and the character offset inside the plain-text chapter body (future use when EpubView grows in-page anchor jump).

id
required
string format: uuid
q
required
string
>= 1 characters

Query string. Case-insensitive substring match against each chapter’s stripped-text body. Queries shorter than two characters return an empty list (avoids degenerate single-character spam).

Search hits (may be empty)

Array<object>

One match returned by the EPUB full-text search endpoint. Multiple hits per chapter are possible (capped at 5).

object
chapter_idx
required
integer
chapter_label
required
string
snippet
required

~120 char excerpt centred on the match.

string
char_offset
required

Char offset of the match in the plain-text chapter body.

integer

Authentication required, missing, or invalid

object
error
required

Human-readable error summary

string
Example
the request could not be completed
Example
{
"error": "authentication required: sign in and retry with a valid session or API token"
}

Resource not found

object
error
required

Human-readable error summary

string
Example
the request could not be completed

Unexpected server error

object
error
required

Human-readable error summary

string
Example
the request could not be completed