Ads
搜索 Meta 广告资料库,或列出某个广告主在 Facebook、Instagram、Messenger 和 Audience Network 上投放的全部广告。
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)都可搭配使用。
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
adType | enum | all (default), or one special category: political (social issues, elections or politics), housing, employment, credit. all political housing employment credit | |
advertiser | string list | The 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. | |
country | string | Where the ads ran: an ISO 3166-1 alpha-2 code, or ALL (default). | |
cursor | string | Opaque cursor from the previous page's cursor. Pass it alone for the next page. | |
endDate | string | Only ads that started running on or before this day (YYYY-MM-DD). | |
exact | boolean | query: match the exact phrase instead of any of its words. | |
languages | string list | Only ads in these languages (ISO 639-1). | |
mediaType | enum | all (default), image, video, meme, image_and_meme, none. all image video meme image_and_meme none | |
platforms | string list | Only ads that ran on these platforms. | |
query | string | Keywords to search the Ad Library for. | |
sort | enum | relevance (default), or impressions (highest first; Facebook states impressions for political ads). relevance impressions | |
startDate | string | Only ads that started running on or after this day (YYYY-MM-DD). | |
status | enum | active (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"
}
}
}错误
| 状态 | 代码 | 含义 |
|---|---|---|
| 400 | INVALID_CURSOR | 该 cursor 不是本操作返回的。请不带它重新开始。 |
| 400 | INVALID_PARAMS | 参数缺失、未知或超出范围。消息中会指出是哪一个。 |
| 401 | UNAUTHORIZED | 缺少 x-api-key 请求头,或密钥已吊销或未知。 |
| 402 | INSUFFICIENT_CREDITS | 积分不足以支付本次调用。请在控制台选择套餐或充值。 |
| 429 | MARKETPLACE_SATURATED | 并发调用过多。请等待 Retry-After 秒后重试。 |
| 502 | UPSTREAM_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。