ScavioScavio
产品定价文档
登录开始使用
  1. 首页
  2. 教程
  3. 如何打造 TikTok 影响者评分者
教程

如何打造 TikTok 影响者评分者

使用 TikTok API 根据参与度、一致性和受众质量对 TikTok 影响者进行评分。 Python 中的自动审查管道。

获取免费API密钥API文档

审查 TikTok 影响者的品牌合作关系需要分析多个信号:参与率、发布一致性、关注者增长模式和内容相关性。每个创作者的手动审核需要数小时。本教程使用 Scavio TikTok API 构建一个自动评分系统,该系统可获取创作者个人资料和最近的视频、计算参与度指标并输出综合分数。每个 API 调用需要 1 个积分(0.005 美元),完整的创建者分析需要 2-3 个积分。

前置条件

  • 已安装 Python 3.9+
  • 请求已安装库
  • 来自 scavio.dev 的 Scavio API 密钥
  • 需要评估的 TikTok 用户名或影响者的秒数

操作指南

步骤 1: 获取创建者个人资料数据

获取创作者个人资料,包括关注者数量、关注者数量、总点赞数和视频数量。这是所有评分指标的基础。

Python
import requests, os

API_KEY = os.environ['SCAVIO_API_KEY']
TIKTOK_URL = 'https://api.scavio.dev/api/v1/tiktok'

def get_profile(username: str) -> dict:
    resp = requests.post(f'{TIKTOK_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': user.get('uniqueId', ''),
        'nickname': user.get('nickname', ''),
        '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)
    }

profile = get_profile('example_creator')
print(f'{profile["username"]}: {profile["followers"]:,} followers, {profile["videos"]} videos')

步骤 2: 获取最近的视频进行参与度分析

获取创作者最近的视频来计算实际参与率。如果不分析每个视频,个人资料级别的统计数据可能会产生误导。

Python
def get_recent_videos(username: str, count: int = 20) -> list:
    resp = requests.post(f'{TIKTOK_URL}/user/posts',
        headers={'Authorization': f'Bearer {API_KEY}',
                 'Content-Type': 'application/json'},
        json={'username': username, 'count': count, 'cursor': 0})
    resp.raise_for_status()
    videos = resp.json().get('data', {}).get('videos', [])
    return [{
        'id': v.get('id', ''),
        'desc': v.get('desc', ''),
        'plays': v.get('stats', {}).get('playCount', 0),
        'likes': v.get('stats', {}).get('diggCount', 0),
        'comments': v.get('stats', {}).get('commentCount', 0),
        'shares': v.get('stats', {}).get('shareCount', 0),
        'create_time': v.get('createTime', 0)
    } for v in videos]

videos = get_recent_videos('example_creator')
print(f'Fetched {len(videos)} recent videos')

步骤 3: 计算参与度和一致性分数

计算每个视频的参与率、平均参与度、发布频率和内容一致性。这些指标构成了评分组件。

Python
import statistics
from datetime import datetime

def calculate_metrics(profile: dict, videos: list) -> dict:
    if not videos:
        return {'engagement_rate': 0, 'consistency': 0, 'avg_plays': 0}
    followers = max(profile['followers'], 1)
    # Per-video engagement rate
    engagement_rates = []
    for v in videos:
        total_engagement = v['likes'] + v['comments'] + v['shares']
        rate = (total_engagement / max(v['plays'], 1)) * 100
        engagement_rates.append(rate)
    avg_engagement = statistics.mean(engagement_rates)
    engagement_stdev = statistics.stdev(engagement_rates) if len(engagement_rates) > 1 else 0
    # Posting consistency (days between posts)
    timestamps = sorted([v['create_time'] for v in videos if v['create_time']])
    if len(timestamps) > 1:
        gaps = [(timestamps[i+1] - timestamps[i]) / 86400
                for i in range(len(timestamps) - 1)]
        avg_gap = statistics.mean(gaps)
        gap_stdev = statistics.stdev(gaps) if len(gaps) > 1 else avg_gap
    else:
        avg_gap = 30
        gap_stdev = 30
    avg_plays = statistics.mean([v['plays'] for v in videos])
    return {
        'avg_engagement_rate': round(avg_engagement, 2),
        'engagement_consistency': round(100 - min(engagement_stdev * 10, 100), 1),
        'avg_days_between_posts': round(avg_gap, 1),
        'posting_consistency': round(100 - min(gap_stdev * 10, 100), 1),
        'avg_plays': int(avg_plays),
        'likes_to_followers': round((statistics.mean([v['likes'] for v in videos]) / followers) * 100, 2)
    }

