Competitor profile tracking

Look up a competitor's profile on TikTok, Instagram, YouTube and X, store each platform's lookupStatus and follower count, and compare snapshots over time

This recipe takes a snapshot of a competitor's audience on TikTok, Instagram, YouTube and X: one profile lookup on each platform, saved as one row per platform with the follower count and the time you looked. Run it on a schedule and compare the rows to see how each account grows.

Each platform is a separate lookup. A missing YouTube channel doesn't stop the Instagram lookup, and the same handle on two platforms isn't always the same company, so treat each row as its own account until you've checked it.

Without code: the app's trackers

Two tools in the Social Fetch app do part of this for you, with no code and no scheduler to run:

  • The X Follower Tracker checks a public X account on a schedule, charts its follower count and lists who followed, who left and who came back.
  • The Ad Tracker keeps a copy of every ad a competitor runs on Meta, LinkedIn, Google and TikTok.
The Social Fetch app with the Tools menu open. The X Follower Tracker and Ad Tracker items are spotlit together and labelled No code: X followers and competitor ads.
Both trackers are in the Tools menu at the top of the app.

Use this recipe when you want follower counts from several platforms side by side in your own database or spreadsheet.

What you'll need

  • An API key. The Quickstart shows how to create one.
  • The TypeScript SDK: npm install @socialfetch/sdk.
  • The competitor's handle on each platform. Look them up on the competitor's website, since brands often use a different handle on each one.

What it costs

Each profile lookup costs 1 credit when it completes, including when the account isn't found or is private. One competitor on four platforms is 4 credits a snapshot, so a daily snapshot costs about 120 credits a month for each competitor. Lookups that fail on our side (502 lookup_failed, 503 temporarily_unavailable) cost nothing. See Credits for the full rules, and check your balance with the free GET /v1/balance before a large batch.

Try one lookup first

Open the Playground, pick one of the routes below, type the handle and click Send. The response shows what the code will read: data.lookupStatus says whether the account was found, and the metrics hold its audience size.

The Playground after sending GET /v2/instagram/profiles/babbel, with 1 credit and status 200 above the response. The response is scrolled to the metrics object inside the profile, with followers, following and posts, labelled Instagram's follower count is inside profile.metrics.
Instagram puts its metrics inside data.profile. TikTok, YouTube and X put them in data.metrics.

The routes

PlatformRouteSDK methodAudience size
TikTokGET /v1/tiktok/profiles/{handle}client.tiktok.getProfile({ handle })data.metrics.followers
InstagramGET /v2/instagram/profiles/{profile}client.instagram.getProfileV2({ profile })data.profile.metrics.followers
YouTubeGET /v1/youtube/channelclient.youtube.getChannel({ handle })data.metrics.subscribers
X (Twitter)GET /v1/twitter/profiles/{handle}client.twitter.getProfile({ handle })data.metrics.followers

The same pattern works for a Facebook page, a LinkedIn company page or a Threads profile.

Take a snapshot

This looks a competitor up on each platform at once and returns one row per platform. A platform that fails gives a row with its error code instead of stopping the others.

import { SocialFetchClient, type SocialFetchSdkError } from "@socialfetch/sdk";

const client = new SocialFetchClient({
  apiKey: process.env.SOCIALFETCH_API_KEY!,
});

type Platform = "tiktok" | "instagram" | "youtube" | "twitter";

type Lookup =
  | {
      ok: true;
      lookupStatus: string;
      followers: number | null;
      requestId: string;
      creditsCharged: number;
    }
  | { ok: false; error: SocialFetchSdkError };

// What every successful response has in common.
type Envelope = {
  data: { lookupStatus: string };
  meta: { requestId: string; creditsCharged: number };
};

const done = (value: Envelope, followers: number | null | undefined): Lookup => ({
  ok: true,
  lookupStatus: value.data.lookupStatus,
  followers: followers ?? null,
  requestId: value.meta.requestId,
  creditsCharged: value.meta.creditsCharged,
});

// One lookup per platform, and where each one keeps its audience size.
const lookups: Record<Platform, (handle: string) => Promise<Lookup>> = {
  tiktok: async (handle) => {
    const r = await client.tiktok.getProfile({ handle });
    return r.ok ? done(r.value, r.value.data.metrics?.followers) : r;
  },
  instagram: async (handle) => {
    const r = await client.instagram.getProfileV2({ profile: handle });
    // Instagram keeps its metrics inside data.profile.
    return r.ok ? done(r.value, r.value.data.profile?.metrics?.followers) : r;
  },
  youtube: async (handle) => {
    const r = await client.youtube.getChannel({ handle });
    // YouTube counts subscribers.
    return r.ok ? done(r.value, r.value.data.metrics?.subscribers) : r;
  },
  twitter: async (handle) => {
    const r = await client.twitter.getProfile({ handle });
    return r.ok ? done(r.value, r.value.data.metrics?.followers) : r;
  },
};

