# 从账号清单整理公众号文章

从账号清单整理公众号文章。结合微信公众号的接口合同、示例和可复核步骤，在本地验证输入与结果；真实调用保持关闭。

规范页面: https://datanavoapi.com/guides/wechat-official-account-articles/

当前为本地模拟模式；样本由程序生成，不代表平台实时数据，也不证明真实供应商的可用性。

## 任务目标

从账号清单整理公众号文章。结合微信公众号的接口合同、示例和可复核步骤，在本地验证输入与结果；真实调用保持关闭。

当前为本地模拟模式；样本由程序生成，不代表平台实时数据，也不证明真实供应商的可用性。

## 输入、目标与交付

从账号清单整理公众号文章。结合微信公众号的接口合同、示例和可复核步骤，在本地验证输入与结果；真实调用保持关闭。

输入由明确的平台、关键词或对象编号构成；交付保留原始样本、请求编号、分类结果和待核对项。任务不会在后台自行调度或无限翻页。

## 逐步执行计划

| 顺序 | 能力 | 本步骤输入 | 本步骤输出 |

| --- | --- | --- | --- |

| 1 | wechat_mp.accounts.search | query | account / items |

| 2 | wechat_mp.accounts.articles.list | id, tab | post / items |

| 3 | wechat_mp.articles.get | url | post / item |

