Apinoa Docs

Ads

搜索 Meta 广告资料库,或列出某个广告主在 Facebook、Instagram、Messenger 和 Audience Network 上投放的全部广告。

查看原始 .mdx
GET | POST /v1/meta-ads/ads

参数可以用 GET 的查询字符串发送,也可以用 POST 的 JSON 正文发送,两者等效。

请求

curl "https://gateway.apinoa.com/v1/meta-ads/ads?advertiser=15087023444&status=all" \
  -H "x-api-key: $APINOA_API_KEY"

传入内容

传入读取内容说明
query匹配关键词的广告exact 只匹配完整短语
advertiser某个广告主投放的全部广告广告主的 id,来自 advertisers 或广告的 advertiser.id
query + advertiser匹配关键词、且仅限这些广告主的广告最多 10 个 id,用逗号分隔

传入 query、advertiser 或两者。筛选条件(country、status、adType、mediaType、platforms、languages、startDate、endDate、sort)都可搭配使用。

参数

参数类型必填说明
adTypeenumall (default), or one special category: political (social issues, elections or politics), housing, employment, credit. all political housing employment credit
advertiserstring listThe advertiser's id, as advertisers returns it (or an ad's advertiser.id): every ad it runs. With query, up to 10 ids, comma-separated, narrow the keyword search to those advertisers.
countrystringWhere the ads ran: an ISO 3166-1 alpha-2 code, or ALL (default).
cursorstringOpaque cursor from the previous page's cursor. Pass it alone for the next page.
endDatestringOnly ads that started running on or before this day (YYYY-MM-DD).
exactbooleanquery: match the exact phrase instead of any of its words.
languagesstring listOnly ads in these languages (ISO 639-1).
mediaTypeenumall (default), image, video, meme, image_and_meme, none. all image video meme image_and_meme none
platformsstring listOnly ads that ran on these platforms.
querystringKeywords to search the Ad Library for.
sortenumrelevance (default), or impressions (highest first; Facebook states impressions for political ads). relevance impressions
startDatestringOnly ads that started running on or after this day (YYYY-MM-DD).
statusenumactive (default), inactive or all. active inactive all

这些参数及所有响应类型也写在OpenAPI 文档中。

响应

在 data 中返回 AdPage。 真实响应的节选:数组只保留前几项,长文本已截断。

