Facebook API

Facebook 公司广告 API

通过公共主页 ID 或公司名称列出某家公司正在投放的 Meta 广告资料库广告(创意文案、格式、投放平台和投放日期),支持游标分页。

US$1.10/千次请求,按请求付费,无需订阅。

fMeta Ad Library
facebook.com/ads/library/?view_all_page_id=1185617869915074
Meta
United StatesiAll adsTrailhead Outdoors

Trailhead Outdoors

AdsAbout

Trailhead Outdoors

Active · Sponsored

Built from 20D ripstop nylon, the Wren 2 tent weighs 2.1 lbs and sets up in under 90 seconds. Backed by our lifetime warranty.

photo

trailheadoutdoors.com

Free returns within 60 days.

Shop Now
Library ID: 1185617869915074FBIG

Trailhead Outdoors

Active · Sponsored

Our down quilt drops to 15F and packs down to the size of a grapefruit. Made for thru hikers who count every ounce.

photo

trailheadoutdoors.com

Ships in 2 to 3 business days.

Shop Now
Library ID: 1092837465210983FBIGMSG
API 返回的内容ads[0]
{
"id": "1185617869915074",
"pageId": "281940573310482",
"pageName": "Trailhead Outdoors",
"active": true,
"startDate": 1755302400,
"endDate": 1758758400,
"currency": "USD",
"text": "Built from 20D ripstop nylon, the Wren 2 tent weighs 2.1 lbs and sets up in under 90 seconds. Backed by our lifetime warranty.",
... 还有 18 个字段
}
可用率
99.89%
30d · 442,678 次调用
请求数
443,111
30d · 按周,近 12 周
响应时间
1.5s
中位数 · 30d

价格与服务商

Facebook 公司广告 API 价格:一个 API,2 个可互换的服务商

最便宜的服务商优先响应。如果它失败,下一个会在同一次调用中接手。

你需支付
US$11.00
US$1.10/千次请求,只为实际用量付费。没有月度套餐。
有了 US$0.10 的初始余额,你的前 90 次请求免费。

试一试

一个请求获取 Facebook 公司广告

打开于
获取免费密钥
示例响应
免费运行只返回前 3 条结果。为密钥充值即可获得完整响应。

这个示例展示了 46 个字段中的 34 个。查看全部字段

{
  "found": true,
  "data": {
    "nextCursor": "AbTr8k2m9x1v7c3q",
    "totalResults": 18,
    "ads": [
      {
        "id": "1185617869915074",
        "pageId": "281940573310482",
        "pageName": "Trailhead Outdoors",
        "active": true,
        "startDate": 1755302400,
        "endDate": 1758758400,
        "currency": "USD",
        "text": "Built from 20D ripstop nylon, the Wren 2 tent weighs 2.1 lbs and sets up in under 90 seconds. Backed by our lifetime warranty.",
        "displayFormat": "DCO",
        "platforms": [
          "facebook",
          "instagram"
        ],
        "adCount": 2,
        "pageProfilePicture": "https://scontent.fbcdn.net/trailhead-profile.jpg",
        "media": [
          {
            "type": "photo",
            "url": "https://scontent.xx.fbcdn.net/v/t45.1600-4/wren-tent-creative-1.jpg",
            "width": 1080,
            "height": 1080
          }
        ],
        "caption": "trailheadoutdoors.com",
        "linkDescription": "Free returns within 60 days.",
        "pageUrl": "https://www.facebook.com/trailheadoutdoors",
        "pageCategories": [
          "Product/service",
          "Outdoor recreation"
        ],
        "pageLikes": 22400,
        "isReshared": false,
        "pageDeleted": false,
        "categories": [
          "Uncategorized"
        ],
        "title": "The 3 season tent that packs to a water bottle",
        "ctaText": "Shop Now",
        "ctaType": "SHOP_NOW",
        "linkUrl": "https://trailheadoutdoors.com/products/wren-2-tent"
      },
      {
        "id": "1092837465210983",
        "pageId": "281940573310482",
        "pageName": "Trailhead Outdoors",
        "active": true,
        "startDate": 1753488000,
        "endDate": 1759104000,
        "currency": "USD",
        "text": "Our down quilt drops to 15F and packs down to the size of a grapefruit. Made for thru hikers who count every ounce.",
        "displayFormat": "IMAGE",
        "platforms": [
          "facebook",
          "instagram",
          "messenger"
        ],
        "adCount": 1,
        "pageProfilePicture": "https://scontent.fbcdn.net/trailhead-profile.jpg",
        "media": [
          {
            "type": "photo",
            "url": "https://scontent.xx.fbcdn.net/v/t45.1600-4/trailhead-quilt-creative.jpg",
            "width": 1080,
            "height": 1350
          }
        ],
        "caption": "trailheadoutdoors.com",
        "linkDescription": "Ships in 2 to 3 business days.",
        "pageUrl": "https://www.facebook.com/trailheadoutdoors",
        "pageCategories": [
          "Product/service",
          "Outdoor recreation"
        ],
        "pageLikes": 22400,
        "isReshared": false,
        "pageDeleted": false,
        "categories": [
          "Uncategorized"
        ],
        "title": "15F down quilt, packs to a grapefruit",
        "ctaText": "Shop Now",
        "ctaType": "SHOP_NOW",
        "linkUrl": "https://trailheadoutdoors.com/products/down-quilt-15f"
      }
    ]
  }
}

