DEV Community

Cover image for Build an Influencer Authenticity Scorer with Node.js
Olamide Olaniyan
Olamide Olaniyan

Posted on

Build an Influencer Authenticity Scorer with Node.js

A brand just sent you a list of 200 influencers. Budget: $50K. Your job: figure out which ones are real.

You open the first profile. 800K followers. Great engagement rate. Looks legit.

Then you notice: 40% of their comments are "Nice post! 🔥" from accounts with zero posts and default profile pics. Their follower growth spiked by 200K overnight. Their audience is 60% from countries where they don't speak the language.

That "perfect" influencer is a fraud. And they want $3,000 per post.

I built a tool that scores influencer authenticity in seconds. Here's exactly how.

The Stack

  • Node.js – runtime
  • SociaVault API – social media data (profiles, posts, comments, followers)
  • Math – statistical analysis (no AI needed)

What Makes a Fake Influencer?

After analyzing thousands of profiles, I identified 6 authenticity signals:

Signal Weight What It Measures
Follower Authenticity 30% Are followers real accounts?
Engagement Quality 25% Do engagement rates match follower count?
Comment Quality 20% Are comments genuine or bot-generated?
Growth Pattern 15% Organic growth or sudden spikes?
Audience-Content Alignment 7% Does audience match the content niche?
Cross-Platform Consistency 3% Similar presence across platforms?

Let's build each one.

Step 1: Fetch Profile Data

const axios = require('axios');

const SOCIAVAULT_API = 'https://api.sociavault.com/v1';
const API_KEY = process.env.SOCIAVAULT_API_KEY;

async function getProfile(platform, username) {
  const response = await axios.get(
    `${SOCIAVAULT_API}/${platform}/profile/${username}`,
    { headers: { 'x-api-key': API_KEY } }
  );
  return response.data;
}

async function getPosts(platform, username, limit = 30) {
  const response = await axios.get(
    `${SOCIAVAULT_API}/${platform}/posts/${username}`,
    { headers: { 'x-api-key': API_KEY }, params: { limit } }
  );
  return response.data;
}

async function getComments(platform, postId) {
  const response = await axios.get(
    `${SOCIAVAULT_API}/${platform}/comments/${postId}`,
    { headers: { 'x-api-key': API_KEY } }
  );
  return response.data;
}
Enter fullscreen mode Exit fullscreen mode

Step 2: Score Follower Authenticity (30%)

Real followers have posts, profile pictures, and reasonable follower-to-following ratios. Bots don't.

function scoreFollowerAuthenticity(followers) {
  let realCount = 0;

  for (const follower of followers) {
    let score = 0;

    // Has profile picture (not default)
    if (follower.profilePicUrl && !follower.isDefaultPic) score += 25;

    // Has at least 1 post
    if (follower.postCount > 0) score += 25;

    // Has a bio
    if (follower.biography && follower.biography.length > 5) score += 20;

    // Reasonable follower/following ratio (not 0/5000)
    const ratio = follower.followerCount / Math.max(follower.followingCount, 1);
    if (ratio > 0.05 && ratio < 50) score += 15;

    // Account age > 30 days
    const ageDays = (Date.now() - new Date(follower.createdAt)) / (1000 * 60 * 60 * 24);
    if (ageDays > 30) score += 15;

    if (score >= 50) realCount++;
  }

  return (realCount / followers.length) * 100;
}
Enter fullscreen mode Exit fullscreen mode

How it works: Sample 200+ followers. If an account has no posts, no bio, no profile pic, and follows 5,000 people — it's a bot. The percentage of "real" followers becomes the score.

Step 3: Score Engagement Quality (25%)

Engagement rate alone is meaningless. Context matters.

function scoreEngagementQuality(profile, posts) {
  const followers = profile.followerCount;

  // Calculate average engagement rate
  const engagementRates = posts.map(post => {
    const engagement = (post.likeCount + post.commentCount) / followers;
    return engagement * 100;
  });

  const avgRate = engagementRates.reduce((a, b) => a + b, 0) / engagementRates.length;

  // Expected ranges by follower tier
  const expectedRange = getExpectedRange(followers);

  // Score based on how close to expected range
  if (avgRate >= expectedRange.min && avgRate <= expectedRange.max) {
    return 90; // Perfect — within expected range
  } else if (avgRate > expectedRange.max * 2) {
    return 30; // Suspiciously high — likely bought engagement
  } else if (avgRate < expectedRange.min * 0.5) {
    return 40; // Too low — followers may be fake
  } else {
    return 65; // Slightly off but not alarming
  }
}

function getExpectedRange(followers) {
  if (followers < 10000) return { min: 3.0, max: 12.0 };
  if (followers < 50000) return { min: 1.5, max: 6.0 };
  if (followers < 100000) return { min: 1.0, max: 4.0 };
  if (followers < 500000) return { min: 0.5, max: 2.5 };
  return { min: 0.3, max: 1.5 };
}
Enter fullscreen mode Exit fullscreen mode

Key insight: An account with 500K followers and a 15% engagement rate is more suspicious than one with a 1.2% rate. That high number screams bought likes.

Step 4: Score Comment Quality (20%)

Bot comments follow patterns. Real comments don't.