- [微信公众号账号搜索](https://datanavoapi.com/apis/wechat_mp/accounts/search/)
- [微信公众号文章列表](https://datanavoapi.com/apis/wechat_mp/accounts/articles/list/)
- [微信公众号文章详情](https://datanavoapi.com/apis/wechat_mp/articles/get/)

## 可复制的任务提示词

请先让客户端输出计划，再由你确认每一次执行。以下提示词约束样本范围，不会替你调用外部服务。

```text
目标：从账号清单整理公众号文章
仅使用DataNavoAPI本地 demo/simulated 模式。
计划能力：wechat_mp.accounts.search → wechat_mp.accounts.articles.list → wechat_mp.articles.get
先描述参数与返回字段，给出有限请求数。
逐步运行，保留原请求编号；失败或结果未知立即停下核对。
输出表格、缺失字段和采样局限，不把虚构结果当市场事实。
```

## 生成计划、运行与导出

这个有限示例包含 3 步，全部成功的客户模拟预算为 5 TEST，匿名演示扣点为0。填写每一步所需的编号，再生成固定计划；不自动从搜索结果扩展请求。

搜索结果的 data.items[].id 可用于同平台、同对象的详情；账号编号用于账号内容，评论编号用于回复。跨步骤复用前核对对象类型，不把示例编号当作真实关联。工作台导出每步原始JSON与带来源CSV。

| 工作台字段 | 含义 | 示例 |

| --- | --- | --- |

| query | 研究关键词 | 户外咖啡 |

| step2_id | 步骤 2 · id | gh_13c97ab93ce8 |

| step3_url | 步骤 3 · url | https://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667038683&idx=1&sn=0422127e651acd7f6cf6ef7e1cff04bc |

```json
{
  "schemaVersion": 1,
  "templateId": "guide-wechat-official-account-articles",
  "runId": "00000000-0000-4000-8000-000000000001",
  "inputs": {
    "query": "户外咖啡",
    "step2_id": "gh_13c97ab93ce8",
    "step3_url": "https://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667038683&idx=1&sn=0422127e651acd7f6cf6ef7e1cff04bc"
  },
  "maxTotalCredits": 5,
  "estimatedCredits": 5,
  "priceVersion": "test-credit-v1",
  "steps": [
    {
      "id": "step-1",
      "title": "微信公众号账号搜索",
      "capability": "wechat_mp.accounts.search",
      "params": {
        "query": "户外咖啡"
      },
      "maxCredits": 1,
      "idempotencyKey": "wf:00000000-0000-4000-8000-000000000001:step-1"
    },
    {
      "id": "step-2",
      "title": "获取公众号文章列表",
      "capability": "wechat_mp.accounts.articles.list",
      "params": {
        "id": "gh_13c97ab93ce8",
        "tab": "articles"
      },
      "maxCredits": 2,
      "idempotencyKey": "wf:00000000-0000-4000-8000-000000000001:step-2"
    },
    {
      "id": "step-3",
      "title": "获取公众号文章详情",
      "capability": "wechat_mp.articles.get",
      "params": {
        "url": "https://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667038683&idx=1&sn=0422127e651acd7f6cf6ef7e1cff04bc"
      },
      "maxCredits": 2,
      "idempotencyKey": "wf:00000000-0000-4000-8000-000000000001:step-3"
    }
  ]
}
```

- [打开这个任务的工作台](https://datanavoapi.com/tools/workflow-runner/?template=guide-wechat-official-account-articles)
- [下载 Skill 指引](https://datanavoapi.com/downloads/skills/guide-wechat-official-account-articles.md)

## 验收与停止条件

- 每个结论可回到具体样本和请求编号。
- 分页只处理计划中的次数；达到范围即停止。
- 没有返回的字段标记缺失，不能由模型补写成事实。
- 外部写入、定时监控与自动充值没有在此流程中启用。

## Python 有限任务示例

默认只打印完整请求计划，不访问网络。添加 --execute-demo 后才顺序执行这些固定样本并导出带来源JSON；任一步异常立即停止，不自动翻页或扩展请求。

```python
import json
import sys
from urllib.request import ProxyHandler, Request, build_opener

steps = json.loads("[{\"capability\":\"wechat_mp.accounts.search\",\"method\":\"GET\",\"params\":{\"query\":\"户外咖啡\"}},{\"capability\":\"wechat_mp.accounts.articles.list\",\"method\":\"GET\",\"params\":{\"id\":\"gh_13c97ab93ce8\",\"tab\":\"articles\"}},{\"capability\":\"wechat_mp.articles.get\",\"method\":\"GET\",\"params\":{\"url\":\"https://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667038683&idx=1&sn=0422127e651acd7f6cf6ef7e1cff04bc\"}}]")
# Preview only by default. Run with --execute-demo to request this fixed demo sample.
print(json.dumps(steps, ensure_ascii=False, indent=2))
if sys.argv[1:] != ["--execute-demo"]:
    raise SystemExit("Preview only. No request was sent.")
opener = build_opener(ProxyHandler({}))
results = []
for step in steps:
    request = Request("https://datanavoapi.com/api/atlas-demo",
        data=json.dumps(step).encode(), method="POST",
        headers={"Content-Type": "application/json", "Origin": "https://datanavoapi.com"})
    with opener.open(request, timeout=10) as response:
        result = json.load(response)
    if result.get("meta", {}).get("mode") != "demo" or result.get("meta", {}).get("billing", {}).get("charged"):
        raise RuntimeError("Unexpected response; stop without retrying")
    results.append({"capability": step["capability"], "response": result})
# No fan-out, automatic paging or retries. Export retains each source contract.
with open("datanavo-task-results.json", "w", encoding="utf-8") as output:
    json.dump(results, output, ensure_ascii=False, indent=2)
print("Saved datanavo-task-results.json")
```

## 相关页面

- [微信公众号账号搜索](https://datanavoapi.com/apis/wechat_mp/accounts/search/)
- [微信公众号文章列表](https://datanavoapi.com/apis/wechat_mp/accounts/articles/list/)
- [微信公众号文章详情](https://datanavoapi.com/apis/wechat_mp/articles/get/)
- [微信公众号接口](https://datanavoapi.com/apis/wechat_mp/)
- [微信公众号 MCP](https://datanavoapi.com/mcp/wechat_mp/)
- [账号字段](https://datanavoapi.com/docs/objects/account/)
- [如何比较蝉妈妈、千瓜、新榜与数据 API？](https://datanavoapi.com/answers/chanmama-qiangua-newrank-api/)
- [国内社交平台如何统一接入 MCP？](https://datanavoapi.com/answers/china-social-data-mcp/)
- [如何分批整理公众号历史文章？](https://datanavoapi.com/answers/export-wechat-history-articles/)
- [怎样整理公众号文章与公开互动？](https://datanavoapi.com/answers/how-to-collect-wechat-official-account-data/)

[English](https://datanavoapi.com/en/guides/wechat-official-account-articles/)
