---
document_id: agent.collection.task.wechat_search_articles_v2
schema_version: 2
parent_document_id: agent.querying
section: querying
---

<!-- Generated by scripts.build_agent_guide; do not edit. -->

# Search articles / 搜索文章

Search WeChat Official Account articles by keyword using the current supported sort and time-range contract. For one article's full content use wechat_mp_article_detail_v1; for an official account's historical articles use wechat_mp_account_articles_v1.

按关键词搜索微信公众号文章，使用当前支持的排序和时间范围契约。要取某篇文章的完整内容用 wechat_mp_article_detail_v1；要取公众号历史文章列表用 wechat_mp_account_articles_v1。

Task / 任务: `wechat_search_articles_v2`
Platform / 平台: WeChat Official Account / 微信公众号
Billing / 计费: 3 Credits per successful task / 每个成功任务 3 Credits
Estimate / 估价: call `estimate_collection`; start directly when `approval_required=false`, otherwise obtain approval for `upper_bound_credits`.
估价：调用 `estimate_collection`；`approval_required=false` 时直接启动，否则请用户确认 `upper_bound_credits`。

## Limitations / 限制

- 只返回文章，不返回视频、商品或账号推荐卡片。
- 支持 latest、relevance、hot 三种排序；relevance 发送给上游时使用 default。
- 支持 all、day、week、half_year 四种发布时间范围；不支持 month 或 year。
- 有下一页时把返回的 next_cursor 原样传回 cursor。
- 新令牌有效期 24 小时，绑定访问身份、关键词、排序和时间范围；过期后重新搜索。续页状态异常明确报错，不表示已取完。

## Inputs / 输入

- `source` — Search source / 搜索来源; kind=text; required=True; default='wechat'; bounds=min_length=2, max_length=64
- `search_mode` — Search mode / 搜索模式; kind=select; required=True; default='text'; allowed=text
- `query` — Query / 搜索词; kind=text; required=False; default=None; bounds=min_length=1, max_length=100
- `filters` — Filters / 筛选条件; kind=object; required=False; default={}
- `page` — Page / 页码; kind=integer; required=False; default=1; bounds=min=1, max=50
- `page_size` — Page size / 每页条数; kind=integer; required=False; default=None; bounds=min=1, max=50
- `page_token` — Page token / 续页令牌; kind=cursor; required=False; default=''; bounds=max_length=8192
- `filters.sort` — sort / sort; kind=text; required=False; default=''; allowed=hot, latest, relevance
- `filters.time_range` — time_range / time_range; kind=text; required=False; default=''; allowed=all, day, half_year, week

## Minimal call / 最小调用

`estimate_collection`

```json
{
  "task_query": "搜索微信公众号上关于扫地机器人的文章（使用当前搜索契约）",
  "task_code": "wechat_search_articles_v2",
  "input": {
    "source": "wechat",
    "search_mode": "text",
    "query": "扫地机器人",
    "page": 1,
    "page_token": ""
  }
}
```


## Result and pagination / 结果与分页

- mode=cursor
- input: `page_token`; continuation: `data.has_more` → `data.next_cursor`

Only the fields listed below are part of the stable result contract. /
只有下方列出的字段属于稳定结果契约。

## Result fields / 结果字段

- `meta.request_id` — type=string; Asklear request identifier for tracing. / 用于追踪的 Asklear 请求 ID。
- `meta.api_name` — type=string; Executed collection operation name. / 实际执行的采集操作名称。
- `meta.latency_ms` — type=integer; Collection execution latency in milliseconds. / 采集执行耗时（毫秒）。
- `meta.credits_charged` — type=integer; Asklear user-side Credits settled for this task after completion. / 任务完成后 Asklear 用户侧实际结算的 Credits。
- `data.items` — type=array<object>; Official-account articles returned by this page. / 本页返回的公众号文章。
- `data.item_count` — type=integer; Number of articles in this page. / 本页文章数。
- `data.has_more` — type=boolean; Whether another page is available with a safe continuation token. / 是否还有下一页且已返回可安全使用的续页令牌。
- `data.next_cursor` — type=string|null; Continuation token to pass back to this task when has_more is true. / has_more 为 true 时传回本任务的续页令牌。
- `data.items[].article_id` — type=string; Article identifier. / 文章 ID。
- `data.items[].title` — type=string|null; Article title. / 文章标题。
- `data.items[].summary` — type=string|null; Article summary. / 文章摘要。
- `data.items[].url` — type=string|null; Public article URL. / 公开文章 URL。
- `data.items[].cover` — type=string|null; Article cover URL when safe to publish. / 安全可公开时的文章封面 URL。
- `data.items[].published_at` — type=integer|null; Publication time as Unix seconds. / 以 Unix 秒表示的发布时间。
- `data.items[].account_id` — type=string|null; Official-account identifier. / 公众号 ID。
- `data.items[].account_name` — type=string|null; Official-account display name. / 公众号名称。

Use `list_collection_tasks` as the runtime authority, then `describe_collection_task` for one task's full input contract, examples and limits. Collection access is entitlement-gated. /
以 `list_collection_tasks` 返回为运行时准据，再用 `describe_collection_task` 取单个任务的完整入参契约、示例与限制；采集能力受 entitlement 控制。
