Tutorial

How to Analyze TikTok Audience Overlap Between Creators

Compare follower lists between TikTok creators to find audience overlap. Python example using Scavio follower endpoints.

Analyze audience overlap between TikTok creators by comparing follower samples via Scavio API. Cost: $0.16 per creator pair (15 pages each + 2 profile lookups). Essential for influencer campaign planning to maximize unique reach.

Prerequisites

  • Scavio API key
  • Two or more TikTok usernames to compare
  • Python 3.8+

Walkthrough

Step 1: Get follower samples for each creator

Pull follower pages for both creators.

Python
import requests, os

HEADERS = {'Authorization': f'Bearer {os.environ["SCAVIO_API_KEY"]}',
           'Content-Type': 'application/json'}

def get_sec_uid(username):
    return requests.post('https://api.scavio.dev/api/v1/tiktok/profile',
        headers=HEADERS, json={'username': username}).json()['data']['user']['sec_uid']

def get_followers(sec_uid, pages=15):
    followers = []
    params = {'sec_user_id': sec_uid, 'count': 20}
    for _ in range(pages):
        data = requests.post('https://api.scavio.dev/api/v1/tiktok/user/followers',
            headers=HEADERS, json=params).json()['data']
        followers.extend(data.get('followers', []))
        if not data.get('has_more'): break
        params['page_token'] = data['next_page_token']
        params['min_time'] = data['min_time']
    return followers

Step 2: Calculate overlap

Compare follower sets using Jaccard similarity.

Python
uid_a = get_sec_uid('creator_a')
uid_b = get_sec_uid('creator_b')

set_a = {f['unique_id'] for f in get_followers(uid_a)}
set_b = {f['unique_id'] for f in get_followers(uid_b)}

overlap = set_a & set_b
jaccard = len(overlap) / len(set_a | set_b) if (set_a | set_b) else 0

print(f'Sampled: {len(set_a)} + {len(set_b)} followers')
print(f'Overlap: {len(overlap)} ({jaccard:.1%} Jaccard similarity)')

Python Example

Python
import requests, os

HEADERS = {'Authorization': f'Bearer {os.environ["SCAVIO_API_KEY"]}',
           'Content-Type': 'application/json'}

def overlap_analysis(username_a, username_b, sample_pages=15):
    uid_a = requests.post('https://api.scavio.dev/api/v1/tiktok/profile',
        headers=HEADERS, json={'username': username_a}).json()['data']['user']['sec_uid']
    uid_b = requests.post('https://api.scavio.dev/api/v1/tiktok/profile',
        headers=HEADERS, json={'username': username_b}).json()['data']['user']['sec_uid']
    def fetch(uid):
        followers = []
        params = {'sec_user_id': uid, 'count': 20}
        for _ in range(sample_pages):
            data = requests.post('https://api.scavio.dev/api/v1/tiktok/user/followers',
                headers=HEADERS, json=params).json()['data']
            followers.extend(data.get('followers', []))
            if not data.get('has_more'): break
            params['page_token'] = data['next_page_token']
            params['min_time'] = data['min_time']
        return {f['unique_id'] for f in followers}
    set_a, set_b = fetch(uid_a), fetch(uid_b)
    overlap = set_a & set_b
    return {'a': len(set_a), 'b': len(set_b), 'overlap': len(overlap),
            'jaccard': len(overlap) / len(set_a | set_b) if (set_a | set_b) else 0}

result = overlap_analysis('creator_a', 'creator_b')
print(f"Overlap: {result['overlap']} ({result['jaccard']:.1%})")

JavaScript Example

JavaScript
const H = {'Authorization': `Bearer ${process.env.SCAVIO_API_KEY}`, 'Content-Type': 'application/json'};
async function overlapAnalysis(usernameA, usernameB) {
  async function getUid(u) {
    const r = await fetch('https://api.scavio.dev/api/v1/tiktok/profile', {
      method: 'POST', headers: H, body: JSON.stringify({username: u})
    }).then(r => r.json());
    return r.data.user.sec_uid;
  }
  async function fetchFollowers(uid) {
    const set = new Set();
    let params = {sec_user_id: uid, count: 20};
    for (let i = 0; i < 15; i++) {
      const r = await fetch('https://api.scavio.dev/api/v1/tiktok/user/followers', {
        method: 'POST', headers: H, body: JSON.stringify(params)
      }).then(r => r.json());
      (r.data.followers || []).forEach(f => set.add(f.unique_id));
      if (!r.data.has_more) break;
      params.page_token = r.data.next_page_token;
      params.min_time = r.data.min_time;
    }
    return set;
  }
  const [uidA, uidB] = await Promise.all([getUid(usernameA), getUid(usernameB)]);
  const [setA, setB] = await Promise.all([fetchFollowers(uidA), fetchFollowers(uidB)]);
  const overlap = [...setA].filter(x => setB.has(x));
  console.log(`Overlap: ${overlap.length} out of ${setA.size} + ${setB.size}`);
}
overlapAnalysis('creator_a', 'creator_b');

Expected Output

JSON
Audience overlap metrics: follower sample sizes, shared follower count, and Jaccard similarity coefficient for the creator pair.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Scavio API key. Two or more TikTok usernames to compare. Python 3.8+. A Scavio API key gives you 250 free credits per month.

Yes. The free tier includes 250 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Compare follower lists between TikTok creators to find audience overlap. Python example using Scavio follower endpoints.