完整的参数与响应参考:这个接口的每个字段、类型和示例。

参考

一个请求,一种响应结构。

你发送的每个字段和收到的每个字段,都附有真实示例。

最近验证于 2026-11-14 · 可用率和延迟按 30d 统计

请求体

JSON,POST 到这个接口。

  • companyNamestring

    Trailhead Outdoors

    要搜索的公司名称(例如 "nike")。在 Meta 广告资料库索引中精确匹配且区分大小写;没有已索引主页的广告主会返回 found:false。

  • countrystring

    用于限定结果范围的两字母国家代码。默认包含所有国家。

  • cursorstring

    上一次响应的 nextCursor 返回的不透明分页游标。

  • endDatestring

    筛选在此日期或之前有展示的广告,格式为 YYYY-MM-DD。

  • languagestring

    用于筛选广告的两字母语言代码(例如 "EN"、"ES"、"FR")。

  • mediaTypeenum

    创意媒体类型筛选。

  • pageIdstring

    公司在广告资料库中的公共主页 ID。提供 pageId 或 companyName 之一。

  • sortByenum

    recent

    排序方式:impressions(展示量从高到低,默认)或 recent(最新)。

  • startDatestring

    筛选在此日期或之后有展示的广告,格式为 YYYY-MM-DD。

  • statusenum

    广告状态筛选。默认为 ACTIVE。

你发送。 一个简短的 JSON 请求体。显示的值只是示例,请换成你自己的。

响应

JSON,每个字段一个示例值。

each addata.ads[]
  • activeboolean

    true

  • adCountinteger

    2

    Number of ads in this campaign (collation count). Null when the source does not report it.

  • captionstring

    trailheadoutdoors.com

    Caption line of the ad creative, usually the advertiser's display domain.

  • categoriesstring[]

    Ad Library categories the ad is filed under.

  • ctaTextstring

    Shop Now

    Call-to-action button label on the ad.

  • ctaTypestring

    SHOP_NOW

    Call-to-action button type on the ad, e.g. "SHOP_NOW".

  • currencystring

    USD

  • displayFormatstring

    DCO

    Populated whenever the provider has data for the entity.

  • endDateinteger

    1758758400

    Epoch seconds.

  • idstring

    1185617869915074

    Ad Library archive ID. Populated whenever the provider has data for the entity.

  • isResharedboolean

    false

    Whether the ad creative is a reshare of another post.

  • linkDescriptionstring

    Free returns within 60 days.

    Description text shown under the ad's link.

  • linkUrlstring

    https://trailheadoutdoors.com/products/wren-2-tent

    Destination URL the ad links to.

  • pageCategoriesstring[]

    Categories Facebook lists the advertising page under.

  • pageDeletedboolean

    false

    Whether the advertising page has been deleted.

  • pageIdstring

    281940573310482

    Populated whenever the provider has data for the entity.

  • pageLikesinteger

    22400

    Like count of the advertising page.

  • pageNamestring

    Trailhead Outdoors

    Populated whenever the provider has data for the entity.

  • pageProfilePicturestring

    https://scontent.fbcdn.net/trailhead-profile.jpg

    Profile picture of the advertising page. This is the advertiser's identity image, not ad creative.

  • pageUrlstring

    https://www.facebook.com/trailheadoutdoors

    Canonical Facebook URL of the advertising page.

  • platformsstring[]

    Populated whenever the provider has data for the entity.

  • startDateinteger

    1755302400

    Epoch seconds. Populated whenever the provider has data for the entity.

  • textstring

    Built from 20D ripstop nylon, the Wren 2 tent weighs 2.1 lbs and sets up in under 90 seconds. Backed by our lifetime warranty.

    Ad body text. Populated whenever the provider has data for the entity.

  • titlestring

    The 3 season tent that packs to a water bottle

    Headline of the ad creative.

each creativedata.ads[].creatives[]