export type SnapshotRow = {
  competitor: string;
  platform: Platform;
  handle: string;
  capturedAt: string;
  lookupStatus: string | null; // null when the request failed
  followers: number | null;
  creditsCharged: number;
  requestId: string;
  error: string | null;
};

// Looks the competitor up on each platform at once. One platform failing
// doesn't stop the others.
export async function snapshot(
  competitor: string,
  handles: Partial<Record<Platform, string>>,
): Promise<SnapshotRow[]> {
  const capturedAt = new Date().toISOString();
  const entries = Object.entries(handles) as [Platform, string][];
  return Promise.all(
    entries.map(async ([platform, handle]) => {
      const result = await lookups[platform](handle);
      return result.ok
        ? {
            competitor,
            platform,
            handle,
            capturedAt,
            lookupStatus: result.lookupStatus,
            followers: result.followers,
            creditsCharged: result.creditsCharged,
            requestId: result.requestId,
            error: null,
          }
        : {
            competitor,
            platform,
            handle,
            capturedAt,
            lookupStatus: null,
            followers: null,
            creditsCharged: 0,
            requestId: result.error.requestId,
            error: result.error.code,
          };
    }),
  );
}

async function main() {
  const rows = [
    ...(await snapshot("Duolingo", {
      tiktok: "duolingo",
      instagram: "duolingo",
      twitter: "duolingo",
      youtube: "duolingo",
    })),
    ...(await snapshot("Babbel", {
      tiktok: "babbel",
      instagram: "babbel",
      twitter: "babbel",
      youtube: "babbel",
    })),
  ];
  console.table(rows);
}

main();

Leave a platform out of handles to skip it; you're only charged for the lookups you make.

Run it

Save the code as snapshot.ts and run it with your key in SOCIALFETCH_API_KEY, for example with npx tsx snapshot.ts. Each competitor gives one row per platform. Two of the eight rows from a real run:

[
  {
    "competitor": "Duolingo",
    "platform": "instagram",
    "handle": "duolingo",
    "capturedAt": "2026-10-21T12:18:53.780Z",
    "lookupStatus": "found",
    "followers": 5370969,
    "creditsCharged": 1,
    "requestId": "req_3663dd07-c380-40c9-8f1d-663b75941f89",
    "error": null
  },
  {
    "competitor": "Babbel",
    "platform": "youtube",
    "handle": "babbel",
    "capturedAt": "2026-10-21T12:18:58.412Z",
    "lookupStatus": "not_found",
    "followers": null,
    "creditsCharged": 1,
    "requestId": "req_5fea90c8-81fa-40b0-839c-605aa73f2626",
    "error": null
  }
]

Babbel's YouTube channel doesn't use the handle babbel, so that lookup came back not_found and still cost 1 credit. The other platforms weren't affected.

Each lookup shows up in your request history with what it cost. Type part of the handle in Path contains to find them.

The Request history page filtered to paths containing duolingo. Four GET requests from the same minute, to the YouTube, Instagram, TikTok and X routes, are spotlit, each with status 200 and 1 in the Credits column, labelled Four lookups, 1 credit each.
One snapshot of one competitor: four lookups at 1 credit each.

Read each row

Check lookupStatus before you trust the number. A lookup that completes returns HTTP 200 even when there's nothing to read:

  • found: the account exists and the metrics are filled in.
  • not_found: there's no account with that handle on that platform. Check the handle; it's often different on each platform.
  • private: the account exists but isn't public, so some or all of its metrics can be missing.

A row with an error instead, such as lookup_failed, means the lookup didn't complete and wasn't charged. Try that platform again later; the others are unaffected. Errors lists every code.

Store and compare

Save every row, including the ones that weren't found, so you can tell "no account" apart from "we didn't look". Keep capturedAt, lookupStatus, followers and requestId (quote it if you contact support about a lookup).

A table of eight rows from a real run: Duolingo and Babbel on TikTok, Instagram, X and YouTube, with columns capturedAt, competitor, platform, handle, lookupStatus, followers, creditsCharged and requestId. The followers column is labelled Compare these between snapshots. Babbel's YouTube row has lookupStatus not_found, followers null and 1 credit, labelled No channel with this handle: still 1 credit.
One snapshot of two competitors, as the code returns it. Each later snapshot adds the same rows with a new capturedAt.

The API returns the count at the moment you ask; it doesn't keep a history or work out changes. To see growth, compare the latest followers for each competitor and platform with an earlier snapshot in your own store.

Before you compare platforms, check that each row really is the competitor: open the profile and look at its name, bio and website. Cross-platform creator profiles shows how to link accounts whose handles differ.

On this page