步骤 4: 建立综合影响者得分

将所有指标通过加权成分合并为一个 0-100 分。分数越高表明合作潜力越大。

Python
def score_influencer(profile: dict, metrics: dict) -> dict:
    # Engagement score (0-40 points)
    eng_rate = metrics['avg_engagement_rate']
    engagement_score = min(eng_rate * 5, 40)  # 8%+ engagement = max score
    # Consistency score (0-20 points)
    consistency_score = (metrics['engagement_consistency'] +
                         metrics['posting_consistency']) / 10
    consistency_score = min(consistency_score, 20)
    # Reach score (0-20 points)
    followers = profile['followers']
    if followers >= 1000000:
        reach_score = 20
    elif followers >= 100000:
        reach_score = 15
    elif followers >= 10000:
        reach_score = 10
    elif followers >= 1000:
        reach_score = 5
    else:
        reach_score = 2
    # Authenticity score (0-20 points)
    # High following/follower ratio = potential fake engagement
    ratio = profile['following'] / max(profile['followers'], 1)
    auth_score = 20 if ratio < 0.1 else 15 if ratio < 0.3 else 10 if ratio < 0.5 else 5
    total = round(engagement_score + consistency_score + reach_score + auth_score, 1)
    return {
        'total_score': total,
        'engagement_score': round(engagement_score, 1),
        'consistency_score': round(consistency_score, 1),
        'reach_score': reach_score,
        'authenticity_score': auth_score,
        'grade': 'A' if total >= 80 else 'B' if total >= 60 else 'C' if total >= 40 else 'D'
    }

步骤 5: 运行完整的评分管道

将所有步骤合并到一个函数中,该函数接受用户名并返回完整的影响者报告。批量评分多个创作者。

Python
import time

def full_influencer_report(username: str) -> dict:
    profile = get_profile(username)
    videos = get_recent_videos(username, count=20)
    metrics = calculate_metrics(profile, videos)
    scores = score_influencer(profile, metrics)
    return {
        'profile': profile,
        'metrics': metrics,
        'scores': scores,
        'credits_used': 2  # 1 for profile + 1 for videos
    }

def batch_score(usernames: list) -> list:
    reports = []
    for username in usernames:
        report = full_influencer_report(username)
        reports.append(report)
        p = report['profile']
        s = report['scores']
        print(f'{p["username"]}: {s["total_score"]}/100 ({s["grade"]}) - '
              f'{p["followers"]:,} followers, '
              f'{report["metrics"]["avg_engagement_rate"]}% engagement')
        time.sleep(0.3)
    total_credits = sum(r['credits_used'] for r in reports)
    print(f'\nTotal credits: {total_credits} (${total_credits * 0.005:.2f})')
    return sorted(reports, key=lambda r: r['scores']['total_score'], reverse=True)

# Score multiple influencers:
# ranked = batch_score(['creator1', 'creator2', 'creator3'])

Python 示例

Python
import os, requests, statistics, time

API_KEY = os.environ['SCAVIO_API_KEY']
TT = 'https://api.scavio.dev/api/v1/tiktok'

def tiktok(endpoint, body):
    return requests.post(f'{TT}/{endpoint}',
        headers={'Authorization': f'Bearer {API_KEY}', 'Content-Type': 'application/json'},
        json=body).json()

