The "Triple Threat" Problem
If you're a modern creator, you're posting the same vertical video to TikTok, Instagram Reels, and YouTube Shorts. But tracking performance is a nightmare:
- TikTok shows "Views" and "Likes".
- Instagram shows "Plays" and "Accounts Reached".
- YouTube shows "Views" and "Average Percentage Viewed".
To know which platform is actually winning, you need a Unified Dashboard. In this guide, we'll build a script that pulls data from all three platforms and normalizes it into a single "Virality Score."
The Tech Stack
We'll use the SociaVault API to fetch data from all three giants.
Prerequisites
- Node.js installed
- A SociaVault API Key
axiosfor API requests
Step 1: The Unified Data Fetcher
We need a function that takes a handle (or handles) and fetches the latest 10 videos from each platform.
const axios = require('axios');
const API_KEY = 'YOUR_SOCIAVAULT_API_KEY';
const BASE_URL = 'https://api.sociavault.com/v1/scrape';
const headers = { 'x-api-key': API_KEY };
async function getCrossPlatformStats(handles) {
const { tiktok, instagram, youtube } = handles;
const results = { tiktok: [], reels: [], shorts: [] };
try {
// 1. Fetch TikToks
console.log('Fetching TikToks...');
const tiktokRes = await axios.get(`${BASE_URL}/tiktok/videos`, {
params: { handle: tiktok, amount: 10 },
headers
});
results.tiktok = tiktokRes.data.data.videos || [];
// 2. Fetch Reels
console.log('Fetching Reels...');
const reelsRes = await axios.get(`${BASE_URL}/instagram/reels`, {
params: { handle: instagram },
headers
});
results.reels = reelsRes.data.data.items || [];
// 3. Fetch Shorts
console.log('Fetching Shorts...');
const shortsRes = await axios.get(`${BASE_URL}/youtube/channel/shorts`, {
params: { handle: youtube },
headers
});
results.shorts = shortsRes.data.data.videos || [];
return results;
} catch (error) {
console.error('Error fetching data:', error.response?.data || error.message);
return null;
}
}
Step 2: Normalizing the Data
Every platform returns data differently. We need a standard format:
platform: 'tiktok' | 'instagram' | 'youtube'views: Numberlikes: Numbercomments: NumberengagementRate: (Likes + Comments) / Views * 100
function normalizeData(rawData) {
const normalized = [];
// Normalize TikTok
rawData.tiktok.forEach(video => {
const views = video.playCount;
const likes = video.diggCount;
const comments = video.commentCount;
normalized.push({
platform: 'TikTok',
title: video.desc,
views,
likes,
comments,
engagementRate: ((likes + comments) / views * 100).toFixed(2) + '%',
url: `https://tiktok.com/@user/video/${video.id}`
});
});
// Normalize Reels
rawData.reels.forEach(reel => {
const views = reel.play_count;
const likes = reel.like_count;
const comments = reel.comment_count;
normalized.push({
platform: 'Instagram',
title: reel.caption?.text || 'No Caption',
views,
likes,
comments,
engagementRate: ((likes + comments) / views * 100).toFixed(2) + '%',
url: `https://instagram.com/p/${reel.code}`
});
});
// Normalize Shorts
rawData.shorts.forEach(short => {
// Note: YouTube API returns text like "1.2M views", need parsing in real app
// For this demo, we assume raw numbers or simple parsing
const views = parseInt(short.viewCountText.replace(/[^0-9]/g, '')) || 0;
normalized.push({
platform: 'YouTube',
title: short.title,
views,
likes: 'N/A', // Often hidden on list view
comments: 'N/A',
engagementRate: 'N/A',
url: `https://youtube.com${short.url}`
});
});
return normalized;
}
Step 3: The Comparison Script
Now, let's put it all together to see where a creator is winning.
async function comparePlatforms() {
const handles = {
tiktok: 'garyvee',
instagram: 'garyvee',
youtube: 'GaryVee'
};
const rawData = await getCrossPlatformStats(handles);
if (!rawData) return;
const cleanData = normalizeData(rawData);
// Sort by Views (Descending)
cleanData.sort((a, b) => b.views - a.views);
console.log(`\nš Top 5 Videos Across All Platforms`);
console.log(`----------------------------------------`);
cleanData.slice(0, 5).forEach((video, index) => {
console.log(`#${index + 1} [${video.platform}] ${video.title.substring(0, 40)}...`);
console.log(` š Views: ${video.views.toLocaleString()}`);
console.log(` ā¤ļø Engagement: ${video.engagementRate}`);
console.log(` š ${video.url}`);
console.log(`---`);
});
}
comparePlatforms();
Why This Matters in 2025
The "Spray and Pray" method of posting everywhere is fine, but optimizing is better.
- If TikTok gives you 10x views but Instagram gives you 10x sales (link clicks), you need to know that.
- If YouTube Shorts have a longer shelf-life (views continue for months), you might prioritize them for evergreen content.
Next Steps
Build your own dashboard today.
Found this helpful?
Share it with others who might benefit
Ready to Try SociaVault?
Start extracting social media data with our powerful API. No credit card required.