apify-influencer-brand-collabs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseInfluencer–Brand Collaborations
网红–品牌合作
Surface Instagram branded-content partnerships by chaining four Apify Actors against Meta's Ad
Library. Distilled from the production mini-tool.
influencer-brand-collabs通过串联四个 Apify Actor 查询 Meta Ad Library,发现 Instagram 品牌内容合作关系。整理自生产环境中的 mini-tool。
influencer-brand-collabsWhen to use
何时使用
- "Who has Nike paid to promote them this quarter?"
- "What brands does @bellahadid do sponsored posts for?"
- Auditing an account's branded-content history
- Building a competitor's influencer roster
Don't use for: organic mentions or tags (use a hashtag/mentions scraper), TikTok or YouTube
collabs (different platforms), generic competitor ads (query Meta Ad Library directly).
- “本季度 Nike 付费让谁推广自己?”
- “@bellahadid 为哪些品牌发布赞助帖子?”
- 审核某个账号的品牌内容历史
- 整理竞争对手的影响者名单
不适用于: 自然提及或标签(使用 hashtag/mentions scraper)、TikTok 或 YouTube
合作(属于其他平台)、泛指的竞争对手广告(直接查询 Meta Ad Library)。
Inputs to gather
需要收集的输入
- Instagram handle or URL — or
@adidashttps://www.instagram.com/adidas/ - Lookback window — days; default 90
- Enrichment toggles (each adds cost + time):
- Content insights — likes, comments, views per collab
- Profile enrichment — followers, bio, verified status of the other side
Direction (brand vs creator) is detected empirically. Do not ask.
- Instagram 账号名或 URL — 或
@adidashttps://www.instagram.com/adidas/ - 回溯窗口 — 天数;默认 90
- 数据增强开关(每项都会增加成本和时间):
- 内容洞察 — 每次合作的点赞数、评论数、观看数
- 资料增强 — 另一方的关注者数、简介、认证状态
方向(品牌还是创作者)根据实际数据自动检测。不要询问用户。
The pipeline
流水线
| # | Actor | Purpose | Required |
|---|---|---|---|
| 1 | | Resolve the target's Facebook | ✓ |
| 2 | | Pull branded-content posts from Meta's Ad Library | ✓ |
| 3 | | Engagement metrics | optional |
| 4 | | Enrich the result-side partners | optional |
Call each via . Use
first if you've never run one of these and want the exact input schema.
mcp__claude_ai_Apify__call-actormcp__claude_ai_Apify__fetch-actor-details| # | Actor | 用途 | 必需 |
|---|---|---|---|
| 1 | | 解析目标对象的 Facebook | ✓ |
| 2 | | 从 Meta Ad Library 拉取品牌内容帖子 | ✓ |
| 3 | | 互动指标 | 可选 |
| 4 | | 增强结果侧合作方的资料 | 可选 |
通过 调用每个 Actor。如果从未运行过其中某个 Actor,
且需要确切的输入 schema,请先使用 。
mcp__claude_ai_Apify__call-actormcp__claude_ai_Apify__fetch-actor-detailsStep 1 — Resolve the target
第 1 步——解析目标对象
jsonc
// actor: apify/instagram-profile-scraper
{ "usernames": ["adidas"] }Grab from the first item. No → can't query Ad Library → stop and tell the user.
Most common cause: private account.
fbidfbidjsonc
// actor: apify/instagram-profile-scraper
{ "usernames": ["adidas"] }从第一个项目中获取 。没有 → 无法查询 Ad Library → 停止并告知用户。
最常见的原因是账号设为私密。
fbidfbidStep 2 — Build the Meta Ad Library URL
第 2 步——构建 Meta Ad Library URL
https://www.facebook.com/ads/library/branded_content/?id={fbid}&query={username}&target=instagram&start_date={YYYY-MM-DD}&end_date={YYYY-MM-DD}Date range = the lookback window (default 90 days, ending today).
https://www.facebook.com/ads/library/branded_content/?id={fbid}&query={username}&target=instagram&start_date={YYYY-MM-DD}&end_date={YYYY-MM-DD}日期范围等于回溯窗口(默认 90 天,截止到当天)。
Step 3 — Fetch collaborations
第 3 步——获取合作记录
jsonc
// actor: apify/brand-collaboration-scraper
{ "startUrls": ["<ad library url>"], "resultsLimit": 10 }Schema is fixed: every item has (always the influencer side) and
(always the brand side). Do not try to infer direction from these fields.
creatorbrandPartners[0]jsonc
// actor: apify/brand-collaboration-scraper
{ "startUrls": ["<ad library url>"], "resultsLimit": 10 }Schema 是固定的:每个项目都有 (始终对应影响者一方)和
(始终对应品牌一方)。不要尝试根据这些字段推断方向。
creatorbrandPartners[0]Step 4 — Detect direction empirically
第 4 步——根据实际数据检测方向
Count how often the target username appears on each side of the results:
- target appears more on side → target is the influencer; results are the brands
creator - target appears more on side → target is the brand; results are the creators
brandPartners
⚠️ Do not useto infer this. It's unreliable — e.g.isBusinessAccountis a business account but appears as the creator of its own branded content.@fifaworldcup
统计目标账号名在结果两侧分别出现的次数:
- 目标账号名在 侧出现更多 → 目标是影响者;结果为品牌
creator - 目标账号名在 侧出现更多 → 目标是品牌;结果为创作者
brandPartners
⚠️ 不要使用推断方向。它并不可靠——例如,isBusinessAccount是 商业账号,但它在自己的品牌内容中显示为创作者。@fifaworldcup
Step 5 — (optional) Content metrics
第 5 步——(可选)内容指标
Split collab URLs by type:
- → reel scraper
/reel/... - or
/p/...→ post scraper/tv/...
jsonc
// actor: apify/instagram-post-scraper
{ "username": ["<post urls>"], "resultsLimit": 1, "dataDetailLevel": "basicData" }
// actor: apify/instagram-reel-scraper
{ "username": ["<reel urls>"], "resultsLimit": 1 }Match back to collabs via shortcode in the URL: .
/(p|reel|tv)/([A-Za-z0-9_-]+)Engagement formula: .
likesCount + commentsCount + (videoViewCount ?? videoPlayCount ?? 0)Run the two scrapers in parallel — they're independent.
按类型拆分合作 URL:
- → reel scraper
/reel/... - 或
/p/...→ post scraper/tv/...
jsonc
// actor: apify/instagram-post-scraper
{ "username": ["<post urls>"], "resultsLimit": 1, "dataDetailLevel": "basicData" }
// actor: apify/instagram-reel-scraper
{ "username": ["<reel urls>"], "resultsLimit": 1 }通过 URL 中的 shortcode 匹配回相应合作:。
/(p|reel|tv)/([A-Za-z0-9_-]+)互动公式: 。
likesCount + commentsCount + (videoViewCount ?? videoPlayCount ?? 0)并行运行两个 scraper——它们彼此独立。
Step 6 — (optional) Enrich the result side
第 6 步——(可选)增强结果侧资料
Collect unique usernames from the side that is not the target. Then:
jsonc
// actor: apify/instagram-profile-scraper
{ "usernames": [<unique result-side usernames>] }Only enrich the side the user actually cares about. The input handle is already known.
从非目标一侧收集所有唯一的 usernames。然后:
jsonc
// actor: apify/instagram-profile-scraper
{ "usernames": [<unique result-side usernames>] }仅增强用户真正关心的一方。输入账号的信息已经已知。
What to present
展示内容
After aggregation, surface:
- Headline counts: total collabs, unique partners, total engagement (if metrics enriched)
- Top 5 collabs by engagement — only meaningful when content insights were toggled on
- Content-type mix: Post vs Reel; Reels usually dominate engagement
- Weekly timeline across the date range — spikes reveal campaign launches
- Per-partner card (when profiles enriched): handle, full name, followers, verified, category, collabs in this run, avg engagement
For who-questions, the partner list alone is enough. Metrics only matter for
which-was-best-questions.
完成聚合后,展示:
- 核心计数: 合作总数、唯一合作方数量、总互动量(如果已进行指标增强)
- 按互动量排名前 5 的合作——仅在启用内容洞察后才有意义
- 内容类型构成: Post 与 Reel;Reel 通常占据互动量主导
- 日期范围内的每周时间线——峰值可以揭示营销活动的启动时间
- 每个合作方卡片(启用资料增强时):账号名、全名、关注者数、认证状态、类别、 本次运行中的合作数、平均互动量
对于谁类问题,仅提供合作方列表即可。只有在哪个效果最好类问题中,指标才有意义。
URL parsing
URL 解析
Strip Instagram's and deep-link prefixes before extracting the handle:
_u/_n//instagram\.com\/(?:_u\/|_n\/)?([A-Za-z0-9_.]+)/iThese slugs are not usernames — skip them:
, , , , , , , , , ,
, , .
explorereelsstoriesdirectaccountsaboutpreeltvtagslocations_u_n提取账号名前,移除 Instagram 的 和 深层链接前缀:
_u/_n//instagram\.com\/(?:_u\/|_n\/)?([A-Za-z0-9_.]+)/i以下 slug 不是账号名——应跳过:
, , , , , , , , , ,
, , 。
explorereelsstoriesdirectaccountsaboutpreeltvtagslocations_u_nPitfalls
常见问题
- Target is private → profile scraper returns no . Bail early with a clear message.
fbid - No results → try in order: widen the date range, double-check the handle (strip ), confirm the account actually runs branded content. Meta only indexes ads they've classified as branded content.
_u/ - Engagement is all zeros → user skipped content enrichment. Offer to re-run with it on.
- Direction looks wrong in the output → re-check the empirical count. Don't trust
.
isBusinessAccount - Brand collabs with no metrics are still answer-shaped for who questions — don't gate the whole flow on enrichment.
- 目标账号为私密 → profile scraper 不会返回 。立即停止并给出清晰说明。
fbid - 没有结果 → 按以下顺序重试:扩大日期范围、再次检查账号名(移除 )、 确认该账号确实发布了品牌内容。Meta 只会收录已被归类为品牌内容的广告。
_u/ - 互动量全部为零 → 用户跳过了内容增强。建议告知用户可以启用后重新运行。
- 输出中的方向有误 → 重新检查基于实际数据的计数。不要信任
。
isBusinessAccount - 没有指标的品牌合作记录仍足以回答谁类问题——不要让整个流程依赖数据增强开关。
Cost & time
成本与耗时
Full 4-actor run: ~3–5 minutes, a few cents of Apify compute. Order of magnitude:
| Enrichment | Actors run | Approx time |
|---|---|---|
| None | 2 | 1–2 min |
| + Content | 3–4 | 2–4 min |
| + Profiles | +1 | +30–60 s |
If the user just needs a partner list, skip both toggles.
完整运行 4 个 Actor:约 3–5 分钟,Apify 计算成本仅为数美分。大致量级如下:
| 数据增强 | 运行的 Actor 数 | 大约耗时 |
|---|---|---|
| 无 | 2 | 1–2 分钟 |
| + 内容 | 3–4 | 2–4 分钟 |
| + 资料 | +1 | +30–60 秒 |
如果用户只需要合作方列表,则跳过两个增强开关。
Reference implementation
参考实现
Production route this skill was distilled from:
— full transformation logic,
error handling, and slimmed display shapes for each scraper's output.
mini-tools-main/src/app/api/tools/influencer-brand-collabs/route.ts此 skill 源自以下生产环境路径:
——包含完整的转换逻辑、
错误处理,以及每个 scraper 输出的精简展示结构。
mini-tools-main/src/app/api/tools/influencer-brand-collabs/route.ts