apify-influencer-brand-collabs

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Influencer–Brand Collaborations

网红–品牌合作

Surface Instagram branded-content partnerships by chaining four Apify Actors against Meta's Ad Library. Distilled from the production
influencer-brand-collabs
mini-tool.
通过串联四个 Apify Actor 查询 Meta Ad Library,发现 Instagram 品牌内容合作关系。整理自生产环境中的
influencer-brand-collabs
mini-tool。

When 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

需要收集的输入

  1. Instagram handle or URL —
    @adidas
    or
    https://www.instagram.com/adidas/
  2. Lookback window — days; default 90
  3. 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.
  1. Instagram 账号名或 URL —
    @adidas
    或
    https://www.instagram.com/adidas/
  2. 回溯窗口 — 天数;默认 90
  3. 数据增强开关(每项都会增加成本和时间):
    • 内容洞察 — 每次合作的点赞数、评论数、观看数
    • 资料增强 — 另一方的关注者数、简介、认证状态
方向(品牌还是创作者)根据实际数据自动检测。不要询问用户。

The pipeline

流水线

#ActorPurposeRequired
1
apify/instagram-profile-scraper
Resolve the target's Facebook
fbid
✓
2
apify/brand-collaboration-scraper
Pull branded-content posts from Meta's Ad Library✓
3
apify/instagram-post-scraper
+
apify/instagram-reel-scraper
Engagement metricsoptional
4
apify/instagram-profile-scraper
(again)
Enrich the result-side partnersoptional
Call each via
mcp__claude_ai_Apify__call-actor
. Use
mcp__claude_ai_Apify__fetch-actor-details
first if you've never run one of these and want the exact input schema.
#Actor用途必需
1
apify/instagram-profile-scraper
解析目标对象的 Facebook
fbid
✓
2
apify/brand-collaboration-scraper
从 Meta Ad Library 拉取品牌内容帖子✓
3
apify/instagram-post-scraper
+
apify/instagram-reel-scraper
互动指标可选
4
apify/instagram-profile-scraper
(再次运行)
增强结果侧合作方的资料可选
通过
mcp__claude_ai_Apify__call-actor
调用每个 Actor。如果从未运行过其中某个 Actor, 且需要确切的输入 schema,请先使用
mcp__claude_ai_Apify__fetch-actor-details
。

Step 1 — Resolve the target

第 1 步——解析目标对象

jsonc
// actor: apify/instagram-profile-scraper
{ "usernames": ["adidas"] }
Grab
fbid
from the first item. No
fbid
→ can't query Ad Library → stop and tell the user.
Most common cause: private account.
jsonc
// actor: apify/instagram-profile-scraper
{ "usernames": ["adidas"] }
从第一个项目中获取
fbid
。没有
fbid
→ 无法查询 Ad Library → 停止并告知用户。
最常见的原因是账号设为私密。

Step 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
creator
(always the influencer side) and
brandPartners[0]
(always the brand side). Do not try to infer direction from these fields.
jsonc
// actor: apify/brand-collaboration-scraper
{ "startUrls": ["<ad library url>"], "resultsLimit": 10 }
Schema 是固定的:每个项目都有
creator
(始终对应影响者一方)和
brandPartners[0]
(始终对应品牌一方)。不要尝试根据这些字段推断方向。

Step 4 — Detect direction empirically

第 4 步——根据实际数据检测方向

Count how often the target username appears on each side of the results:
  • target appears more on
    creator
    side → target is the influencer; results are the brands
  • target appears more on
    brandPartners
    side → target is the brand; results are the creators
⚠️ Do not use
isBusinessAccount
to infer this. It's unreliable — e.g.
@fifaworldcup
is a business account but appears as the creator of its own branded content.
统计目标账号名在结果两侧分别出现的次数:
  • 目标账号名在
    creator
    侧出现更多 → 目标是影响者;结果为品牌
  • 目标账号名在
    brandPartners
    侧出现更多 → 目标是品牌;结果为创作者
⚠️ 不要使用
isBusinessAccount
推断方向。它并不可靠——例如,
@fifaworldcup
是 商业账号,但它在自己的品牌内容中显示为创作者。

Step 5 — (optional) Content metrics

第 5 步——(可选)内容指标

Split collab URLs by type:
  • /reel/...
    → reel scraper
  • /p/...
    or
    /tv/...
    → post scraper
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/...
    → reel scraper
  • /p/...
    或
    /tv/...
    → post scraper
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
_u/
and
_n/
deep-link prefixes before extracting the handle:
/instagram\.com\/(?:_u\/|_n\/)?([A-Za-z0-9_.]+)/i
These slugs are not usernames — skip them:
explore
,
reels
,
stories
,
direct
,
accounts
,
about
,
p
,
reel
,
tv
,
tags
,
locations
,
_u
,
_n
.
提取账号名前,移除 Instagram 的
_u/
和
_n/
深层链接前缀:
/instagram\.com\/(?:_u\/|_n\/)?([A-Za-z0-9_.]+)/i
以下 slug 不是账号名——应跳过:
explore
,
reels
,
stories
,
direct
,
accounts
,
about
,
p
,
reel
,
tv
,
tags
,
locations
,
_u
,
_n
。

Pitfalls

常见问题

  • Target is private → profile scraper returns no
    fbid
    . Bail early with a clear message.
  • No results → try in order: widen the date range, double-check the handle (strip
    _u/
    ), confirm the account actually runs branded content. Meta only indexes ads they've classified as branded content.
  • 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
    。立即停止并给出清晰说明。
  • 没有结果 → 按以下顺序重试:扩大日期范围、再次检查账号名(移除
    _u/
    )、 确认该账号确实发布了品牌内容。Meta 只会收录已被归类为品牌内容的广告。
  • 互动量全部为零 → 用户跳过了内容增强。建议告知用户可以启用后重新运行。
  • 输出中的方向有误 → 重新检查基于实际数据的计数。不要信任
    isBusinessAccount
    。
  • 没有指标的品牌合作记录仍足以回答谁类问题——不要让整个流程依赖数据增强开关。

Cost & time

成本与耗时

Full 4-actor run: ~3–5 minutes, a few cents of Apify compute. Order of magnitude:
EnrichmentActors runApprox time
None21–2 min
+ Content3–42–4 min
+ Profiles+1+30–60 s
If the user just needs a partner list, skip both toggles.
完整运行 4 个 Actor:约 3–5 分钟,Apify 计算成本仅为数美分。大致量级如下:
数据增强运行的 Actor 数大约耗时
无21–2 分钟
+ 内容3–42–4 分钟
+ 资料+1+30–60 秒
如果用户只需要合作方列表,则跳过两个增强开关。

Reference implementation

参考实现

Production route this skill was distilled from:
mini-tools-main/src/app/api/tools/influencer-brand-collabs/route.ts
— full transformation logic, error handling, and slimmed display shapes for each scraper's output.
此 skill 源自以下生产环境路径:
mini-tools-main/src/app/api/tools/influencer-brand-collabs/route.ts
——包含完整的转换逻辑、 错误处理,以及每个 scraper 输出的精简展示结构。