---
title: "Search page text for a word or phrase"
method: GET
path: "/api/v1/sites/{slug}/search"
tags: ["Content"]
---

# Search page text for a word or phrase

`GET /api/v1/sites/{slug}/search`

## Request

- Base URL: `https://api.dotsy.ai`
- URL: `https://api.dotsy.ai/api/v1/sites/{slug}/search`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Finds the pages whose text contains a literal word or phrase, without reading any bodies. It searches the draft. Regular expressions are not supported. The result is not paged: `truncated` says whether more pages matched than `limit`. Search needs the site's search and collections feature; a site without it answers 503 `search_unavailable`.

## Path parameters

- `slug` string, required

## Query parameters

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

## Response `200`

The matching pages.

- SearchContentResponse
  - `q` string, required: The query, trimmed.
  - `matches` object[], required
    - `key` string, required: The content key.
    - `snippet` string, required: A short excerpt around the match.
  - `truncated` boolean, required: True when more pages match than `limit` allowed. There is no cursor: narrow the query.

## Other responses

- `400`: `missing_query`, `query_too_long` (with `maxLen`), or `regex_unsupported`.
- `401`: Missing or invalid credentials.
- `403`: The key or token cannot read this site.
- `404`: No such site (`not_found`).
- `503`: Search is not enabled for this site (`search_unavailable`).

---

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