Statistics
Get Top Accounts
Get the highest-performing accounts by a specific 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"
}'
import requests
response = requests.post(
'https://api.ugc.inc/stats/aggregated/top-accounts',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'metric': 'followers',
'limit': 5,
'tag': 'fitness'
}
)
data = response.json()
if data['ok']:
for i, account in enumerate(data['data'], 1):
print(f"{i}. @{account['username']}: {account['followers']} followers")
const response = await fetch('https://api.ugc.inc/stats/aggregated/top-accounts', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
metric: 'followers',
limit: 5,
tag: 'fitness'
})
});
const data = await response.json();
if (data.ok) {
data.data.forEach((account, index) => {
console.log(`${index + 1}. @${account.username}: ${account.followers} followers`);
});
}
import { UGCClient } from 'ugcinc';
const client = new UGCClient({
apiKey: 'YOUR_API_KEY'
});
const response = await client.stats.getTopAccounts({
metric: 'followers',
limit: 5,
tag: 'fitness'
});
if (response.ok) {
response.data.forEach((account, index) => {
console.log(`${index + 1}. @${account.username}:`);
console.log(` Followers: ${account.followers}`);
console.log(` Views: ${account.views}`);
});
}
{
"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"
}
]
}
⌘I
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"
}'
import requests
response = requests.post(
'https://api.ugc.inc/stats/aggregated/top-accounts',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'metric': 'followers',
'limit': 5,
'tag': 'fitness'
}
)
data = response.json()
if data['ok']:
for i, account in enumerate(data['data'], 1):
print(f"{i}. @{account['username']}: {account['followers']} followers")
const response = await fetch('https://api.ugc.inc/stats/aggregated/top-accounts', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
metric: 'followers',
limit: 5,
tag: 'fitness'
})
});
const data = await response.json();
if (data.ok) {
data.data.forEach((account, index) => {
console.log(`${index + 1}. @${account.username}: ${account.followers} followers`);
});
}
import { UGCClient } from 'ugcinc';
const client = new UGCClient({
apiKey: 'YOUR_API_KEY'
});
const response = await client.stats.getTopAccounts({
metric: 'followers',
limit: 5,
tag: 'fitness'
});
if (response.ok) {
response.data.forEach((account, index) => {
console.log(`${index + 1}. @${account.username}:`);
console.log(` Followers: ${account.followers}`);
console.log(` Views: ${account.views}`);
});
}
{
"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"
}
]
}
