urlstringจำเป็น
/mp.weixin.qq.com/s/WeChat MP article URL (https://mp.weixin.qq.com/s/… or long URL with __biz)
https://api.sandbase.ai/v1/api/wechat-mp/v2/article-stats-h5Get WeChat MP Article Stats (H5) on WeChat MP. Returns the platform data as structured JSON.
เอาต์พุตของคุณจะแสดงที่นี่
กรอกอินพุตให้ครบ แล้วคลิก Run
Returns comment counts and engagement stats for one WeChat official account article. It needs the article url, either the short https://mp.weixin.qq.com/s/… form or the long form with __biz.
comment_id of an article so you can pass it to a comments API.curl -X POST "https://api.sandbase.ai/v1/api/wechat-mp/v2/article-stats-h5" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://mp.weixin.qq.com/s/TSNQKkRpN1qbKsT7BvzqIw", "raw": true}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
url | string | Yes | /mp.weixin.qq.com/s/WeChat MP article URL (https://mp.weixin.qq.com/s/… or long URL with __biz) |
comment_id | string | No | Article comment id (optional, performance shortcut): when omitted, the API must fetch and parse the whole article HTML to obtain it, which accounts for about half of this endpoint's latency |
raw | boolean | No | True=raw response; False=simplified parsed structure |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"_via": "h5",
"collect_count": null,
"comment_count": 26,
"comment_raw": {
"appmsgid": "2247780992",
"comment_id": "3884868893382230017",
"elected_total": 21,
"total_count": 26
},
"debug_id": "d81634db",
"debug_info": "gAAAAABq6ZFAaqjYyv3jGWwq26w9Lb0pPyWUxjSpT707gLkGDCq1qMDl2WvffZiKB-HLCwI2aawhofkY…",
"elected_comment_count": 21,
"like_count": null,
"old_like_count": null,
"read_num": null,
"share_count": null,
"star_num": null
}
| Field | Meaning |
|---|---|
comment_count | Total number of comments on the article. It matches comment_raw.total_count. |
elected_comment_count / comment_raw.elected_total | Number of comments that were selected for display on the article. |
comment_raw.comment_id | ID of the article's comment thread. Pass it as comment_id on later calls. |
comment_raw.appmsgid | ID of the article message, returned as a string. |
read_num / like_count / old_like_count | Read and like counts. In this response they are null and listed in unavailable. |
collect_count / share_count / star_num | Other engagement counts. In this response they are null, so no value was returned for them. |
unavailable | List of stat fields that could not be filled for this article. |
_via | Shows which route returned the data. Here it is h5. |
comment_id from comment_raw.comment_id on later calls for the same article. This skips fetching the article page and shortens the response time.raw to false to get a simplified parsed structure instead of the raw response.unavailable before using a count. Fields listed there are null.$0.01 per successful call. Failed calls are not charged.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
curl -X POST "https://api.sandbase.ai/v1/api/wechat-mp/v2/article-stats-h5" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"raw": true,
"url": "https://mp.weixin.qq.com/s/TSNQKkRpN1qbKsT7BvzqIw"
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
urlstringจำเป็น/mp.weixin.qq.com/s/WeChat MP article URL (https://mp.weixin.qq.com/s/… or long URL with __biz)
rawbooleanTrue=raw response; False=simplified parsed structure
ค่าเริ่มต้น: true
comment_idstringArticle comment id (optional, performance shortcut): when omitted, the API must fetch and parse the whole article HTML to obtain it, which accounts for about half of this endpoint's latency
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
ยังไม่มีการเผยแพร่การตอบกลับที่บันทึกไว้ ให้รัน API ใน Playground เพื่อดูการตอบกลับ
สำรวจเพิ่มเติม
| API | ราคา | การตอบกลับ |
|---|---|---|
WeChat MP Article Stats (H5)API นี้ WeChat MP | $0.01 ต่อการเรียก | JSON |
WeChat MP | $0.01 ต่อการเรียก | JSON |
WeChat MP | $0.01 ต่อการเรียก | JSON |
WeChat MP | $0.01 ต่อการเรียก | JSON |
WeChat MP | $0.01 ต่อการเรียก | JSON |
WeChat MP | $0.01 ต่อการเรียก | JSON |
คำถาม
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/wechat-mp/v2/article-stats-h5 โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
$0.01 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
ที่ต้องระบุ: url (string). ตัวเลือก: raw (boolean) และ comment_id (string). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ
ไม่จำเป็น WeChat MP Article Stats (H5) ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง WeChat MP API แยกต่างหาก