Skip to main content

Endpoint

POST https://api.ugc.inc/stats/aggregated/top-accounts

Overview

Get the top N accounts ranked by a specific metric (followers, following, views, or likes). Uses the latest statistics for each account. Perfect for displaying leaderboards and identifying best-performing accounts.

Request Body

metric
string
required
The metric to sort by. One of: followers, following, views, likes
limit
number
Number of accounts to return. Default: 5. Maximum: 100.
accountIds
string[]
Array of account IDs to filter. Omit to include all accounts.
tag
string
Filter by account tag
org_group
string
Filter by organization group
user_group
string
Filter by user group

Response

data
TopAccount[]
Array of top accounts sorted by the requested metric
curl -X POST https://api.ugc.inc/stats/aggregated/top-accounts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "metric": "followers",
    "limit": 5,
    "tag": "fitness"
  }'
{
  "ok": true,
  "code": 200,
  "message": "Success",
  "data": [
    {
      "account_id": "acc_123456",
      "username": "fitness_guru",
      "nick_name": "Fitness Guru",
      "pfp_url": "https://example.com/avatar.jpg",
      "type": "tiktok",
      "tag": "fitness",
      "followers": 125000,
      "following": 342,
      "views": 5600000,
      "likes": 420000,
      "created_at": "2024-01-15T10:00:00Z"
    },
    {
      "account_id": "acc_789012",
      "username": "workout_daily",
      "nick_name": "Daily Workouts",
      "pfp_url": "https://example.com/avatar2.jpg",
      "type": "tiktok",
      "tag": "fitness",
      "followers": 98500,
      "following": 289,
      "views": 3200000,
      "likes": 280000,
      "created_at": "2024-01-15T10:00:00Z"
    }
  ]
}