# Search wordbook entries

Search saved words and sentences with source and page entries. An exact word query can also return its public dictionary entry without saving it. Paginated; use nextOffset for more saved entries.

- Capability ID: `vocabulary.search`
- Operation: `ielts_vocabulary_search`
- Category: 词汇
- Endpoint: `POST /api/v1/agent/capabilities/ielts_vocabulary_search`
- Authentication: Bearer Token（通过 /api/v1/agent-bindings 绑定账号）
- Required scopes: vocabulary:read
- Side effect: read
- Human documentation: https://ieltsbuddy.igopx.cn/developers/api/ielts_vocabulary_search

## Request parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `kind` | string | 否 | kind |
| `query` | string | 否 | Search saved text, meaning, or source context. A complete word also returns its public dictionary page when available, even if not saved. Empty lists entries. |
| `limit` | number | 否 | limit |
| `offset` | number | 否 | offset |

## Request example

示例用于说明请求结构；资源 ID 必须替换为当前账号检索得到的真实值。写操作只在用户要求时调用。

```bash
curl -X POST \
  'https://work.ieltsbuddy.igopx.cn/api/v1/agent/capabilities/ielts_vocabulary_search' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $IELTS_BUDDY_TOKEN" \
  --data '{"kind":"all","query":"","limit":20,"offset":0}'
```

## Request schema

```json
{
  "type": "object",
  "properties": {
    "kind": {
      "default": "all",
      "type": "string",
      "enum": [
        "all",
        "word",
        "sentence"
      ]
    },
    "query": {
      "default": "",
      "description": "Search saved text, meaning, or source context. A complete word also returns its public dictionary page when available, even if not saved. Empty lists entries.",
      "type": "string",
      "maxLength": 300
    },
    "limit": {
      "default": 20,
      "type": "integer",
      "minimum": 1,
      "maximum": 50
    },
    "offset": {
      "default": 0,
      "type": "integer",
      "minimum": 0,
      "maximum": 100000
    }
  },
  "additionalProperties": false
}
```

## Response envelope

接口结果位于 data；code 为 0 表示调用成功。


```json
{
  "code": 0,
  "data": {},
  "message": "ok"
}
```

## Errors

| HTTP | Code | Meaning |
| --- | --- | --- |
| 400 | `40001` | 请求参数不符合接口契约 |
| 401 | `40101` | 缺少或使用了无效的访问令牌 |
| 403 | `40301` | 访问令牌不包含接口所需权限 |
| 404 | `40401` | 接口或目标资源不存在 |
