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"}'| 字段 | 类型 | 示例值 |
|---|---|---|
| 请求体 | ||
| companyName | string | "nike"要搜索的公司名称(例如 "nike")。在 Meta 广告资料库索引中精确匹配且区分大小写;没有已索引主页的广告主会返回 found:false。 |
| country | string | 用于限定结果范围的两字母国家代码。默认包含所有国家。 |
| cursor | string | 上一次响应的 nextCursor 返回的不透明分页游标。 |
| endDate | string | 筛选在此日期或之前有展示的广告,格式为 YYYY-MM-DD。 |
| language | string | 用于筛选广告的两字母语言代码(例如 "EN"、"ES"、"FR")。 |
| mediaType | enum | 创意媒体类型筛选。 |
| pageId | string | 公司在广告资料库中的公共主页 ID。提供 pageId 或 companyName 之一。 |
| sortBy | enum | "recent"排序方式:impressions(展示量从高到低,默认)或 recent(最新)。 |
| startDate | string | 筛选在此日期或之后有展示的广告,格式为 YYYY-MM-DD。 |
| status | enum | 广告状态筛选。默认为 ACTIVE。 |
| 响应 | ||
| data | object | |
| data.ads | object[] | |
| data.ads[].active | boolean | |
| data.ads[].adCount | integer | Number of ads in this campaign (collation count). Null when the source does not report it. |
| data.ads[].caption | string | Caption line of the ad creative, usually the advertiser's display domain. |
| data.ads[].categories | string[] | Ad Library categories the ad is filed under. |
| data.ads[].ctaText | string | Call-to-action button label on the ad. |
| data.ads[].ctaType | string | Call-to-action button type on the ad, e.g. "SHOP_NOW". |
| data.ads[].currency | string | |
| data.ads[].displayFormat | string | Populated whenever the provider has data for the entity. |
| data.ads[].endDate | integer | Epoch seconds. |
| data.ads[].id | string | Ad Library archive ID. Populated whenever the provider has data for the entity. |
| data.ads[].isReshared | boolean | Whether the ad creative is a reshare of another post. |
| data.ads[].linkDescription | string | Description text shown under the ad's link. |
| data.ads[].linkUrl | string | Destination URL the ad links to. |
| data.ads[].media | object[] | 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[].height | integer | Pixel height of the media item, when the lane reports it. |
| data.ads[].media[].type | string | One of photo, video, or gif. |
| data.ads[].media[].url | string | Image URL. For a video or GIF this is the poster/thumbnail frame. |
| data.ads[].media[].videoUrl | string | Playable video file URL. Present only for video and gif items. |
| data.ads[].media[].width | integer | Pixel width of the media item, when the lane reports it. |
| data.ads[].pageCategories | string[] | Categories Facebook lists the advertising page under. |
| data.ads[].pageDeleted | boolean | Whether the advertising page has been deleted. |
| data.ads[].pageId | string | Populated whenever the provider has data for the entity. |
| data.ads[].pageLikes | integer | Like count of the advertising page. |
| data.ads[].pageName | string | Populated whenever the provider has data for the entity. |
| data.ads[].pageProfilePicture | string | Profile picture of the advertising page. This is the advertiser's identity image, not ad creative. |
| data.ads[].pageUrl | string | Canonical Facebook URL of the advertising page. |
| data.ads[].platforms | string[] | Populated whenever the provider has data for the entity. |
| data.ads[].startDate | integer | Epoch seconds. Populated whenever the provider has data for the entity. |
| data.ads[].text | string | Ad body text. Populated whenever the provider has data for the entity. |
| data.ads[].title | string | Headline of the ad creative. |
| data.nextCursor | string | Opaque cursor for the next page of ads, or null when this lane has no more. Pass it back as cursor to continue. |
| data.totalResults | integer | Total number of ads Facebook reports for the page. |
| found | boolean | |
| 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. |
| 价格 | ||
| 每次请求价格 | USD | US$0.0012 |
| 价格(/千次请求) | USD | US$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 对经过网关的流量的自有测量,持续重新计算,并非公开承诺的服务等级目标。
更多接口
Facebook 的其他接口
主页/千次请求 US$1.20 起主页帖子/千次请求 US$1.20 起帖子/千次请求 US$1.20 起帖子评论/千次请求 US$1.20 起主页 Reels/千次请求 US$1.20 起广告详情/千次请求 US$1.20 起广告详情(完整版)/千次请求 US$4.62 起广告转录文本/千次请求 US$1.20 起广告搜索/千次请求 US$1.20 起评论回复/千次请求 US$1.20 起活动详情/千次请求 US$1.20 起活动/千次请求 US$1.20 起活动搜索/千次请求 US$1.20 起粉丝/千条结果 US$6.00 起小组帖子/千次请求 US$1.20 起Marketplace/千次请求 US$1.20 起Marketplace 商品/千次请求 US$1.20 起Marketplace 地点搜索/千次请求 US$1.20 起公共主页联系方式/千次请求 US$1.20 起查找公共主页/千次请求 US$9.75 起照片/千次请求 US$1.20 起帖子转录文本/千次请求 US$1.20 起主页活动/千次请求 US$1.20 起搜索公司/千次请求 US$1.20 起搜索公共主页/千条结果 US$11.18 起搜索帖子/千次请求 US$30.00 起