Selecting the right TikTok creators for brand partnerships requires more than follower counts. Engagement rate, content consistency, audience fit, and growth trajectory all matter. This tutorial builds a scoring pipeline using the Scavio TikTok API that evaluates creators on multiple dimensions and produces a composite partnership score. Each creator evaluation costs 2-3 credits ($0.010-0.015).
Prerequisites
- Python 3.9+ installed
- requests library installed
- A Scavio API key from scavio.dev
- A list of TikTok creator usernames to evaluate
Walkthrough
Step 1: Fetch creator profile data
Pull profile information for each creator including follower count, following count, total likes, and bio. This gives baseline metrics.
import requests, os
API_KEY = os.environ['SCAVIO_API_KEY']
TT_URL = 'https://api.scavio.dev/api/v1/tiktok'
def get_creator_profile(username: str) -> dict:
resp = requests.post(f'{TT_URL}/user/info',
headers={'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'},
json={'username': username})
resp.raise_for_status()
user = resp.json().get('data', {}).get('user', {})
stats = resp.json().get('data', {}).get('stats', {})
return {
'username': username,
'nickname': user.get('nickname', ''),
'bio': user.get('signature', ''),
'verified': user.get('verified', False),
'followers': stats.get('followerCount', 0),
'following': stats.get('followingCount', 0),
'likes': stats.get('heartCount', 0),
'videos': stats.get('videoCount', 0),
}
# Test with a creator
profile = get_creator_profile('charlidamelio')
for key, val in profile.items():
print(f' {key}: {val}')Step 2: Analyze recent content engagement
Search for the creator's recent videos and calculate engagement metrics. High engagement relative to followers signals an active, engaged audience.
def analyze_engagement(username: str, video_count: int = 10) -> dict:
resp = requests.post(f'{TT_URL}/search/videos',
headers={'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'},
json={'keyword': f'@{username}', 'count': video_count, 'cursor': 0})
videos = resp.json().get('data', {}).get('videos', [])
if not videos:
return {'engagement_rate': 0, 'avg_views': 0, 'videos_analyzed': 0}
total_engagement = 0
total_views = 0
for v in videos:
stats = v.get('stats', {})
views = stats.get('playCount', 0)
likes = stats.get('diggCount', 0)
comments = stats.get('commentCount', 0)
shares = stats.get('shareCount', 0)
total_views += views
total_engagement += likes + comments + shares
avg_views = total_views / len(videos)
engagement_rate = (total_engagement / total_views * 100) if total_views > 0 else 0
return {
'engagement_rate': round(engagement_rate, 2),
'avg_views': int(avg_views),
'total_engagement': total_engagement,
'videos_analyzed': len(videos)
}
engagement = analyze_engagement('charlidamelio')
for key, val in engagement.items():
print(f' {key}: {val}')Step 3: Compute the composite creator score
Combine profile metrics and engagement data into a single 0-100 partnership score. Weight engagement rate most heavily since it predicts campaign performance.
def score_creator(username: str) -> dict:
profile = get_creator_profile(username)
engagement = analyze_engagement(username)
# Engagement rate score (0-40 points) - most important
er = engagement['engagement_rate']
if er >= 5:
er_score = 40
elif er >= 3:
er_score = 30
elif er >= 1:
er_score = 20
else:
er_score = er * 20
# Follower tier score (0-25 points)
followers = profile['followers']
if followers >= 1_000_000:
follower_score = 25 # mega
elif followers >= 100_000:
follower_score = 22 # macro
elif followers >= 10_000:
follower_score = 20 # micro (often best ROI)
elif followers >= 1_000:
follower_score = 15 # nano
else:
follower_score = 5
# Content volume score (0-20 points)
videos = profile['videos']
volume_score = min(videos / 50 * 20, 20)
# Verified bonus (0-15 points)
verified_score = 15 if profile['verified'] else 0
total = round(er_score + follower_score + volume_score + verified_score, 1)
return {
'username': username,
'score': total,
'tier': 'mega' if followers >= 1_000_000 else 'macro' if followers >= 100_000 else 'micro' if followers >= 10_000 else 'nano',
'engagement_rate': er,
'followers': followers,
'avg_views': engagement['avg_views'],
'credits_used': 2
}Step 4: Score and rank a batch of creators
Evaluate multiple creators and rank them by score. Export the results for your brand partnership team.
import time
def evaluate_creators(usernames: list) -> list:
scored = []
for username in usernames:
try:
result = score_creator(username)
scored.append(result)
print(f' [{result["score"]:5.1f}] @{username} ({result["tier"]}) '
f'ER:{result["engagement_rate"]}% '
f'Followers:{result["followers"]:,}')
except Exception as e:
print(f' [ERROR] @{username}: {e}')
time.sleep(0.5)
scored.sort(key=lambda x: -x['score'])
total_credits = sum(c['credits_used'] for c in scored)
print(f'\nEvaluated {len(scored)} creators')
print(f'Credits used: {total_credits} (${total_credits * 0.005:.3f})')
return scored
creators = ['charlidamelio', 'khaby.lame', 'addisonre']
results = evaluate_creators(creators)Python Example
import requests, os, time
API_KEY = os.environ['SCAVIO_API_KEY']
TT = 'https://api.scavio.dev/api/v1/tiktok'
def score_creator(username):
profile = requests.post(f'{TT}/user/info',
headers={'Authorization': f'Bearer {API_KEY}', 'Content-Type': 'application/json'},
json={'username': username}).json().get('data', {})
stats = profile.get('stats', {})
followers = stats.get('followerCount', 0)
videos_resp = requests.post(f'{TT}/search/videos',
headers={'Authorization': f'Bearer {API_KEY}', 'Content-Type': 'application/json'},
json={'keyword': f'@{username}', 'count': 10, 'cursor': 0})
videos = videos_resp.json().get('data', {}).get('videos', [])
total_eng = sum(v.get('stats', {}).get('diggCount', 0) + v.get('stats', {}).get('commentCount', 0)
for v in videos)
total_views = sum(v.get('stats', {}).get('playCount', 0) for v in videos)
er = (total_eng / total_views * 100) if total_views > 0 else 0
return {'username': username, 'followers': followers, 'engagement_rate': round(er, 2)}
for u in ['charlidamelio', 'khaby.lame']:
r = score_creator(u)
print(f'@{r["username"]}: {r["followers"]:,} followers, {r["engagement_rate"]}% ER')
time.sleep(0.5)JavaScript Example
const API_KEY = process.env.SCAVIO_API_KEY;
const TT = 'https://api.scavio.dev/api/v1/tiktok';
async function scoreCreator(username) {
const profile = await fetch(`${TT}/user/info`, {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ username })
}).then(r => r.json());
const stats = profile.data?.stats || {};
const videos = await fetch(`${TT}/search/videos`, {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ keyword: `@${username}`, count: 10, cursor: 0 })
}).then(r => r.json());
const vids = videos.data?.videos || [];
const views = vids.reduce((s, v) => s + (v.stats?.playCount || 0), 0);
const eng = vids.reduce((s, v) => s + (v.stats?.diggCount || 0) + (v.stats?.commentCount || 0), 0);
return { username, followers: stats.followerCount || 0, er: views ? (eng/views*100).toFixed(2) : 0 };
}
scoreCreator('charlidamelio').then(r => console.log(`@${r.username}: ${r.followers} followers, ${r.er}% ER`));Expected Output
username: charlidamelio
followers: 155000000
engagement_rate: 3.45
avg_views: 12500000
videos_analyzed: 10
[ 85.0] @charlidamelio (mega) ER:3.45% Followers:155,000,000
[ 78.2] @khaby.lame (mega) ER:2.80% Followers:162,000,000
[ 72.5] @addisonre (mega) ER:2.10% Followers:88,000,000
Evaluated 3 creators
Credits used: 6 ($0.030)