# 公众号文章链接里的 mid、idx、sn 是什么意思？

公众号文章长链接里，除了代表公众号的 __biz，还有 mid（文章所在的那次群发）、idx（它在这次群发里排第几篇）和 sn（校验参数）。四个齐全，链接才完整。 DataXAPI 有 8 个微信公众号接口，一次 $0.0200 起，失败不收费。

## 每个参数

`idx`：一次群发可以带好几篇文章，`idx` 是这篇排第几。微信官方文档里，消息推送的 `Idx` 是“多图文时第几篇文章，从1开始”，留言接口的 `index` 是“第几篇图文，从0开始”，起点不一样，用的时候看清是哪一种。

`mid`：据公开的开源项目说明，是那次群发的消息编号。微信官方接口里，一次群发叫 `msg_data_id`，但“链接里的 mid 就是 msg_data_id”没有官方原文。有个开源导出工具把它叫 `appmsgid`，把篇序叫 `itemidx`。

`sn`：校验参数。据公开的开源项目说明，`__biz`、`mid`、`idx`、`sn` 四个齐全，才能拿去取文章的阅读数。DataXAPI 实录的链接里，`sn` 是 32 位十六进制；没有它，微信不打开文章。

## DataXAPI 收什么

`wechat_mp.articles.metrics` 只收四个参数齐全的长链接，比如 `https://mp.weixin.qq.com/s?__biz=<Base64>&mid=<数字>&idx=2&sn=<32 位十六进制>`（占位写法，这里是一次群发的第二篇）。`wechat_mp.articles.get` 和 `wechat_mp.articles.comments.list` 也收 `/s/` 开头的短链接。

在 `sn` 之前被截断、或者 `sn` 不是 32 位十六进制的长链接，会在发出请求前被拒绝，不扣费。`wechat_mp.accounts.articles.list` 返回的都是长链接，可以原样传给互动数据接口。

## 用到的接口

- [微信公众号文章互动数据](https://dataxapi.com/zh/apis/wechat_mp/articles/metrics/) ($0.0200 / 一次): 按文章长链接取这篇公众号文章此刻的数字：阅读、点赞、推荐、分享、收藏、评论。
- [微信公众号文章详情](https://dataxapi.com/zh/apis/wechat_mp/articles/get/) ($0.0200 / 一次): 按文章链接取一篇公众号文章：标题、正文、发布时间、公众号的名称和编号。
- [微信公众号文章评论](https://dataxapi.com/zh/apis/wechat_mp/articles/comments/list/) ($0.0200 / 一次): 按文章链接取一页公众号文章的精选评论：正文、评论者、点赞数、回复数、发布时间、IP 属地。
- [微信公众号文章列表](https://dataxapi.com/zh/apis/wechat_mp/accounts/articles/list/) ($0.0200 / 一次): 按公众号原始编号取一页它发布的文章，从新到旧：标题、摘要、链接、发布时间。

## 怎么做

- [如何获取公众号文章阅读数和点赞数](https://dataxapi.com/zh/guides/wechat-article-reads-and-likes/)

## 出处

本页写到的别家的价格和功能，都来自对方自己的页面和文档，读取于 2026-10-29。价格和功能会变，做决定前请以出处为准。

- [微信开发文档：接收普通消息（Idx）](https://developers.weixin.qq.com/doc/subscription/guide/product/message/Receiving_standard_messages.html)
- [微信开发文档：查看留言（index）](https://developers.weixin.qq.com/doc/subscription/api/leaving/api_listcomment.md)
- [wechat-article-exporter（开源项目）：文章字段](https://github.com/wechat-article/wechat-article-exporter/blob/master/types/types.d.ts#L112-L117)
- [wechat_articles_spider（开源项目）：链接校验](https://github.com/wnma3mz/wechat_articles_spider/blob/master/wechatarticles/ArticlesInfo.py#L46-L49)

## 微信公众号的更多内容

- [微信公众号 API](https://dataxapi.com/zh/apis/wechat_mp/)
- [公众号文章能用 API 读取吗？](https://dataxapi.com/zh/answers/is-there-an-api-for-wechat-official-account-articles/)
- [视频号数据怎么获取？](https://dataxapi.com/zh/answers/how-to-get-wechat-channels-data/)
- [公众号文章链接里的 __biz 是什么？](https://dataxapi.com/zh/answers/wechat-official-account-biz/)
- [公众号原始 ID（gh_ 开头）是什么？](https://dataxapi.com/zh/answers/wechat-official-account-original-id/)
- [视频号的 …@finder 账号编号和 export 编号是什么？](https://dataxapi.com/zh/answers/wechat-channels-finder-id/)
- [如何获取公众号历史文章列表](https://dataxapi.com/zh/guides/wechat-official-account-articles/)
- [如何获取视频号视频评论](https://dataxapi.com/zh/guides/wechat-channels-video-comments/)
- [如何获取视频号账号的全部作品](https://dataxapi.com/zh/guides/wechat-channels-user-videos/)
- [如何用接口查微信搜一搜的结果](https://dataxapi.com/zh/guides/wechat-search-posts/)

---

目录修订号 5c3194deef3264cc。 [网页版](https://dataxapi.com/zh/answers/wechat-article-link-mid-idx-sn/)
