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
- Ensure CLI is installed and available in .
- Set API key:
bash
export VIRAL_API_KEY="..."
Get this key from viral.app dashboard at
.
- Verify access:
bash
viral-app accounts-list --per-page 1
The wrapper injects
automatically from
unless a header is already passed.
Inputs to collect first
- Task type: read/report or mutate/manage resources.
- Org-scoped IDs: , , creator/campaign/payout IDs when relevant.
- Platform and entity identifiers (
facebook|tiktok|instagram|youtube
, platform account/video IDs).
- Time bounds (, ) for analytics tasks.
- Pagination/scope (, filters) to keep output focused.
Command cookbook
Discover available operations:
bash
viral-app --help
viral-app <command> --help
Common reads:
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
Common mutations:
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_..."}'
Payout mutation flow:
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":"..."}'
Rules for payout mutations:
- Always call immediately before .
- Pass the returned payload and into unchanged.
- Do not invent or recompute .
- If using , 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:
- Leaderboard template: assets/templates/leaderboard.md
- Leaderboard example: assets/examples/leaderboard-sample.md
- Viral Video Library template: assets/templates/viral-video-library-report.md
- Viral Video Library example: assets/examples/viral-video-library-report-sample.md
- Creator payments + CPM template: assets/templates/creator-payments-cpm-report.md
- Creator payments + CPM example: assets/examples/creator-payments-cpm-report-sample.md
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 or .
- 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 or .
- 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 .
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 and .
- 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:
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 and with .
- Preserve when linking account or creator-related analytics:
Common routes:
- Analytics overview filtered by tracked account:
text
https://viral.app/app/analytics/overview?accounts=<orgAccountId>&viewMode=internal
- Analytics accounts filtered by tracked account:
text
https://viral.app/app/analytics/accounts?accounts=<orgAccountId>&viewMode=internal
- Analytics videos filtered by tracked account:
text
https://viral.app/app/analytics/videos?accounts=<orgAccountId>&viewMode=internal
- Analytics videos filtered by tracked account and date range:
text
https://viral.app/app/analytics/videos?accounts=<orgAccountId>&viewMode=internal&df=2026-03-01&dt=2026-03-18
- Tracked video detail page:
text
https://viral.app/app/analytics/videos/tiktok/7491234567890123456
- Analytics overview filtered by creator-owned tracked accounts:
text
https://viral.app/app/analytics/overview?accounts=<orgAccountId1>,<orgAccountId2>&viewMode=all
- Creator Hub creators filtered by campaign:
text
https://viral.app/app/creator-hub/creators?campaigns=<campaignId>
- Creator Hub creators filtered by search and include archived/inactive creators:
text
https://viral.app/app/creator-hub/creators?search=alex%40example.com&status=all
- Creator Hub campaigns filtered by creator:
text
https://viral.app/app/creator-hub/campaigns?creatorIds=<orgCreatorId>
- Creator Hub campaign detail page:
text
https://viral.app/app/creator-hub/campaigns/<campaignId>
- Creator Hub payouts filtered by creator:
text
https://viral.app/app/creator-hub/payouts/due?creatorIds=<orgCreatorId>
- Creator Hub payouts filtered by campaign:
text
https://viral.app/app/creator-hub/payouts/due?campaigns=<campaignId>
- Creator Hub upcoming payouts filtered by creator and campaign:
text
https://viral.app/app/creator-hub/payouts/upcoming?creatorIds=<orgCreatorId>&campaigns=<campaignId>
- Other payout tabs preserve the same filters:
text
https://viral.app/app/creator-hub/payouts/upcoming?creatorIds=<orgCreatorId>
https://viral.app/app/creator-hub/payouts/canceled?campaigns=<campaignId>
https://viral.app/app/creator-hub/payouts/paid?creatorIds=<orgCreatorId>
- Viral video library filtered list:
text
https://viral.app/app/library/viral-videos?search=notion&dateRange=30d&sort=views
- Viral video library filtered by brand/region/minimum views:
text
https://viral.app/app/library/viral-videos?brandId=<brandId>®ions=US,GB&minViews=100000&sort=outlier
- Viral video library detail page:
text
https://viral.app/app/library/viral-videos/tiktok/7491234567890123456
Supported filter keys you can safely use:
- Analytics overview/accounts/videos:
- Analytics overview only:
- Creator Hub creators:
- Creator Hub campaigns:
- Creator Hub overview / campaign overview:
- Creator Hub payouts:
- Viral video library:
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 , , , or unless the user explicitly asked for that mutation.
- Run before mutations to verify required flags and body schema.
- Prefer narrow queries first (, filters, date ranges) before broad exports.
- Keep output machine-readable by default; only switch format when requested.
Troubleshooting
- : missing/invalid API key; verify or value.
- can also happen with expired/revoked keys or wrong org context.
- or retry hints: back off and retry later; inspect response headers such as .
- Empty 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 ( unless overridden).
- Auto-pagination defaults to disabled () for predictable scripted behavior.
- Summarize key metrics after reads and explicitly call out write-side effects after mutations.