def score_creator(username):
    profile = tiktok('user/info', {'username': username}).get('data', {})
    stats = profile.get('stats', {})
    videos_data = tiktok('user/posts', {'username': username, 'count': 20, 'cursor': 0})
    videos = videos_data.get('data', {}).get('videos', [])
    if not videos:
        return {'username': username, 'score': 0}
    eng_rates = [(v['stats']['diggCount'] + v['stats']['commentCount']) /
                 max(v['stats']['playCount'], 1) * 100 for v in videos
                 if v.get('stats')]
    avg_eng = statistics.mean(eng_rates) if eng_rates else 0
    return {'username': username, 'followers': stats.get('followerCount', 0),
            'engagement': round(avg_eng, 2), 'score': min(round(avg_eng * 10), 100)}

result = score_creator('example_creator')
print(f'{result["username"]}: {result["score"]}/100 ({result["engagement"]}% engagement)')

JavaScript 示例

JavaScript
const API_KEY = process.env.SCAVIO_API_KEY;
const TT = 'https://api.scavio.dev/api/v1/tiktok';

async function tiktokApi(endpoint, body) {
  const resp = await fetch(`${TT}/${endpoint}`, {
    method: 'POST',
    headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
    body: JSON.stringify(body)
  });
  return resp.json();
}

async function scoreCreator(username) {
  const profile = await tiktokApi('user/info', { username });
  const stats = profile.data?.stats || {};
  const postsData = await tiktokApi('user/posts', { username, count: 20, cursor: 0 });
  const videos = postsData.data?.videos || [];
  const engRates = videos.map(v => {
    const s = v.stats || {};
    return ((s.diggCount || 0) + (s.commentCount || 0)) / Math.max(s.playCount || 1, 1) * 100;
  });
  const avgEng = engRates.reduce((a, b) => a + b, 0) / Math.max(engRates.length, 1);
  console.log(`${username}: ${Math.min(Math.round(avgEng * 10), 100)}/100 (${avgEng.toFixed(2)}% eng)`);
}

scoreCreator('example_creator').catch(console.error);

预期输出

JSON
example_creator: 87,432 followers, 156 videos
Fetched 20 recent videos

example_creator: 72.5/100 (B)
  Engagement: 32.5/40 (6.5% avg rate)
  Consistency: 16.8/20
  Reach: 10/20
  Authenticity: 15/20

Total credits: 2 ($0.01)

相关教程

  • 如何通过 API 检测 TikTok 假粉丝
  • 如何通过 API 监控 TikTok 标签活动
  • 如何构建 TikTok UGC 采集管道

常见问题

大多数开发者在15到30分钟内完成本教程。您需要一个Scavio API密钥(免费套餐即可)和可用的Python或JavaScript环境。

已安装 Python 3.9+. 请求已安装库. 来自 scavio.dev 的 Scavio API 密钥. 需要评估的 TikTok 用户名或影响者的秒数. Scavio API密钥注册即送50个免费积分。

可以。免费套餐注册即送50个积分,完全足够完成本教程并构建一个可运行的原型解决方案。

Scavio提供原生LangChain包(langchain-scavio)、MCP服务器以及适用于任何HTTP客户端的REST API。本教程使用 the raw REST API, 但您可以根据需要适配您选择的框架。

相关资源

Best Of

最佳 TikTok 标签分析 API (2026)

Read more
Best Of

2026 年最佳无需身份验证的 TikTok 数据 API

Read more
Glossary

TikTok 非官方 API

Read more
Comparison

TikTok Proxy Scraping vs TikTok Third-Party API (Scavio, TikAPI)

Read more
Glossary

TikTok API 合规与抓取对比

Read more
Comparison

Apify TikTok Scraper vs Scavio TikTok API

Read more

开始构建

使用 TikTok API 根据参与度、一致性和受众质量对 TikTok 影响者进行评分。 Python 中的自动审查管道。

获取免费API密钥阅读文档
ScavioScavio

面向AI智能体的实时搜索API。搜索所有平台,不仅仅是Google。

产品

  • 功能
  • 定价
  • 控制台
  • 联盟计划

开发者

  • 文档
  • API参考
  • 快速开始
  • MCP集成
  • Python SDK

替代方案

  • Tavily替代方案
  • SerpAPI替代方案
  • Firecrawl替代方案
  • Exa替代方案

工具

  • JSON格式化
  • cURL转代码
  • Token计数器
  • 全部工具

© 2026 Scavio. 保留所有权利。

Featured on TAAFT
服务条款隐私政策