viral-app
Use this skill when you need to read or manage data through the viral.app API.
When to use
- - Query analytics (accounts, videos, KPIs, exports).
- Manage tracked entities (accounts, videos, exclusions, refresh runs).
- Manage projects and creator hub resources.
- Pull live platform data (Facebook, TikTok, Instagram, YouTube).
Quick start
- 1. Ensure
viral-app CLI is installed and available in PATH.
CODEBLOCK0
- 2. Set API key:
CODEBLOCK1
Get this key from viral.app dashboard at Settings -> API Keys.
- 3. Verify access:
CODEBLOCK2
The wrapper injects x-api-key automatically from VIRAL_API_KEY unless a header is already passed.
Inputs to collect first
- - Task type: read/report or mutate/manage resources.
- Org-scoped IDs:
orgacc_*, orgproj_*, creator/campaign/payout IDs when relevant. - Platform and entity identifiers (
facebook|tiktok|instagram|youtube, platform account/video IDs). - Time bounds (
--date-range[from], --date-range[to]) for analytics tasks. - Pagination/scope (
--per-page, filters) to keep output focused.
Command cookbook
Discover available operations:
CODEBLOCK3
Common reads:
CODEBLOCK4
Common mutations:
CODEBLOCK5
Payout mutation flow:
CODEBLOCK6
Rules for payout mutations:
- - Always call
payouts-calculate immediately before payouts-initiate. - Pass the returned
calculation payload and integrityToken into payouts-initiate unchanged. - Do not invent or recompute
integrityToken. - If using
autoApproveTalentir=true, also set acknowledgeFullPayoutLiability=true and explain the risk before executing. - Prefer review-first behavior for payout mutations unless the user explicitly asks to initiate or approve payouts.
Report templates
Use the bundled report templates when the user asks for Slack-ready summaries or ranking reports:
Rules for leaderboard-style outputs:
- - Follow the template structure unless the user explicitly asks for a different format.
- Use analytics account links for account-level leaderboard sections.
- Use tracked video detail links for video leaderboard sections.
- Keep numbers compact, for example
1.4M or 180K. - Use period-over-period trend markers where the comparison window is available.
- Prefer returning the rendered report plus the source viral.app links when useful.
Rules for Viral Video Library reports:
- - Use linked titles that point to the Viral Video Library detail page.
- Use abbreviated metrics, for example
473K or 18.2%. - Include a hashtags line for every entry.
- Use a single hook line in the form
Hook (<archetype>): text + visual + audio. - Do not use "Audio not surfaced" phrasing.
- Do not invent fields when insights are missing; use
not confidently detected.
Rules for creator payments + CPM reports:
- - Use current in-progress upcoming payouts from Creator Hub for the ranking section.
- Use Creator Hub payout links filtered by both
creatorIds and campaigns. - Compare each payout row against the most recent completed payout window for the same creator and campaign when available.
- Use current vs previous equal-length periods for org-wide KPI deltas.
- Keep payout amounts exact, view totals compact, Effective CPM to 4 decimals, and spend per video to 2 decimals.
Linking Back Into viral.app
When a user would benefit from opening the data in the product UI, include a direct viral.app app link in your response.
Default production base:
CODEBLOCK7
Rules:
- - Prefer linking to the most specific page the app actually supports.
- For tracked videos and library videos, use dedicated detail pages.
- For accounts and creators, prefer filtered list/dashboard views. The app does not currently expose a dedicated account detail page or creator detail page route.
- For multi-value filters, use comma-separated values in a single query param.
- For date ranges on analytics and creator-hub overview pages, use
df and dt with YYYY-MM-DD. - Preserve
viewMode when linking account or creator-related analytics:
-
internal
-
competitors
- INLINECODE33
Common routes:
- - Analytics overview filtered by tracked account:
CODEBLOCK8
- - Analytics accounts filtered by tracked account:
CODEBLOCK9
- - Analytics videos filtered by tracked account:
CODEBLOCK10
- - Analytics videos filtered by tracked account and date range:
CODEBLOCK11
- - Tracked video detail page:
CODEBLOCK12
- - Analytics overview filtered by creator-owned tracked accounts:
CODEBLOCK13
- - Creator Hub creators filtered by campaign:
CODEBLOCK14
- - Creator Hub creators filtered by search and include archived/inactive creators:
CODEBLOCK15
- - Creator Hub campaigns filtered by creator:
CODEBLOCK16
- - Creator Hub campaign detail page:
CODEBLOCK17
- - Creator Hub payouts filtered by creator:
CODEBLOCK18
- - Creator Hub payouts filtered by campaign:
CODEBLOCK19
- - Creator Hub upcoming payouts filtered by creator and campaign:
CODEBLOCK20
- - Other payout tabs preserve the same filters:
CODEBLOCK21
- - Viral video library filtered list:
CODEBLOCK22
- - Viral video library filtered by brand/region/minimum views:
CODEBLOCK23
- - Viral video library detail page:
CODEBLOCK24
Supported filter keys you can safely use:
- - Analytics overview/accounts/videos:
-
accounts
-
platforms
-
projects
-
contentTypes
-
viewMode
-
df
-
dt
- - Analytics overview only:
-
publicationMode
-
topVideosBy
-
topAccountsBy
-
topCreatorsBy
-
topEntity
-
topListsPerPage
-
search
-
campaigns
-
status
-
search
-
status
-
creatorIds
- - Creator Hub overview / campaign overview:
-
campaigns
-
creatorIds
-
scope
-
publicationMode
-
df
-
dt
-
creatorIds
-
campaigns
-
search
-
brandId
-
dateRange
-
sort
-
minViews
-
minOutlierFactor
-
regions
-
productTypes
-
verticals
-
formats
-
hookArchetypes
-
productDetected
-
brandDetected
- INLINECODE74
If you do not know the correct org-scoped IDs yet:
- - link to the closest filtered list you can build confidently
- say what the link shows
- avoid inventing unknown IDs or unsupported paths
Safety rules
- - Confirm intent before
POST, PUT, PATCH, or DELETE unless the user explicitly asked for that mutation. - Run
<command> --help before mutations to verify required flags and body schema. - Prefer narrow queries first (
--per-page, filters, date ranges) before broad exports. - Keep output machine-readable by default; only switch format when requested.
Troubleshooting
- -
401 UNAUTHORIZED: missing/invalid API key; verify VIRAL_API_KEY or -H "x-api-key: ..." value. - INLINECODE84 can also happen with expired/revoked keys or wrong org context.
- INLINECODE85 or retry hints: back off and retry later; inspect response headers such as
Retry-After. - Empty
data arrays: validate filters, project/account IDs, and date range constraints. - Never expose API keys in commits; rotate keys after sharing for tests.
Agent defaults
- - Output defaults to JSON (
RSH_OUTPUT_FORMAT=json unless overridden). - Auto-pagination defaults to disabled (
RSH_NO_PAGINATE=true) for predictable scripted behavior. - Summarize key metrics after reads and explicitly call out write-side effects after mutations.
viral-app
当你需要通过viral.app API读取或管理数据时,使用此技能。
使用场景
- - 查询分析数据(账号、视频、关键绩效指标、导出数据)
- 管理追踪实体(账号、视频、排除项、刷新运行)
- 管理项目和创作者中心资源
- 拉取实时平台数据(Facebook、TikTok、Instagram、YouTube)
快速开始
- 1. 确保viral-app CLI已安装并位于PATH中。
bash
viral-app --help
- 2. 设置API密钥:
bash
export VIRALAPIKEY=...
从viral.app仪表盘的设置 -> API密钥获取此密钥。
- 3. 验证访问权限:
bash
viral-app accounts-list --per-page 1
除非已传递标头,否则包装器会自动从VIRALAPIKEY注入x-api-key。
首先需要收集的输入
- - 任务类型:读取/报告或修改/管理资源
- 组织范围ID:orgacc、orgproj,以及相关的创作者/活动/付款ID
- 平台和实体标识符(facebook|tiktok|instagram|youtube,平台账号/视频ID)
- 分析任务的时间范围(--date-range[from]、--date-range[to])
- 分页/范围(--per-page、过滤器)以保持输出聚焦
命令手册
发现可用操作:
bash
viral-app --help
viral-app --help
常见读取操作:
bash
viral-app accounts-list --per-page 10
viral-app videos-list --per-page 10
viral-app analytics-get-kpis
viral-app analytics-top-videos --per-page 10
viral-app integrations-apps-list
常见修改操作:
bash
viral-app projects-create --body {name:My Project}
viral-app accounts-tracked-refresh --body {accounts:[orgacc_...]}
viral-app projects-add-to-account --body {projectId:orgproj...,accountId:orgacc...}
付款修改流程:
bash
viral-app payouts-calculate --body {campaignId:orgcamp...,creatorId:orgcre...,billingPeriodStart:2026-03-01T00:00:00.000Z,billingPeriodEnd:2026-03-31T00:00:00.000Z}
viral-app payouts-initiate --body {campaignId:orgcamp...,creatorId:orgcre...,billingPeriodStart:2026-03-01T00:00:00.000Z,billingPeriodEnd:2026-03-31T00:00:00.000Z,lineItems:[{title:Creator payout,amount:1496.62}],calculation:{...},integrityToken:...}
付款修改规则:
- - 始终在payouts-initiate之前立即调用payouts-calculate
- 将返回的calculation负载和integrityToken原封不动地传递给payouts-initiate
- 不要发明或重新计算integrityToken
- 如果使用autoApproveTalentir=true,同时设置acknowledgeFullPayoutLiability=true并在执行前解释风险
- 除非用户明确要求发起或批准付款,否则优先采用先审查后操作的行为
报告模板
当用户需要适合Slack的摘要或排名报告时,使用捆绑的报告模板:
排行榜样式输出规则:
- - 除非用户明确要求不同格式,否则遵循模板结构
- 对账号级排行榜部分使用分析账号链接
- 对视频排行榜部分使用追踪视频详情链接
- 保持数字紧凑,例如1.4M或180K
- 在比较窗口可用时使用周期对比趋势标记
- 优先返回渲染后的报告以及相关的viral.app源链接
病毒视频库报告规则:
- - 使用指向病毒视频库详情页面的链接标题
- 使用缩写指标,例如473K或18.2%
- 每个条目包含标签行
- 使用单一钩子行,格式为钩子(<原型>):文字+视觉+音频
- 不要使用音频未呈现的表述
- 当洞察缺失时不要发明字段;使用未可靠检测到
创作者付款+CPM报告规则:
- - 使用创作者中心当前进行中的即将付款用于排名部分
- 使用同时按creatorIds和campaigns筛选的创作者中心付款链接
- 将每个付款行与同一创作者和活动的最新已完成付款窗口进行比较(如可用)
- 使用当前与之前等长周期进行组织范围关键绩效指标差异
- 保持付款金额精确,视图总数紧凑,有效CPM保留4位小数,每个视频花费保留2位小数
链接回viral.app
当用户需要打开产品UI中的数据时,在回复中包含直接的viral.app应用链接。
默认生产环境基础:
text
https://viral.app/app
规则:
- - 优先链接到应用实际支持的最具体页面
- 对于追踪视频和库视频,使用专用详情页面
- 对于账号和创作者,优先使用筛选列表/仪表盘视图。应用目前不提供专用账号详情页面或创作者详情页面路由
- 对于多值筛选器,在单个查询参数中使用逗号分隔的值
- 对于分析和创作者中心概览页面的日期范围,使用df和dt,格式为YYYY-MM-DD
- 链接账号或创作者相关分析时保留viewMode:
- internal
- competitors
- all
常见路由:
text
https://viral.app/app/analytics/overview?accounts=&viewMode=internal
text
https://viral.app/app/analytics/accounts?accounts=&viewMode=internal
text
https://viral.app/app/analytics/videos?accounts=&viewMode=internal
text
https://viral.app/app/analytics/videos?accounts=&viewMode=internal&df=2026-03-01&dt=2026-03-18
text
https://viral.app/app/analytics/videos/tiktok/7491234567890123456
text
https://viral.app/app/analytics/overview?accounts=,&viewMode=all
text
https://viral.app/app/creator-hub/creators?campaigns=
- - 按搜索筛选并包含已归档/非活跃创作者的创作者中心创作者:
text
https://viral.app/app/creator-hub/creators?search=alex%40example.com&status=all
text
https://viral.app/app/creator-hub/campaigns?creatorIds=
text
https://viral.app/app/creator-hub/campaigns/
text
https://viral.app/app/creator-hub/payouts/due?creatorIds=
text
https://viral.app/app/creator-hub/payouts/due?campaigns=
text
https://viral.app/app/creator-hub/payouts/upcoming?creatorIds=&campaigns=
text
https://viral.app/app/creator-hub