Skip to Content
Documents

Search a document

GET
/documents/{id}/search

Searches the same reading plan the reader uses, so each match is a sentence the reader can open at. A document never opened before is prepared first, as opening it would; that work is admitted against the user's compute limits, and this request does not wait for it.

Authorization

headerAuthorizationBearer <token>

Authorization code with S256 PKCE. Discover issuer metadata at /.well-known/oauth-authorization-server/api/auth and resource metadata at /.well-known/oauth-protected-resource/api/v1. Request the /api/v1 resource explicitly. The same token endpoint also supports the advertised OAuth device grant.

Scope: documents:read

Path Parameters

id*string
Match^[a-f0-9]{64}$

Query Parameters

q*string

Text to find. Matching ignores case, accents and runs of whitespace, and may span sentences.

Length1 <= length <= 200
limit?integer
Range1 <= value <= 200
Default20

Response Body

Matches in reading order. truncated is true when more matches exist than limit.

application/json
  1. response
truncated*boolean
data*array<>
Example Request
curl -X GET 'https://reader.example/api/v1/documents/string/search?q=string'
Example Response
{  "truncated": true,  "data": [    {      "ordinal": 0,      "segmentKey": "string",      "snippet": "string",      "matchStart": 0,      "matchEnd": 0,      "page": 0,      "webUrl": "http://example.com"    }  ]}