获取公众号文章列表/Get WeChat MP Account Articles

WeChat MPapi

About

获取公众号文章列表/Get WeChat MP Account Articles

Documentation

获取公众号文章列表/Get WeChat MP Account Articles

[中文]

用途:

  • gh_username,返回公众号历史发文(文章 tab)的单页列表。
  • 手动翻页:首页 offset 留空 → 从响应取 next_offset(base64 游标)→ 下次请求放进 offset 取下一页;is_end 为真即末页。
  • 价格:0.01$/次
  • ⏱️ 由于微信服务器原因,本接口响应较慢,请将客户端请求超时(timeout)设置为 30 秒;timeout 设置过小会造成已扣费但收不到响应的情况。

参数:

  • username: 公众号 gh_usernamegh_…)。示例 gh_363b924965e9
  • page_size: 可选,默认 20,范围 10-20。每页文章数。
  • offset: 可选,翻页游标(base64),首页留空;翻页时传上一页响应的 next_offset。示例 CAMQChiS5KfRBiAKOJLkp9EGQABIAVgAYABwAQ==
  • item_show_type: 可选,内容栏目(对应公众号主页的「文章 / 视频 / 音频」分栏)。留空 / 0=文章(默认)、5=视频、7=音频、8=贴图。默认不传=文章,行为不变。
  • raw: 可选,默认 True。True=原始;False=精简解析。

返回:

  • 公众号文章列表(单页)及翻页游标

提示:offset 是 base64 游标(含 +/=),统一走 POST body。本接口只取单页、不自动翻页

响应结构与 JSON Path:

raw=false(精简解析,snake_case):

  • 公众号 username: $.data.biz_username
  • 是否末页(0/1): $.data.is_end
  • 本页返回文章数: $.data.count
  • 下一页游标(翻页回传 offset;末页为 null): $.data.next_offset
  • 文章列表: $.data.articles[]
  • 单篇(N 为下标):
    • 文章 appmsgid: $.data.articles[N].app_msg_id
    • 标题: $.data.articles[N].title
    • 摘要: $.data.articles[N].digest
    • 链接: $.data.articles[N].url
    • 封面: $.data.articles[N].cover(多比例 $.data.articles[N].covers
    • 发布 / 更新时间戳: $.data.articles[N].create_time / .update_time
    • 群发内位置 / 类型: $.data.articles[N].idx / .msg_type / .item_show_type
    • 图文数 / 付费标志: $.data.articles[N].pic_count / .is_paid / .is_pay_subscribe

raw=true(原始,本接口默认):

  • data 顶层字段与精简版一致(biz_username / is_end / count / next_offset),但 articles[] 为完整原始群发条目(camelCase 嵌套):
    • 单条: $.data.articles[N].appMsg(含 baseInfo / detailInfo)、$.data.articles[N].baseInfomsgId / msgType / dateTime / status
    • 图文正文在 $.data.articles[N].appMsg.detailInfo(一次群发可含多篇:头条 / 次条)
    • 翻页同样用顶层 next_offset 回传 offset。做列表展示建议直接用 raw=false,路径更干净。

[English]

Purpose:

  • Pass a gh_username to get a single page of the account's historical posts (article tab).
  • Manual paging: leave offset empty for the first page → take next_offset (base64 cursor) from the response → pass it as offset in the next request; is_end truthy means the last page.
  • Price: $0.01 per request
  • ⏱️ Due to WeChat server latency, this endpoint responds slowly; please set your client request timeout to 30 seconds — a timeout that is too small may result in being billed without receiving the response.

Parameters:

  • username: Official account gh_username (gh_…). E.g. gh_363b924965e9
  • page_size: Optional, default 20, range 10-20. Articles per page.
  • offset: Optional pagination cursor (base64), leave empty for the first page; for the next page pass next_offset from the previous response. E.g. CAMQChiS5KfRBiAKOJLkp9EGQABIAVgAYABwAQ==
  • item_show_type: Optional content tab (matches the "Articles / Videos / Audios" tabs on the account homepage). Empty / 0=articles (default), 5=videos, 7=audios, 8=image-text posts. Omitting it = articles, behavior unchanged.
  • raw: Optional, default True. True=raw; False=simplified parsing.

Return:

  • Single page of articles with pagination cursor

Tip: offset is a base64 cursor (contains +/=), hence POST body. This endpoint fetches a single page only and does not auto-paginate.

Response structure & JSON Path:

raw=false (simplified, snake_case):

  • Account username: $.data.biz_username
  • Is last page (0/1): $.data.is_end
  • Articles returned on this page: $.data.count
  • Next-page cursor (pass back as offset; null at the last page): $.data.next_offset
  • Article list: $.data.articles[]
  • Single article (N is the index):
    • Article appmsgid: $.data.articles[N].app_msg_id
    • Title: $.data.articles[N].title
    • Digest: $.data.articles[N].digest
    • URL: $.data.articles[N].url
    • Cover: $.data.articles[N].cover (multi-ratio $.data.articles[N].covers)
    • Publish / update timestamps: $.data.articles[N].create_time / .update_time
    • Position / type within the batch: $.data.articles[N].idx / .msg_type / .item_show_type
    • Image count / paid flags: $.data.articles[N].pic_count / .is_paid / .is_pay_subscribe

raw=true (raw, default for this endpoint):

  • data top-level fields match the simplified version (biz_username / is_end / count / next_offset), but articles[] are full raw batch entries (nested camelCase):
    • Per entry: $.data.articles[N].appMsg (with baseInfo / detailInfo), $.data.articles[N].baseInfo (msgId / msgType / dateTime / status)
    • Article bodies are in $.data.articles[N].appMsg.detailInfo (one batch may contain multiple articles: headline / secondary)
    • Pagination also uses top-level next_offset passed back as offset. For list display, prefer raw=false for cleaner paths.

Imported from a validated TikHub OpenAPI document. Pricing must be reviewed before enabling.

Try 获取公众号文章列表/Get WeChat MP Account Articles

Test this model in the Sandbase Playground with your own prompts.

Open in Playground

Related Models