在赞助之前使用 API 清单对 TikTok 创作者进行审查,让您能够以编程方式评估参与率、关注者数量、内容一致性和发布频率,而不是依赖屏幕截图或自我报告的指标。本教程向您展示如何通过 Scavio TikTok API 提取创作者资料、计算关键信任信号以及根据通过/失败评分标准对创作者进行评分,以便您可以自信地分配影响者预算。
前置条件
- 具有 TikTok 访问权限的 Scavio API 密钥(在 scavio.dev 上每月免费 250 个积分)
- Python 3.9+ 或 Node.js 18+
- 待评估的 TikTok 创建者用户名列表
操作指南
步骤 1: 获取创建者个人资料数据
使用 Scavio TikTok 用户信息端点来提取创作者个人资料,包括关注者计数、关注计数、总喜欢数、视频计数和简介。这为您提供了审查标准所需的原始数据。
import requests
API_KEY = 'your_scavio_api_key'
def get_creator_profile(username):
resp = requests.post(
'https://api.scavio.dev/api/v1/tiktok/user/info',
headers={'Authorization': f'Bearer {API_KEY}'},
json={'username': username}
)
resp.raise_for_status()
return resp.json()
profile = get_creator_profile('target_creator')
print(f'Followers: {profile.get("follower_count", 0):,}')
print(f'Total likes: {profile.get("total_likes", 0):,}')
print(f'Videos: {profile.get("video_count", 0)}')步骤 2: 提取最近的视频进行参与度分析
获取创建者最近的帖子以计算真实的参与度指标。自我报告的平均值不可靠。您需要每个视频的数据来发现趋势和异常值。
def get_recent_videos(username, count=20):
resp = requests.post(
'https://api.scavio.dev/api/v1/tiktok/user/posts',
headers={'Authorization': f'Bearer {API_KEY}'},
json={'username': username, 'count': count}
)
resp.raise_for_status()
return resp.json().get('posts', [])
videos = get_recent_videos('target_creator', count=20)步骤 3: 计算参与率和一致性得分
计算近期视频的平均参与率(点赞+评论+分享除以观看次数)。使用中位数而不是均值来避免来自一个病毒异常值的偏差。还可以计算变异系数来衡量其性能的一致性。
import statistics
def compute_engagement_metrics(videos):
rates = []
for v in videos:
views = v.get('views', 0)
if views < 100:
continue
engagement = v.get('likes', 0) + v.get('comments', 0) + v.get('shares', 0)
rates.append(engagement / views)
if not rates:
return {'median_rate': 0, 'consistency': 0, 'sample_size': 0}
median_rate = statistics.median(rates)
mean_rate = statistics.mean(rates)
stdev = statistics.stdev(rates) if len(rates) > 1 else 0
cv = stdev / mean_rate if mean_rate > 0 else 0
return {
'median_rate': round(median_rate * 100, 2),
'consistency': round((1 - min(cv, 1)) * 100, 1),
'sample_size': len(rates),
}
metrics = compute_engagement_metrics(videos)
print(f'Median engagement: {metrics["median_rate"]}%')
print(f'Consistency score: {metrics["consistency"]}%')步骤 4: 运行审核清单
根据通过/失败评分标准对创作者进行评分,评分标准涵盖最低关注者数量、参与率下限、一致性阈值和最低发帖频率。每次检查都会返回通过或失败的实际值,以便您可以做出明智的决定。
def vet_creator(profile, metrics, videos):
checks = []
follower_count = profile.get('follower_count', 0)
checks.append({
'check': 'Min 10K followers',
'pass': follower_count >= 10000,
'value': f'{follower_count:,}',
})
checks.append({
'check': 'Engagement rate >= 3%',
'pass': metrics['median_rate'] >= 3.0,
'value': f'{metrics["median_rate"]}%',
})
checks.append({
'check': 'Consistency score >= 60%',
'pass': metrics['consistency'] >= 60,
'value': f'{metrics["consistency"]}%',
})
checks.append({
'check': 'At least 2 posts/week',
'pass': len(videos) >= 8,
'value': f'{len(videos)} posts in sample',
})
passed = sum(1 for c in checks if c['pass'])
return {'checks': checks, 'passed': passed, 'total': len(checks)}
result = vet_creator(profile, metrics, videos)
for c in result['checks']:
status = 'PASS' if c['pass'] else 'FAIL'
print(f'[{status}] {c["check"]}: {c["value"]}')
print(f'\nScore: {result["passed"]}/{result["total"]}')Python 示例
import requests
import statistics
API_KEY = 'your_scavio_api_key'
def get_creator_profile(username):
resp = requests.post(
'https://api.scavio.dev/api/v1/tiktok/user/info',
headers={'Authorization': f'Bearer {API_KEY}'},
json={'username': username}
)
resp.raise_for_status()
return resp.json()
def get_recent_videos(username, count=20):
resp = requests.post(
'https://api.scavio.dev/api/v1/tiktok/user/posts',
headers={'Authorization': f'Bearer {API_KEY}'},
json={'username': username, 'count': count}
)
resp.raise_for_status()
return resp.json().get('posts', [])
def compute_engagement(videos):
rates = []
for v in videos:
views = v.get('views', 0)
if views < 100:
continue
eng = v.get('likes', 0) + v.get('comments', 0) + v.get('shares', 0)
rates.append(eng / views)
if not rates:
return {'median_rate': 0, 'consistency': 0}
median_rate = statistics.median(rates)
mean_rate = statistics.mean(rates)
stdev = statistics.stdev(rates) if len(rates) > 1 else 0
cv = stdev / mean_rate if mean_rate > 0 else 0
return {
'median_rate': round(median_rate * 100, 2),
'consistency': round((1 - min(cv, 1)) * 100, 1),
}
def vet_creator(username):
profile = get_creator_profile(username)
videos = get_recent_videos(username, count=20)
metrics = compute_engagement(videos)
checks = [
('Min 10K followers', profile.get('follower_count', 0) >= 10000),
('Engagement >= 3%', metrics['median_rate'] >= 3.0),
('Consistency >= 60%', metrics['consistency'] >= 60),
('2+ posts/week', len(videos) >= 8),
]
for label, passed in checks:
print(f'[{"PASS" if passed else "FAIL"}] {label}')
print(f'Score: {sum(p for _, p in checks)}/{len(checks)}')
vet_creator('target_creator')JavaScript 示例
const API_KEY = 'your_scavio_api_key';
async function getProfile(username) {
const resp = await fetch('https://api.scavio.dev/api/v1/tiktok/user/info', {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ username }),
});
return resp.json();
}
async function getRecentVideos(username, count = 20) {
const resp = await fetch('https://api.scavio.dev/api/v1/tiktok/user/posts', {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ username, count }),
});
const data = await resp.json();
return data.posts || [];
}
function computeEngagement(videos) {
const rates = videos
.filter(v => (v.views || 0) >= 100)
.map(v => ((v.likes || 0) + (v.comments || 0) + (v.shares || 0)) / v.views);
if (!rates.length) return { medianRate: 0, consistency: 0 };
const sorted = [...rates].sort((a, b) => a - b);
const median = sorted[Math.floor(sorted.length / 2)];
const mean = rates.reduce((a, b) => a + b, 0) / rates.length;
const stdev = Math.sqrt(rates.reduce((s, r) => s + (r - mean) ** 2, 0) / rates.length);
const cv = mean > 0 ? stdev / mean : 0;
return {
medianRate: Math.round(median * 10000) / 100,
consistency: Math.round((1 - Math.min(cv, 1)) * 1000) / 10,
};
}
async function vetCreator(username) {
const profile = await getProfile(username);
const videos = await getRecentVideos(username, 20);
const metrics = computeEngagement(videos);
const checks = [
['Min 10K followers', (profile.follower_count || 0) >= 10000],
['Engagement >= 3%', metrics.medianRate >= 3.0],
['Consistency >= 60%', metrics.consistency >= 60],
['2+ posts/week', videos.length >= 8],
];
for (const [label, passed] of checks) {
console.log(`[${passed ? 'PASS' : 'FAIL'}] ${label}`);
}
console.log(`Score: ${checks.filter(c => c[1]).length}/${checks.length}`);
}
vetCreator('target_creator');预期输出
[PASS] Min 10K followers
[PASS] Engagement >= 3%
[FAIL] Consistency >= 60%
[PASS] 2+ posts/week
Score: 3/4