function scoreCommentQuality(comments) {
  const genericPatterns = [
    /^nice\s*(post|pic|photo)?!?\s*[🔥❤️👏💯]*$/i,
    /^(love|great|amazing|beautiful|awesome)\s*(this)?!?\s*[🔥❤️]*$/i,
    /^(follow me|check my page|dm me)/i,
    /^[🔥❤️👏💯😍🙌]+$/,  // Emoji-only comments
  ];

  let genericCount = 0;
  let shortCount = 0;
  const uniqueAuthors = new Set();

  for (const comment of comments) {
    // Check for generic bot patterns
    if (genericPatterns.some(p => p.test(comment.text.trim()))) {
      genericCount++;
    }

    // Very short comments (< 3 words) are suspicious in bulk
    if (comment.text.split(' ').length < 3) {
      shortCount++;
    }

    uniqueAuthors.add(comment.authorId);
  }

  const genericRatio = genericCount / comments.length;
  const shortRatio = shortCount / comments.length;
  const uniqueRatio = uniqueAuthors.size / comments.length;

  // High generic ratio = bad
  // Low unique authors = same bots commenting repeatedly
  let score = 100;
  score -= genericRatio * 50;
  score -= (1 - uniqueRatio) * 30;
  if (shortRatio > 0.7) score -= 20;

  return Math.max(0, Math.min(100, score));
}
Enter fullscreen mode Exit fullscreen mode

Red flag: If 60%+ of comments are "Nice post! 🔥" from unique accounts that have zero posts — that's a comment farm.

Step 5: Score Growth Pattern (15%)

Organic growth is gradual. Bought followers appear overnight.

function scoreGrowthPattern(followerHistory) {
  // followerHistory = [{ date, count }, ...]
  const dailyChanges = [];

  for (let i = 1; i < followerHistory.length; i++) {
    const change = followerHistory[i].count - followerHistory[i - 1].count;
    const percentChange = (change / followerHistory[i - 1].count) * 100;
    dailyChanges.push(percentChange);
  }

  // Calculate standard deviation of daily growth
  const avg = dailyChanges.reduce((a, b) => a + b, 0) / dailyChanges.length;
  const variance = dailyChanges.reduce((sum, val) => sum + Math.pow(val - avg, 2), 0) / dailyChanges.length;
  const stdDev = Math.sqrt(variance);

  // Check for suspicious spikes (> 3 standard deviations)
  const spikes = dailyChanges.filter(change => Math.abs(change - avg) > 3 * stdDev);

  // More spikes = more suspicious
  if (spikes.length === 0) return 95;
  if (spikes.length === 1) return 70;
  if (spikes.length <= 3) return 45;
  return 20;
}
Enter fullscreen mode Exit fullscreen mode

What to look for: A creator going from 50K to 250K in one week — with no viral post to explain it — bought followers.

Step 6: Combine Everything

async function calculateAuthenticityScore(platform, username) {
  // Fetch all data
  const profile = await getProfile(platform, username);
  const posts = await getPosts(platform, username, 30);

  // Get comments from top 5 posts
  const topPosts = posts.sort((a, b) => b.likeCount - a.likeCount).slice(0, 5);
  const allComments = [];
  for (const post of topPosts) {
    const comments = await getComments(platform, post.id);
    allComments.push(...comments);
  }

  // Calculate individual scores
  const scores = {
    followerAuthenticity: scoreFollowerAuthenticity(profile.followerSample),
    engagementQuality: scoreEngagementQuality(profile, posts),
    commentQuality: scoreCommentQuality(allComments),
    growthPattern: scoreGrowthPattern(profile.followerHistory),
  };

  // Weighted total
  const weights = {
    followerAuthenticity: 0.30,
    engagementQuality: 0.25,
    commentQuality: 0.20,
    growthPattern: 0.15,
    audienceAlignment: 0.07,
    crossPlatform: 0.03,
  };

  const totalScore =
    scores.followerAuthenticity * weights.followerAuthenticity +
    scores.engagementQuality * weights.engagementQuality +
    scores.commentQuality * weights.commentQuality +
    scores.growthPattern * weights.growthPattern;

  return {
    username,
    platform,
    overallScore: Math.round(totalScore),
    breakdown: scores,
    verdict: getVerdict(totalScore),
  };
}

function getVerdict(score) {
  if (score >= 80) return '✅ Exceptional — Highly authentic';
  if (score >= 60) return '🟢 Strong — Mostly authentic';
  if (score >= 40) return '🟡 Moderate — Some concerns';
  if (score >= 20) return '🟠 Weak — Significant red flags';
  return '🔴 Critical — Likely fraudulent';
}
Enter fullscreen mode Exit fullscreen mode

Real Results

I ran this on 500 influencers across Instagram and TikTok:

Score Range % of Influencers What We Found
80-100 ~8% Genuinely authentic creators
60-79 ~22% Mostly real, minor issues
40-59 ~33% Mixed — some bought engagement
20-39 ~25% Significant fake activity
0-19 ~12% Almost entirely fake

37% of influencers scored below 40. Over a third would waste your budget.

Read the Full Guide

This is a condensed version. The full methodology (called the SV-Score) includes:

  • All 6 scoring signals with detailed formulas
  • Platform-specific calibration (Instagram vs TikTok vs YouTube)
  • Score distribution data from 50,000+ profiles
  • Real case studies with actual scores

Read the complete SV-Score methodology on SociaVault →


Need influencer authenticity data at scale? SociaVault provides social media data APIs for TikTok, Instagram, YouTube, and 10+ platforms. Get profile, post, comment, and follower data through one unified API.

Discussion

What signals do you use to spot fake influencers? Have you been burned by one? Share your horror stories 👇

webdev #api #nodejs #influencermarketing #javascript

Top comments (0)