---
title: "Search the docs"
description: "Search STOQ's docs, or read one page in full: the help centre (help.stoqapp.com, audience merchant) and the developer docs (docs.stoqapp.com, audience developer). Use for how-to and explanation questions — how a feature "
url: https://docs.stoqapp.com/v2-reference/account-help-docs/search-the-docs/
api: "API v2 reference"
method: GET
path: "/account/help_docs"
---

# Search the docs

`GET https://app.stoqapp.com/api/v2/external/account/help_docs`

Search STOQ's docs, or read one page in full: the help centre (help.stoqapp.com, audience merchant) and the developer docs (docs.stoqapp.com, audience developer). Use for how-to and explanation questions: how a feature works, how to set something up, what a setting means, how to call the API. Search first, then read the page that matches by its url before relaying step-by-step instructions; the snippets are previews.

**Note:** Pass `query` to search (at most 10 results; `limit` defaults to 10 and is capped there) or `url` to read; when both are given `url` wins, and with neither the call fails with 422 `validation_failed`. `audience` defaults to `merchant`. A page is returned in chunks of about 6,000 characters: when `truncated` is true, call again with the same `url` and `offset` set to `next_offset`. A `url` that is not a public STOQ doc fails with 422. No match is not an error: `results` is empty.

## Query parameters

- `audience` (string): Which docs to search, the help centre (merchant), the developer docs (developer) or both (all); defaults to merchant. One of: `merchant`, `developer`, `all`.
- `query` (string): Words to search the docs for. Ignored when url is given.
- `url` (string): URL of a help.stoqapp.com or docs.stoqapp.com page to read in full, usually the url of a search result.
- `limit` (integer): Most search results to return, from 1 to 10 (default 10). Ignored when reading a page.
- `offset` (integer): Character position to read a long page from; pass the next_offset a truncated page returned.

## Returns

- `results` (array of objects)
  - `title` (string): e.g. `string`
  - `url` (string): e.g. `string`
  - `source` (string): e.g. `string`
  - `snippet` (string): e.g. `string`
- `total` (integer): e.g. `1`
- `note` (string): e.g. `string`
- `url` (string): e.g. `string`
- `title` (string): e.g. `string`
- `source` (string): e.g. `string`
- `content` (string): e.g. `string`
- `truncated` (boolean): e.g. `true`
- `next_offset` (integer): e.g. `1`

Rate limit: this call costs 1 point ([rate limits](https://docs.stoqapp.com/docs/rate-limits/)).

## Examples

### Search the docs

```sh
curl "https://app.stoqapp.com/api/v2/external/account/help_docs" \
  -H "X-Auth-Token: $STOQ_API_KEY"
```

### Search the docs filtered by audience and url

```sh
curl "https://app.stoqapp.com/api/v2/external/account/help_docs?audience=merchant&url=https%3A%2F%2Fexample.com" \
  -H "X-Auth-Token: $STOQ_API_KEY"
```

## 200

Success: the requested resource.

```json
{
  "results": [
    {
      "title": "string",
      "url": "string",
      "source": "string",
      "snippet": "string"
    }
  ],
  "total": 1,
  "note": "string",
  "url": "string",
  "title": "string",
  "source": "string",
  "content": "string",
  "truncated": true,
  "next_offset": 1
}
```

## 401

Missing or invalid `X-Auth-Token`.

```json
{
  "errors": [
    "Invalid API key"
  ],
  "code": "auth_invalid",
  "details": [
    {
      "code": "auth_invalid",
      "message": "Invalid API key",
      "path": null,
      "value": null,
      "expected": null
    }
  ]
}
```

## 422

The request failed validation.

```json
{
  "errors": [
    "name is required"
  ],
  "code": "validation_failed",
  "details": [
    {
      "code": "validation_failed",
      "message": "name is required",
      "path": null,
      "value": null,
      "expected": null
    }
  ]
}
```

## 429

Rate limited: cost-weighted per token (read 1, write 2; 360 points / 60s). Check `Retry-After`.

```json
{
  "errors": [
    "Rate limit exceeded"
  ],
  "code": "rate_limited",
  "details": [
    {
      "code": "rate_limited",
      "message": "Rate limit exceeded",
      "path": null,
      "value": null,
      "expected": null
    }
  ]
}
```