{
  "success": true,
  "data": {
    "library": "meta-ads",
    "items": [
      {
        "library": "meta-ads",
        "id": "1702938977100376",
        "url": "https://www.facebook.com/ads/library/?id=1702938977100376",
        "advertiser": {
          "id": "15087023444",
          "name": "Nike",
          "url": "https://www.facebook.com/nike/",
          "avatarUrl": "https://scontent-bos5-1.xx.fbcdn.net/v/t39.35426-6/431756959_71287105437…",
          "ext": {
            "likes": 39488420,
            "categories": [
              "Sportswear",
              "Product/service"
            ]
          }
        },
        "format": "DPA",
        "title": "{{product.name}}",
        "text": "Bring sports more fully into your day with the Nike App.",
        "linkUrl": "http://itunes.apple.com/app/id1095459556",
        "ctaText": "Install now",
        "images": [],
        "videos": [],
        "cards": [
          {
            "title": "Nike Run Swift 3 Women's Road Running Shoes",
            "text": "Bring sports more fully into your day with the Nike App.",
            "linkUrl": "https://www.nike.com/ph/t/run-swift-3-road-running-shoes-2fHbzp/DR2698-0…",
            "ctaText": "Install Now",
            "image": {
              "url": "https://scontent-bos5-1.xx.fbcdn.net/v/t39.35426-6/431679131_94921416663…",
              "ext": {
                "resizedUrl": "https://scontent-bos5-1.xx.fbcdn.net/v/t39.35426-6/431679131_94921416663…"
              }
            },
            "ext": {
              "caption": "itunes.apple.com",
              "linkDescription": "₱3,995",
              "ctaType": "INSTALL_MOBILE_APP"
            }
          },
          {
            "title": "Nike Invincible 3 Women's Road Running Shoes",
            "text": "Bring sports more fully into your day with the Nike App.",
            "linkUrl": "https://www.nike.com/ph/t/invincible-3-road-running-shoes-LL61DX/DR2660-…",
            "ctaText": "Install Now",
            "image": {
              "url": "https://scontent-bos5-1.xx.fbcdn.net/v/t39.35426-6/431631323_92872743202…",
              "ext": {
                "resizedUrl": "https://scontent-bos5-1.xx.fbcdn.net/v/t39.35426-6/431631323_92872743202…"
              }
            },
            "ext": {
              "caption": "itunes.apple.com",
              "linkDescription": "₱9,895",
              "ctaType": "INSTALL_MOBILE_APP"
            }
          }
        ],
        "firstShownAt": "2025-04-07T07:00:00.000Z",
        "lastShownAt": "2026-11-07T08:00:00.000Z",
        "ext": {
          "active": true,
          "platforms": [
            "facebook",
            "instagram"
          ],
          "caption": "itunes.apple.com",
          "ctaType": "INSTALL_MOBILE_APP",
          "has_user_reported": false,
          "gated_type": "ELIGIBLE",
          "is_aaa_eligible": false,
          "regional_regulation_data": {
            "finserv": {
              "is_deemed_finserv": false,
              "is_limited_delivery": false
            },
            "tw_anti_scam": {
              "is_limited_delivery": false
            }
          },
          "hide_data_status": "NONE",
          "snapshot": {
            "is_reshared": false
          }
        }
      }
    ],
    "cursor": "FBe_2wsngLShai3Nb8Z3btwLqnQCPM5mfHmg_xoJDSWCYQpot_7Bie7WzcRR96xHrpnClTN0…",
    "total": 15646,
    "ext": {
      "searchType": "page",
      "countries": [
        "ALL"
      ],
      "status": "all",
      "adType": "all",
      "mediaType": "all",
      "advertiser": "15087023444"
    }
  }
}

错误

状态代码含义
400INVALID_CURSOR该 cursor 不是本操作返回的。请不带它重新开始。
400INVALID_PARAMS参数缺失、未知或超出范围。消息中会指出是哪一个。
401UNAUTHORIZED缺少 x-api-key 请求头,或密钥已吊销或未知。
402INSUFFICIENT_CREDITS积分不足以支付本次调用。请在控制台选择套餐或充值。
429MARKETPLACE_SATURATED并发调用过多。请等待 Retry-After 秒后重试。
502UPSTREAM_ERROR资料库返回了无法使用的内容。请退避后重试。

全部错误代码见 Errors。失败的调用不计费。

价格

价格 每次调用 1 积分。套餐与积分

说明

  • total 是匹配的广告数,与广告资料库所示完全一致。超过 50,000 时它只说明不少于该数,此时返回 totalRange({"lower": 50000})。
  • 社会议题、选举或政治类广告(adType=political)还带有以范围({text, lower, upper})表示的 spend、impressions、reach,以及 currency 和出资方(paidBy)。
  • country 是一个 ISO 3166-1 alpha-2 代码,或 ALL(默认)。startDate 和 endDate 限定广告开始投放的日期。
  • 每条广告的 ext 包含只有 Meta 给出的信息:active、platforms(投放位置)、adId、activeSeconds、创意的 caption、linkDescription 和 ctaType、出资方披露的其余部分(disclaimer:标签、Meta 核实出资方的方式、联系方式)、collationId 和 collationCount(Meta 归为同一创意的广告)、sensitive,以及广告资料库发送的其他所有字段(保留原名)。广告主的 ext 含 likes、categories、广告投放时使用的名称(nameInAd)和 deleted;图片和视频在各自的 ext 中保留 Meta 的其他副本(resizedUrl、watermarkedUrl、sdUrl 等)。
  • 响应的 ext 是广告资料库实际应用的搜索条件。
  • 要获取下一页,只传 cursor。

本页内容