One entry per card of a carousel, dynamic-product, or dynamic-creative ad, in the order Meta returns them, each with its own text and destination. Single-creative ads return an empty array. The same card images and videos also appear in media. Meta CDN media URLs are signed and expire.

  • bodystring

    Card body text.

  • captionstring

    Card display caption, usually the destination domain.

  • ctaTextstring

    Card call-to-action label (e.g. "Shop Now").

  • ctaTypestring

    Card call-to-action type (e.g. "SHOP_NOW").

  • imagestring

    Card image URL. For a video card this is the poster frame.

  • linkDescriptionstring

    Card secondary description line.

  • linkUrlstring

    Card destination URL.

  • titlestring

    Card headline.

  • videoUrlstring

    Card video file URL (HD when supplied, otherwise SD). Present only on video cards.

each mediadata.ads[].media[]

Creative attached to the ad: one element per image, video, or carousel card, in the order the ad presents them. Empty when the ad has none.

  • heightinteger

    1080

    Pixel height of the media item, when the lane reports it.

  • typestring

    photo

    One of photo, video, or gif.

  • urlstring

    https://scontent.xx.fbcdn.net/v/t45.1600-4/wren-tent-creative-1.jpg

    Image URL. For a video or GIF this is the poster/thumbnail frame.

  • videoUrlstring

    Playable video file URL. Present only for video and gif items.

  • widthinteger

    1080

    Pixel width of the media item, when the lane reports it.

datadata
  • nextCursorstring

    AbTr8k2m9x1v7c3q

    Opaque cursor for the next page of ads, or null when this lane has no more. Pass it back as cursor to continue.

  • totalResultsinteger

    18

    Total number of ads Facebook reports for the page.

top level
  • foundboolean

    true

  • reason"not_found"

    Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost.

你收到。 字段有名称、有类型,无论哪个数据源响应,结构都一样。

你在出售这个 API?查看你的接口必须返回的完整数据结构。

常见问题

关于 Facebook 公司广告 API

AnyAPI 的 Facebook 公司广告 API 只需一次 POST 请求 /v1/run/facebook.company_ads,就以统一格式的 JSON 返回 Facebook 数据。通过公共主页 ID 或公司名称列出某家公司正在投放的 Meta 广告资料库广告(创意文案、格式、投放平台和投放日期),支持游标分页。AnyAPI 会在 2 个数据源之间路由每个请求,某个数据源失败时自动切换。费用:每千次请求 US$1.10 起,以美元计价,无需订阅,也没有每月最低消费。过去 30 天,通过 AnyAPI 发起的 Facebook 公司广告 API 调用中有 99.9% 成功,响应时间中位数为 1.5 秒,共测量 442,678 次调用。

费用:每千次请求 US$1.10 起,以美元计价,无需订阅,也没有每月最低消费。你只需为一个美元钱包充值,每次调用从中扣费。部分由钱包付费的失败请求会产生处理费用,我们按成本原价转嫁,不加价;错误响应会显示收取的金额。

通过公共主页 ID 或公司名称列出某家公司正在投放的 Meta 广告资料库广告(创意文案、格式、投放平台和投放日期),支持游标分页。响应是统一格式的 JSON,外层结构与每个 AnyAPI 接口相同,所以解析另一个接口只需换一个 URL,别的都不用改。

过去 30 天,通过 AnyAPI 发起的 Facebook 公司广告 API 调用中有 99.9% 成功,响应时间中位数为 1.5 秒,共测量 442,678 次调用。这些是 AnyAPI 对经过网关的流量的自有测量,持续重新计算,并非公开承诺的服务等级目标。

可以。新的 AnyAPI 账户自带 US$0.10 免费余额,无需绑卡,足够调用 90 次 Facebook 公司广告,每次 US$0.0011。

AnyAPI 会在同一个请求中依次尝试它的 2 个数据源,从最便宜的开始,所以一个数据源宕机不会让你的调用失败。

向 https://api.getanyapi.com/v1/run/facebook.company_ads 发送 POST 请求,在 “Authorization: Bearer” 请求头中放入你的 AnyAPI 密钥,并以 JSON 请求体传入参数。同一个密钥和同一个钱包适用于所有 AnyAPI 接口。

不需要。你向一个预付费的 AnyAPI 余额充值美元,每个请求从中扣费。没有月度套餐,也没有最低消费,同一个余额可用于所有 AnyAPI 接口。

有。TypeScript 用 npm 安装 @getanyapi/sdk,Python 用 pip 安装 getanyapi。两者都用同一个密钥调用所有 AnyAPI 接口,任何 HTTP 客户端也都可以。

可以。智能体可以连接 https://api.getanyapi.com/mcp 上的 AnyAPI MCP 服务器,或者向 https://api.getanyapi.com/agent/signup 发送一次无需认证的 POST 来创建自己的免费试用密钥,再通过 HTTP 调用这个接口。