寻找 YouTube 影响者进行品牌合作通常需要昂贵的影响者营销平台(200-500 美元/月)或手动搜索。本教程使用 SERP 数据构建一个自动化管道,以发现任何细分市场中的 YouTube 用户、对其相关性进行评分并编制外展列表。每次搜索的成本为 0.005 美元,在某个利基市场中发现 50 位影响者的成本约为 0.05 美元(10 次搜索)。
前置条件
- 已安装 Python 3.9+
- 请求已安装库
- 来自 scavio.dev 的 Scavio API 密钥
操作指南
步骤 1: 定义利基搜索查询
创建旨在显示目标细分市场中的 YouTube 频道的搜索查询。将主题关键字与 YouTube 特定的修饰符相结合。
Python
def generate_queries(niche: str, modifiers: list = None) -> list:
if modifiers is None:
modifiers = [
'best {niche} youtube channels 2026',
'top {niche} youtubers to follow',
'site:youtube.com {niche} tutorial',
'site:youtube.com {niche} review 2026',
'{niche} youtube creator recommendations',
]
return [m.format(niche=niche) for m in modifiers]
niche = 'python programming'
queries = generate_queries(niche)
for q in queries:
print(f' {q}')
print(f'\n{len(queries)} queries = ${len(queries) * 0.005:.3f}')步骤 2: 从搜索结果中发现创作者
搜索每个查询并从结果中提取唯一的 YouTube 频道名称和视频数据。
Python
import requests, os, time, re
from collections import defaultdict
SCAVIO_KEY = os.environ['SCAVIO_API_KEY']
def discover_creators(queries: list) -> dict:
creators = defaultdict(lambda: {'videos': [], 'mentions': 0, 'sources': []})
for query in queries:
resp = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': SCAVIO_KEY, 'Content-Type': 'application/json'},
json={'query': query, 'country_code': 'us', 'num_results': 10})
for r in resp.json().get('organic_results', []):
link = r.get('link', '')
title = r.get('title', '')
# Extract channel from YouTube URLs
if 'youtube.com/watch' in link:
# Channel often in title as "Video Title - Channel Name"
parts = title.replace(' - YouTube', '').split(' - ')
if len(parts) >= 2:
channel = parts[-1].strip()
creators[channel]['videos'].append(parts[0].strip())
creators[channel]['mentions'] += 1
creators[channel]['sources'].append(link)
elif 'youtube.com/@' in link or 'youtube.com/c/' in link:
channel = title.replace(' - YouTube', '').strip()
creators[channel]['mentions'] += 1
creators[channel]['sources'].append(link)
time.sleep(0.3)
return dict(creators)
creators = discover_creators(queries)
print(f'Discovered {len(creators)} unique creators')
for name, data in sorted(creators.items(), key=lambda x: -x[1]['mentions'])[:5]:
print(f' {name}: {data["mentions"]} mentions, {len(data["videos"])} videos')步骤 3: 对创作者进行评分和排名
根据每个创作者在搜索中出现的频率、找到的独特视频的数量以及利基相关性对每个创作者进行评分。
Python
def score_creators(creators: dict, niche_terms: list) -> list:
scored = []
for name, data in creators.items():
# Frequency score: more mentions = more prominent
freq_score = min(data['mentions'] * 15, 40)
# Content volume: more videos found = more active
volume_score = min(len(data['videos']) * 10, 30)
# Niche relevance: check if videos match niche
niche_text = ' '.join(data['videos']).lower()
term_hits = sum(1 for t in niche_terms if t.lower() in niche_text)
relevance_score = min(term_hits / max(len(niche_terms), 1) * 30, 30)
total = round(freq_score + volume_score + relevance_score, 1)
scored.append({
'channel': name, 'score': total,
'mentions': data['mentions'],
'videos_found': len(data['videos']),
'sample_videos': data['videos'][:3],
'channel_url': data['sources'][0] if data['sources'] else ''
})
scored.sort(key=lambda x: -x['score'])
return scored
niche_terms = ['python', 'programming', 'tutorial', 'code']
ranked = score_creators(creators, niche_terms)
print(f'Top 10 {niche} YouTube creators:\n')
for i, c in enumerate(ranked[:10], 1):
print(f'{i:2}. [{c["score"]:5.1f}] {c["channel"]}')
if c['sample_videos']:
print(f' Videos: {c["sample_videos"][0][:50]}')Python 示例
Python
import requests, os, time
from collections import defaultdict
SCAVIO_KEY = os.environ['SCAVIO_API_KEY']
def find_creators(niche, count=5):
queries = [f'site:youtube.com {niche} tutorial', f'best {niche} youtubers 2026',
f'site:youtube.com {niche} review 2026']
creators = defaultdict(int)
for q in queries:
resp = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': SCAVIO_KEY, 'Content-Type': 'application/json'},
json={'query': q, 'country_code': 'us', 'num_results': 10})
for r in resp.json().get('organic_results', []):
title = r.get('title', '').replace(' - YouTube', '')
parts = title.split(' - ')
if len(parts) >= 2:
creators[parts[-1].strip()] += 1
time.sleep(0.3)
return sorted(creators.items(), key=lambda x: -x[1])[:count]
for name, mentions in find_creators('python programming'):
print(f'{name}: {mentions} mentions')JavaScript 示例
JavaScript
const SCAVIO_KEY = process.env.SCAVIO_API_KEY;
async function findCreators(niche) {
const queries = [`site:youtube.com ${niche} tutorial`, `best ${niche} youtubers 2026`];
const creators = {};
for (const q of queries) {
const resp = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: { 'x-api-key': SCAVIO_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ query: q, country_code: 'us', num_results: 10 })
});
for (const r of (await resp.json()).organic_results || []) {
const parts = r.title.replace(' - YouTube', '').split(' - ');
if (parts.length >= 2) {
const ch = parts[parts.length - 1].trim();
creators[ch] = (creators[ch] || 0) + 1;
}
}
}
return Object.entries(creators).sort((a, b) => b[1] - a[1]).slice(0, 10);
}
findCreators('python programming').then(c => c.forEach(([n, m]) => console.log(`${n}: ${m}`)));预期输出
JSON
best python programming youtube channels 2026
top python programming youtubers to follow
site:youtube.com python programming tutorial
Discovered 18 unique creators
Tech With Tim: 4 mentions, 3 videos
Corey Schafer: 3 mentions, 2 videos
Programming with Mosh: 3 mentions, 2 videos
Top 10 python programming YouTube creators:
1. [ 85.0] Tech With Tim
Videos: Python Full Course for Beginners 2026
2. [ 72.5] Corey Schafer
3. [ 68.3] Programming with Mosh