Memene API

开发文档
开发者控制台
Meme 服务查询微信文章的图片列表
Meme 服务

查询微信文章的图片列表需要认证¥0.01/次

GET/v1/meme/wechat/images

接口说明

根据微信文章的 uniqueId 查询该文章正文中包含的所有图片,每个条目都同时提供:

  • original_url:微信原始 CDN 地址(受防盗链限制,直接嵌入网页可能加载失败)
  • url:经过 i3.wp.com 代理后的可直接访问地址(推荐外部展示使用)
  • 宽高、比例分类、可用性标记等元数据

前置步骤

文章 uniqueId 的两个常见来源:

  1. 微信文章短链:形如 https://mp.weixin.qq.com/s/xekd1VlLCnt1RHkvWPbGQA 的链接, s/ 后面那一段(xekd1VlLCnt1RHkvWPbGQA)就是 uniqueId
  2. 平台内查询:通过 批量查询 AI 产品信息 等接口 获取微信类信息源时,返回项的 uniqueId 字段即可直接使用。

请求参数

  • article_unique_id:必填,目标微信文章的 uniqueId(来源同上)。 与上游保持一致使用 snake_case,避免参数转换造成歧义。
  • ratio:可选,按图片宽高比筛选,由上游做服务端筛选以缩小返回体。取值为以下五个枚举之一:
    • ratio_16_9 — 横屏宽幅(宽高比 1.70-1.85)
    • ratio_4_3 — 横屏经典(1.25-1.40)
    • ratio_1_1 — 正方(0.95-1.05)
    • ratio_3_4 — 竖屏经典(0.70-0.80)
    • other — 未命中任一区间
  • suitable:可选,按图片可用性筛选,取值为以下两个枚举之一:
    • suitable — 模型判定可作配图/封面
    • reject — 模型判定不合适(含本地预筛拦掉的图)

返回值

返回 data 数组,每一项形如:

{
  "original_url": "https://mmbiz.qpic.cn/...",
  "url": "https://i3.wp.com/mmbiz.qpic.cn/...",
  "width": 1080,
  "height": 1451,
  "ratio": "ratio_3_4",
  "suitable": "suitable",
  "format": "unknown",
  "file_size": -1,
  "position": -1,
  "wechat_file_id": "unknown"
}

字段补充说明:

  • dataStatus 反映上游处理阶段,例如 IN_TIME_PROCESSING / PROCESSED
  • 部分字段(如 file_sizepositionwidthheight)在上游尚未补全时返回 -1
  • 封面图的 wechat_file_id 通常为 cover,未识别时为 unknown

错误说明

HTTP 状态码含义
400缺少 article_unique_id 参数
401API Key 无效
402余额不足
404文章不存在(上游未收录该 uniqueId)
502上游服务暂时不可用

授权说明

  • 需要提供有效的 API Key(Bearer Token)
  • 每次调用按 unitPrice 扣除相应费用,失败时自动退还
请求头
参数类型必填说明
Authorizationstring

从 Memene API 开放平台获取的 API Key。是 Bearer Token 格式,例如:Bearer sk_memene_xxx_yyy。可以 点击此处 获取 API KEY

请求参数
参数类型必填说明
article_unique_idstring

微信文章 uniqueId,即文章短链 https://mp.weixin.qq.com/s/<uniqueId>s/ 后面的部分;也对应 wechat/query 返回项的 uniqueId 字段

ratioratio_16_9ratio_4_3ratio_1_1ratio_3_4other

可选,按图片比例筛选。取值(按宽高比区间归类):ratio_16_9 横屏宽幅 (1.70-1.85) / ratio_4_3 横屏经典 (1.25-1.40) / ratio_1_1 正方 (0.95-1.05) / ratio_3_4 竖屏经典 (0.70-0.80) / other 未命中任一区间。不传则返回全部比例

suitablesuitablereject

可选,按图片可用性筛选。取值:suitable(模型判定可作配图/封面)/ reject(模型判定不合适,含本地预筛拦掉的图)。不传则返回全部

响应结构
200

Default Response

application/json
字段类型说明
statusCodenumber

上游返回的业务状态码,成功时为 200

messagestring

上游返回的状态描述,成功时为 success

dataStatusstring

上游对该文章的处理阶段,例如 IN_TIME_PROCESSING

dataarray<WechatArticleImageItem>

图片条目数组,按上游顺序返回

original_urlstring

微信原始图片地址(mmbiz.qpic.cn 域)

urlstring

经过 i3.wp.com 代理后的可直接访问地址

widthnumber

图片宽度(像素),未知时为 -1

heightnumber

图片高度(像素),未知时为 -1

ratiostring

图片比例分类。已知取值:ratio_16_9(1.70-1.85)/ ratio_4_3(1.25-1.40)/ ratio_1_1(0.95-1.05)/ ratio_3_4(0.70-0.80)/ other(未命中任一区间)

suitablestring

图片可用性标记。已知取值:suitable(模型判定可作配图/封面)/ reject(模型判定不合适,含本地预筛拦掉的图)

formatstring

图片格式,未识别时为 unknown

file_sizenumber

文件大小(字节),未知时为 -1

positionnumber

图片在文章中的位置序号,未知时为 -1

wechat_file_idstring

微信文件 ID,封面图为 cover,未识别为 unknown

示例
json
{
  "statusCode": 200,
  "message": "success",
  "dataStatus": "IN_TIME_PROCESSING",
  "data": [
    {
      "original_url": "https://mmbiz.qpic.cn/mmbiz_png/KSQHogGW.../640?wx_fmt=png",
      "url": "https://i3.wp.com/mmbiz.qpic.cn/mmbiz_png/KSQHogGW.../640?wx_fmt=png",
      "width": 1080,
      "height": 1451,
      "ratio": "ratio_3_4",
      "suitable": "suitable",
      "format": "unknown",
      "file_size": -1,
      "position": -1,
      "wechat_file_id": "unknown"
    },
    {
      "original_url": "https://mmbiz.qpic.cn/sz_mmbiz_jpg/KSQHogGW.../0?wx_fmt=jpeg",
      "url": "https://i3.wp.com/mmbiz.qpic.cn/sz_mmbiz_jpg/KSQHogGW.../0?wx_fmt=jpeg",
      "width": -1,
      "height": -1,
      "ratio": "other",
      "suitable": "suitable",
      "format": "unknown",
      "file_size": -1,
      "position": -1,
      "wechat_file_id": "cover"
    }
  ]
}
401

Default Response

application/json
字段类型说明
errorstring
messagestring
示例
json
{
  "error": "Unauthorized",
  "message": "无效的 API Key"
}
402

Default Response

application/json
字段类型说明
errorstring
messagestring
示例
json
{
  "error": "Payment Required",
  "message": "余额不足"
}
404

Default Response

application/json
字段类型说明
errorstring
messagestring
示例
json
{
  "error": "Not Found",
  "message": "article not found"
}
502

Default Response

application/json
字段类型说明
errorstring
messagestring
示例
json
{
  "error": "Bad Gateway",
  "message": "上游服务暂时不可用"
}