Extract a TikTok user's follower list via Scavio API at $0.005/page of 20 followers. Each follower includes username, follower count, video count, and sec_uid. Uses page_token+min_time pagination unique to social graph endpoints.
Prerequisites
- Scavio API key
- Target user's sec_uid
- Python 3.8+ or Node.js 18+
Walkthrough
Step 1: Get sec_uid from profile
Look up the target user's sec_uid first.
import requests, os
HEADERS = {'Authorization': f'Bearer {os.environ["SCAVIO_API_KEY"]}',
'Content-Type': 'application/json'}
profile = requests.post('https://api.scavio.dev/api/v1/tiktok/profile',
headers=HEADERS, json={'username': 'target_user'}).json()
sec_uid = profile['data']['user']['sec_uid']Step 2: Fetch followers
Call the followers endpoint with page_token pagination.
resp = requests.post('https://api.scavio.dev/api/v1/tiktok/user/followers',
headers=HEADERS,
json={'sec_user_id': sec_uid, 'count': 20})
data = resp.json()['data']
for f in data.get('followers', []):
print(f"@{f['unique_id']}: {f['follower_count']:,} followers")Step 3: Paginate with page_token + min_time
Both page_token and min_time are required for subsequent pages.
if data.get('has_more'):
page2 = requests.post(
'https://api.scavio.dev/api/v1/tiktok/user/followers',
headers=HEADERS,
json={'sec_user_id': sec_uid, 'count': 20,
'page_token': data['next_page_token'],
'min_time': data['min_time']}).json()['data']
print(f'Page 2: {len(page2.get("followers", []))} followers')Python Example
import requests, os
HEADERS = {'Authorization': f'Bearer {os.environ["SCAVIO_API_KEY"]}',
'Content-Type': 'application/json'}
def get_followers(sec_uid, max_pages=10):
followers = []
params = {'sec_user_id': sec_uid, 'count': 20}
for _ in range(max_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
# Get sec_uid first
profile = requests.post('https://api.scavio.dev/api/v1/tiktok/profile',
headers=HEADERS, json={'username': 'target_user'}).json()
followers = get_followers(profile['data']['user']['sec_uid'])
print(f'{len(followers)} followers sampled')JavaScript Example
const H = {'Authorization': `Bearer ${process.env.SCAVIO_API_KEY}`, 'Content-Type': 'application/json'};
async function getFollowers(secUid, maxPages = 10) {
const followers = [];
let params = {sec_user_id: secUid, count: 20};
for (let i = 0; i < maxPages; 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());
followers.push(...(r.data.followers || []));
if (!r.data.has_more) break;
params.page_token = r.data.next_page_token;
params.min_time = r.data.min_time;
}
return followers;
}
// Usage: getFollowers(secUid).then(f => console.log(`${f.length} followers`));Expected Output
Array of follower objects with username, follower count, video count, and sec_uid for each follower.