使用场景

Facebook 广告资料库 API:
追踪竞品广告

以 JSON 格式拉取竞品在 Meta 广告资料库、Google 广告透明度中心和 LinkedIn 广告库中的广告:文案、素材、格式和投放日期,按条计费。

预付费,无订阅REST 或 MCP一个密钥搞定模型、数据和智能体
Facebook AdsGoogle AdsLinkedInlovelyjsonitems[0]"advertiser": "Northwind Coffee""headline": "Fresh roast, free…""started": "2026-09-28""active": true"platforms": ["fb", "ig"]"media": "video"

看清竞品在投什么广告:他们在 Meta 广告资料库中的广告文案、素材和开始投放日期,他们 Google 广告的格式、投放地区和日期,以及他们的 LinkedIn 推广活动。每个广告库都是一个数据工具。你把平时在浏览器里打开的广告库 URL 发给它,就能以 JSON 格式拿回每一条广告,按条计价。可以用脚本每周运行一次,做成持续的竞品广告监控,也可以交给你的 AI 智能体去做。

交给你的 AI 智能体

把这段提示词复制到 Claude Code、Cursor、Codex 或任何编程智能体中。它会告诉智能体文档在哪里,以及如何使用你的 API 密钥。

Track my competitors' ads (copy, creative, format and dates) from the Meta Ad Library, Google Ads Transparency Center and LinkedIn Ad Library. Use the Lovely Router data tools: each returns JSON and is billed per result.

- Docs (read first): https://lovelyrouter.com/docs/tools/find.md and https://lovelyrouter.com/docs/tools/run.md
- Plan first: POST https://lovelyrouter.com/v1/tools/suggest with `{"task": "<my task in plain words>"}` (free). It returns the tools to run in order, each with an example `input`, the `input_required` fields, an estimated cost and a ready-made `run` request. Replace the example values with my task's; if a field is unclear, read the tool with GET https://lovelyrouter.com/v1/tools/<id>. To browse instead, POST https://lovelyrouter.com/v1/tools/discover searches the catalog.
- Show me the plan and its estimated cost (`total_est_cost_usd`) before running anything large.
- Run: POST https://lovelyrouter.com/v1/tools/<id>/run with `{"input": {...}, "max_results": N}`. A 200 has the finished run with `items`; a 202 means it is still running, so poll the `poll` path until `status` is `succeeded`, `failed`, `timed_out` or `stopped`.
- Only delivered results are billed. Keep max_results small on the first run, check the output, then scale up.
- If you support MCP, connect https://lovelyrouter.com/mcp instead (Streamable HTTP, same key; https://lovelyrouter.com/docs/tools/mcp.md) and use suggest_tools, get_tool and run_tool.
- Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt.

My task: <the competitors, the countries and what to report about their ads>
01

工作原理

010203
  1. 构造广告库 URL

    像平时一样搜索 Meta 广告资料库,选择国家、投放状态并输入关键词,或者打开某个广告主的公共主页,然后复制 URL。Google 的话,在广告透明度中心打开对应的广告主或域名。LinkedIn 的话,使用广告库的搜索 URL。

  2. 运行工具

    把 URL 放在 urls 中发给 facebook-ads,或放在 startUrls 中发给 google-ads-transparency 和 linkedin-ads,并设置 max_results 上限。

  3. 持续对比

    把广告连同广告主和日期一起存下来,下周再运行一次,然后对比差异。同一个密钥下的模型还能把文案按优惠、卖点角度和行动号召分类。

02

一次请求搜索 Facebook 广告资料库

下面这次运行会收集最多 100 条与 "meal kit" 匹配、正在美国投放的广告:

curl https://lovelyrouter.com/v1/tools/facebook-ads/run \
  -H "Authorization: Bearer $LOVELY_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "input": {
      "urls": [{"url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=meal%20kit"}],
      "count": 100
    },
    "max_results": 100
  }'

items 中的每一条都是一条广告,包含素材、文案、开始投放日期和广告主。如果想追踪某个竞品而不是某个关键词,把对方的 Facebook 公共主页 URL 放进 urls 即可。一次运行也可以传入多个 URL;limitPerSource 限制每个 URL 最多取多少条广告。运行超过 60 秒仍未结束时会返回 202 和一个 poll 路径,处理方法见运行工具。

Google 工具接受广告透明度中心中某个广告主或域名的 URL:

