WeChat-Media-Platform-V2-API

获取公众号文章广告/Get WeChat MP Article Ads

Changed on

[中文]

用途:

  • 传文章 URL,返回文章内嵌的广告位信息。该接口响应相对较慢,请耐心等待;未投放广告的文章返回空。
  • 价格:0.01$/次
  • ⏱️ 由于微信服务器原因,本接口响应较慢,请将客户端请求超时(timeout)设置为 30 秒;timeout 设置过小会造成已扣费但收不到响应的情况。

参数:

  • url: 公众号文章链接。示例 https://mp.weixin.qq.com/s/TSNQKkRpN1qbKsT7BvzqIw(该文无广告,返回空)
  • raw: 可选,默认 True。True=完整原始响应;False=拍平后的广告列表。

返回:

  • 文章广告位信息

响应结构与 JSON Path:

raw=false(精简投影):

  • data 为拍平后的广告列表:
    • $.data.count: 广告条数(合并 advertisement_info 与 ad_slot_data)
    • $.data.ads[]: 广告项列表(无广告时为 [])

raw=true(原始):

  • data 按抓到的响应聚合:
    • $.data.pages: 响应页数
    • $.data.results[]: 每页完整原始响应(广告原始字段在各页的 advertisement_info / ad_slot_data 内,即精简模式 ads 的来源)

[English]

Purpose:

  • Pass an article URL to get the embedded ad slot info of the article. This endpoint responds relatively slowly, please be patient; articles without ads return empty.
  • 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:

  • url: WeChat MP article URL. E.g. https://mp.weixin.qq.com/s/TSNQKkRpN1qbKsT7BvzqIw (this article has no ads, returns empty)
  • raw: Optional, default True. True=full raw response; False=flattened ad list.

Return:

  • Article ad slot info

Response structure & JSON Path:

raw=false (simplified projection):

  • data is the flattened ad list:
    • $.data.count: number of ads (merged from advertisement_info and ad_slot_data)
    • $.data.ads[]: ad item list ([] when no ads)

raw=true (raw):

  • data is aggregated by the responses captured:
    • $.data.pages: number of response pages
    • $.data.results[]: full raw response per page (raw ad fields are inside advertisement_info / ad_slot_data of each page — the source of ads in simplified mode)
post/api/v1/wechat_mp/v2/fetch_article_ad

Request

  • Base URL
    https://api.tikhub.io (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Request body

urlstring required

公众号文章链接(https://mp.weixin.qq.com/s/… 或带 __biz 的长链)/WeChat MP article URL (https://mp.weixin.qq.com/s/… or long URL with __biz)

rawboolean

True=原始响应;False=精简解析结构/True=raw response; False=simplified parsed structure

Example request

{
  "url": "https://mp.weixin.qq.com/s/TSNQKkRpN1qbKsT7BvzqIw"
}

Response

Successful Response

codeinteger

HTTP status code | HTTP状态码

request_idstring nullable

Unique request identifier | 唯一请求标识符

messagestring

Response message (EN-US) | 响应消息 (English)

message_zhstring

Response message (ZH-CN) | 响应消息 (中文)

supportstring

Support message | 支持消息

timestring

The time the response was generated | 生成响应的时间

time_stampinteger

The timestamp the response was generated | 生成响应的时间戳

time_zonestring

The timezone of the response time | 响应时间的时区

docsstring nullable

Link to the API Swagger documentation for this endpoint | 此端点的 API Swagger 文档链接

cache_messagestring nullable

Cache message (EN-US) | 缓存消息 (English)

cache_message_zhstring nullable

Cache message (ZH-CN) | 缓存消息 (中文)

cache_urlstring nullable

The URL to access the cached result | 访问缓存结果的 URL

routerstring

The endpoint that generated this response | 生成此响应的端点

paramsunknown
dataunknown

Changes