Facebook API

Facebook 公司广告 API

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

POST/v1/run/facebook.company_ads
可用率
94.69%
30d · 1,996 次调用
请求数
2,009
30d · 按周,近 12 周
响应时间
2.7s
中位数 · 30d

价格

一个价格,以美元计

试一试

发出你的第一个请求

打开于
获取免费密钥
示例响应
免费运行只返回前 3 条结果。为密钥充值即可获得完整响应。
{
  "data": {
    "ads": [
      {
        "active": true,
        "adCount": 12500,
        "caption": "A short example description of this item.",
        "categories": [
          "example"
        ],
        "ctaText": "A short example description of this item.",
        "ctaType": "general",
        "currency": "USD",
        "displayFormat": "example",
        "endDate": 42,
        "id": "a1b2c3d4",
        "isReshared": true,
        "linkDescription": "https://example.com/page",
        "linkUrl": "https://example.com/page",
        "media": [
          {
            "height": 42,
            "type": "general",
            "url": "https://example.com/page",
            "videoUrl": "https://example.com/page",
            "width": 1024
          }
        ],
        "pageCategories": [
          "example"
        ],
        "pageDeleted": false,
        "pageId": "a1b2c3d4",
        "pageLikes": 12500,
        "pageName": "Example title",
        "pageProfilePicture": "https://example.com/image.jpg",
        "pageUrl": "https://example.com/page",
        "platforms": [
          "example"
        ],
        "startDate": 42,
        "text": "A short example description of this item.",
        "title": "Example title"
      }
    ],
    "nextCursor": "example",
    "totalResults": 12500
  },
  "found": true,
  "reason": "not_found"
}
响应类型定义
interface FacebookCompanyAdsResponse {
  data: {
    ads: {
      active: boolean;
      adCount: number | null;
      caption?: string;
      categories?: string[];
      ctaText?: string;
      ctaType?: string;
      currency: string;
      displayFormat: string;
      endDate: number;
      id: string;
      isReshared?: boolean;
      linkDescription?: string;
      linkUrl?: string;
      media?: {
        height?: number;
        type: string;
        url: string;
        videoUrl?: string;
        width?: number;
      }[];
      pageCategories?: string[];
      pageDeleted?: boolean;
      pageId: string;
      pageLikes?: number;
      pageName: string;
      pageProfilePicture?: string;
      pageUrl?: string;
      platforms: string[];
      startDate: number;
      text: string;
      title?: string;
    }[];
    nextCursor: string | null;
    totalResults?: number;
  } | null;
  found: boolean;
  reason?: "not_found";
}

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

参考

请求、响应与价格

最近验证于 2026-09-29 · 可用率和延迟按 30d 统计
POST /v1/run/facebook.company_ads
curl -X POST https://api.getanyapi.com/v1/run/facebook.company_ads \
  -H "Authorization: Bearer $ANYAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"companyName":"nike","sortBy":"recent"}'
字段类型示例值
请求体
companyNamestring"nike"要搜索的公司名称(例如 "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。
响应
dataobject
data.adsobject[]
data.ads[].activeboolean
data.ads[].adCountintegerNumber of ads in this campaign (collation count). Null when the source does not report it.
data.ads[].captionstringCaption line of the ad creative, usually the advertiser's display domain.
data.ads[].categoriesstring[]Ad Library categories the ad is filed under.
data.ads[].ctaTextstringCall-to-action button label on the ad.
data.ads[].ctaTypestringCall-to-action button type on the ad, e.g. "SHOP_NOW".
data.ads[].currencystring
data.ads[].displayFormatstringPopulated whenever the provider has data for the entity.
data.ads[].endDateintegerEpoch seconds.
data.ads[].idstringAd Library archive ID. Populated whenever the provider has data for the entity.
data.ads[].isResharedbooleanWhether the ad creative is a reshare of another post.
data.ads[].linkDescriptionstringDescription text shown under the ad's link.
data.ads[].linkUrlstringDestination URL the ad links to.
data.ads[].mediaobject[]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.
data.ads[].media[].heightintegerPixel height of the media item, when the lane reports it.
data.ads[].media[].typestringOne of photo, video, or gif.
data.ads[].media[].urlstringImage URL. For a video or GIF this is the poster/thumbnail frame.
data.ads[].media[].videoUrlstringPlayable video file URL. Present only for video and gif items.
data.ads[].media[].widthintegerPixel width of the media item, when the lane reports it.
data.ads[].pageCategoriesstring[]Categories Facebook lists the advertising page under.
data.ads[].pageDeletedbooleanWhether the advertising page has been deleted.
data.ads[].pageIdstringPopulated whenever the provider has data for the entity.
data.ads[].pageLikesintegerLike count of the advertising page.
data.ads[].pageNamestringPopulated whenever the provider has data for the entity.
data.ads[].pageProfilePicturestringProfile picture of the advertising page. This is the advertiser's identity image, not ad creative.
data.ads[].pageUrlstringCanonical Facebook URL of the advertising page.
data.ads[].platformsstring[]Populated whenever the provider has data for the entity.
data.ads[].startDateintegerEpoch seconds. Populated whenever the provider has data for the entity.
data.ads[].textstringAd body text. Populated whenever the provider has data for the entity.
data.ads[].titlestringHeadline of the ad creative.
data.nextCursorstringOpaque cursor for the next page of ads, or null when this lane has no more. Pass it back as cursor to continue.
data.totalResultsintegerTotal number of ads Facebook reports for the page.
foundboolean
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.
价格
每次请求价格USDUS$0.0012
价格(/千次请求)USDUS$1.20

常见问题

关于 Facebook 公司广告 API

AnyAPI 的 Facebook 公司广告 API 只需一次 POST 请求 /v1/run/facebook.company_ads,就以统一格式的 JSON 返回 Facebook 数据。通过公共主页 ID 或公司名称列出某家公司正在投放的 Meta 广告资料库广告(创意文案、格式、投放平台和投放日期),支持游标分页。无论哪个数据源提供服务,AnyAPI 都返回同一套统一的 schema。费用:每千次请求 US$1.20 起,以美元计价,无需订阅,也没有每月最低消费。过去 30 天,通过 AnyAPI 发起的 Facebook 公司广告 API 调用中有 94.7% 成功,响应时间中位数为 2.7 秒,共测量 1,996 次调用。

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

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

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