cURL
curl https://lovelyrouter.com/v1/tools/google-ads-transparency/run \
  -H "Authorization: Bearer $LOVELY_API_KEY" \
  -H "content-type: application/json" \
  -d '{"input": {"startUrls": [{"url": "https://adstransparency.google.com/?region=US&domain=nike.com"}]}, "max_results": 50}'

它会返回每条广告的格式、文字、展示日期和投放地区。

03

工具一览

广告库工具输入返回内容
Meta 广告资料库facebook-adsurls:广告资料库搜索 URL 或公共主页 URL;limitPerSource素材、文案、开始投放日期、广告主
Google 广告透明度中心google-ads-transparencystartUrls:adstransparency.google.com 上某个广告主或域名的 URL;skipDetails格式、文字、展示日期、投放地区
LinkedIn 广告库linkedin-adsstartUrls:广告库搜索 URL 或公司主页 URL文案、格式、日期
网站流量website-trafficdomains预估月访问量、排名、流量来源、主要国家、互动数据

Tip

对于 LinkedIn,广告库搜索 URL 比公司主页 URL 更好用:它带有日期和国家筛选条件,运行也更快。对于 Google,"skipDetails": true 会列出所有广告而不逐条打开,速度更快,但部分字段会不够完整。

04

实用配方

每周竞品快照。

对每个竞品,用其公共主页 URL 运行 facebook-ads,用 ?region=US&domain=theirdomain.com 运行 google-ads-transparency,再用其广告库搜索 URL 运行 linkedin-ads。保留开始投放日期晚于上周运行的广告,把新广告推送给团队。

品类广告信息地图。

在你销售的每个国家,用品类关键词搜索 Meta 广告资料库,然后让模型按优惠方式(免费试用、折扣、保障承诺)和目标受众对文案分组。

竞品在哪里发力。

把 google-ads-transparency 返回的投放地区和日期,与 website-traffic 针对同一域名给出的流量来源和主要国家进行对比。

B2B 推广活动监测。

每月对你最接近的三个竞品运行 linkedin-ads,并用 web-fetch 读取他们的定价页,把每个推广活动和它指向的优惠对应起来。

05

交给你的智能体

把 MCP 服务器连接到 Claude Code、Cursor 或其他 MCP 客户端,然后对它说:"从 Meta 广告资料库和 Google 广告透明度中心拉取这三个品牌正在美国投放的广告,列出最近 30 天内开始投放的广告,并按优惠方式分组。每次运行都设置 max_results。" 智能体会用 suggest_tools 找到工具,用 get_tool 读取输入结构,再从你的余额中扣费运行它们。

06

费用说明

广告库工具按返回的广告条数计费,website-traffic 按网站计费并另收每次调用费。上方卡片显示的是当前价格。启动运行时会预留它的最高费用,即每次调用费加上每条结果费乘以 max_results,结束后按实际返回的结果结算。失败的运行只为结束前已交付的广告付费,因此没有任何结果的失败运行不收费。无需订阅:你只需充值一个预付费余额,模型和其他数据工具也从中支付。参阅价格。

07

常见问题

?
Facebook 广告资料库有 API 吗?+

facebook-ads 工具可以替你读取 Meta 广告资料库。发送一个广告资料库搜索 URL 或 Facebook 公共主页 URL,就能以 JSON 格式拿到每条广告的素材、文案、开始投放日期和广告主,按条计费。

能按国家筛选广告吗?+

可以,通过你发送的 URL 来筛选。在 Meta 广告资料库 URL 中设置 country=,在 Google 广告透明度中心 URL 中设置 region=;LinkedIn 则使用广告库搜索 URL,它本身就带有国家和日期筛选条件。

如何只追踪竞品的新广告?+

按计划定时运行同样的 URL,把每条广告连同开始投放日期一起保存,只保留在上次运行之后开始投放的广告。运行对象上的 max_results 上限让每次运行的费用事先就能确定。

也能看到竞品的 Google 和 LinkedIn 广告吗?+

可以。google-ads-transparency 工具相当于 Google 广告透明度中心的 API,会返回某个广告主的 Google 广告,包括格式、文字、日期和投放地区;linkedin-ads 工具会返回 LinkedIn 广告,包括文案、格式和日期。

需要 Meta 或 Google 开发者账号吗?+

不需要。这些工具使用与你调用模型相同的 API 密钥和预付费余额运行,无需另外注册账号。你只需发送公开的广告库 URL,工具会替你读取。

想了解客户如何评价这些竞品,请看社交聆听和评论监测;想了解他们的产品和价格,请看电商情报。

一个预付费密钥,搞定模型、数据和智能体

无需订阅。充值后按需使用,每笔费用都能在日志中查看。