---
title: "Get top performing accounts by metrics"
method: GET
path: "/analytics/top-accounts"
tags: ["General Analytics"]
---

# Get top performing accounts by metrics

`GET /analytics/top-accounts`

## Request

- Base URL: `https://viral.app/api/v1`
- URL: `https://viral.app/api/v1/analytics/top-accounts`
- Auth: API key in header `x-api-key`

Retrieves top performing accounts ranked by specified metrics. Includes lifetime totals (viewCount, engagementRate) and period-specific gains (viewCountInPeriod, videoCountInPeriod). Returns account analytics including follower counts, posting frequency, and performance averages. Filter by platforms, accounts, projects, and content types.

## Query parameters

- `dateRange[from]` string, required
- `dateRange[to]` string, required
- `platforms` string[], nullable: Social media platforms (facebook, instagram, tiktok, youtube, snapchat)
- `accounts` string[], nullable: Organization account IDs
- `contentTypes` string[], nullable: Content types (video, slideshow)
- `projects` string[], nullable: Organization project IDs
- `tags` string[], nullable: Tag IDs. Custom and project tags must all match (intersection); country tags and `continent:<CODE>` values combine into one geographic group satisfied by any of them. `none:<category>` values (custom/project/country/continent) match entities WITHOUT any tag of the category. Ignored when `tagGroups` is provided.
- `tagGroups` object[], nullable: Advanced tag filter: groups combine with AND; within a group `any` matches videos carrying at least one of the tags, `all` requires every tag. `none:<category>` ids match videos without any tag of the category. Takes precedence over `tags` when provided. Also accepts the compact string form `all:orgtag_a,orgtag_b;any:systag_de,continent:EU`.
  - `mode` 'any' | 'all', required: How the group's tags combine: `any` = OR, `all` = intersection.
  - `ids` string[], required: Tag IDs, including `continent:<CODE>` and `none:<category>` values.
- `viewMode` 'internal' | 'competitors' | 'all'
- `publicationMode` 'allEligible' | 'onlyPublished'
- `limit` number: Maximum number of results to return (1-100)
- `onlyPublished` boolean: Whether to only include content published within the date range
- `metric` 'viewCount' | 'likeCount' | 'commentCount' | 'shareCount' | 'bookmarkCount' | 'videoCount' | 'engagementRate' | 'averageViewsPerVideo' | 'viewCountInPeriod' | 'likeCountInPeriod' | 'commentCountInPeriod' | 'shareCountInPeriod' | 'bookmarkCountInPeriod' | 'videoCountInPeriod' | 'engagementRateInPeriod' | 'averageViewsPerVideoInPeriod': Metric to sort accounts by. Supports both lifetime totals and period-specific gains

## Response `200`

OK

- object[]: Array of top performing tracked accounts with comprehensive analytics
  - `id` string, required: Organization account ID with orgacc_ prefix. Not the same as platform account ID.
  - `platform` 'facebook' | 'instagram' | 'tiktok' | 'youtube' | 'snapchat', required: Social media platform (facebook, instagram, tiktok, youtube, snapchat)
  - `platformAccountId` string, required: Native platform account id
  - `isCompetitor` boolean, required: Whether the tracked account is marked as a competitor
  - `username` string, nullable, required: Account username/handle on the platform
  - `loadAt` string, nullable, required: Timestamp when account data was last loaded
  - `followerCount` number, nullable, required: Number of followers for this account
  - `followingCount` number, nullable, required: Number of accounts this account is following
  - `profilePictureUrl` string, nullable, required: URL to the account's profile picture
  - `displayName` string, nullable, required: Display name of the account
  - `countryCode` string, nullable, required: Country code where the account is based
  - `viewCount` number, required: Total lifetime views across all videos
  - `likeCount` number, required: Total lifetime likes across all videos
  - `commentCount` number, required: Total lifetime comments across all videos
  - `shareCount` number, required: Total lifetime shares across all videos
  - `bookmarkCount` number, required: Total lifetime bookmarks across all videos
  - `videoCount` number, required: Total number of videos published by this account
  - `averageViewsPerVideo` number, required: Average views per video across all content
  - `engagementRate` number, required: Overall engagement rate (likes+comments+shares+bookmarks)/views
  - `viralityRate` number, required: Rate of viral content based on performance thresholds
  - `latestVideoPublishedAt` string, nullable, required: Timestamp of when the latest video was published
  - `daysSinceLastPost` number, nullable, required: Number of days since the last video was published
  - `user` object, required: Internal tracking metadata for this account
    - `id` string, required: Internal user record ID
    - `platform` string, required: Platform identifier
    - `username` string, nullable, required: Username for tracking purposes
    - `maxVideos` number, required: Maximum number of videos to track for this account
    - `userId` string, required: User ID with user_ prefix
    - `orgId` string, required: Organization ID with org_ prefix
    - `createdAt` string, date-time, required: When this account tracking was created
    - `updatedAt` string, date-time, required: When this account tracking was last updated
  - `viewCountInPeriod` number, required: Total views gained during the specified date range
  - `likeCountInPeriod` number, required: Total likes gained during the specified date range
  - `commentCountInPeriod` number, required: Total comments gained during the specified date range
  - `shareCountInPeriod` number, required: Total shares gained during the specified date range
  - `bookmarkCountInPeriod` number, required: Total bookmarks gained during the specified date range
  - `videoCountInPeriod` number, required: Number of videos published during the specified date range
  - `averageViewsPerVideoInPeriod` number, required: Average views per video for content published in the period
  - `engagementRateInPeriod` number, required: Engagement rate calculated from period gains (likes+comments+shares+bookmarks)/views

## Other responses

- `400`: 400
- `401`: 401
- `402`: 402
- `404`: 404
- `408`: 408
- `429`: 429
- `500`: 500

---

[API](https://skmtc.dev/viral/apis/viral-app-api.md) · [All operations](https://skmtc.dev/viral/apis/viral-app-api/llms.txt) · [OpenAPI document](https://skmtc.dev/viral/apis/viral-app-api/revisions/31e97fa79ef1?raw)
