SocialCrawl
Recipes

Music trend detection

Detect songs gaining traction across TikTok, Spotify, and SoundCloud with a cross-platform heat score — 3 credits per song.

Music trend detection

Build an A&R / music-trend dashboard that detects songs gaining traction across TikTok, Spotify, and SoundCloud before they hit the mainstream charts.

Combine three signals: GET /v1/tiktok/song/videos counts how many videos use the sound, GET /v1/spotify/search returns the canonical track stats, and GET /v1/soundcloud/track adds the underground signal. A log-weighted composite of the three catches breakouts while chart positions still lag — for 3 credits per song.

The problem

By the time a song appears on a chart, the trend is priced in. The early signal is fragmented: TikTok creation velocity spikes first, Spotify streams confirm, SoundCloud tells you whether the artist has organic underground pull. No single platform shows all three, and each exposes the data differently.

The solution

Three standard-tier endpoints (1 credit each), one composite score:

  • GET /v1/tiktok/song/videos — videos using a specific TikTok sound (by clipId)
  • GET /v1/spotify/search — Spotify track / artist / podcast search
  • GET /v1/soundcloud/track — SoundCloud track metadata by URL

The three platforms expose the same artefact (a track) from three different vantage points: TikTok shows you who's making content with it, Spotify shows the canonical track stats, SoundCloud shows the underground signal. A simple composite score fuses all three.

// recipe-music-heat.ts
// Calculates a cross-platform "heat score" for one track.
// Run with: SOCIALCRAWL_KEY=sc_... npx tsx recipe-music-heat.ts

const KEY = process.env.SOCIALCRAWL_KEY;
if (!KEY) throw new Error("Set SOCIALCRAWL_KEY");

const BASE = "https://www.socialcrawl.dev/v1";

const tiktokClipId = "7349589214432069122";
const spotifyQuery = "Espresso Sabrina Carpenter";
const soundcloudUrl = "https://soundcloud.com/sabrinacarpenter/espresso";

async function get(path: string, params: Record<string, string>) {
  const url = new URL(`${BASE}/${path}`);
  for (const [k, v] of Object.entries(params)) url.searchParams.set(k, v);
  const res = await fetch(url, { headers: { "x-api-key": KEY! } });
  return (await res.json()) as {
    success: boolean;
    data?: Record<string, unknown>;
  };
}

const [tiktok, spotify, soundcloud] = await Promise.all([
  get("tiktok/song/videos", { clipId: tiktokClipId }),
  get("spotify/search", { query: spotifyQuery }),
  get("soundcloud/track", { url: soundcloudUrl }),
]);

// Pull the three signals — every list endpoint returns { items, total? }
const tiktokVideos = (tiktok.data?.total as number | undefined) ?? 0;
const spotifyPlays =
  (
    spotify.data?.items as Array<{ post?: { engagement?: { views?: number } } }>
  )?.[0]?.post?.engagement?.views ?? 0;
const soundcloudPlays =
  (soundcloud.data?.post as { engagement?: { views?: number } } | undefined)
    ?.engagement?.views ?? 0;

// Weighted composite. Tune the weights for your use case.
const heat =
  Math.log10(tiktokVideos + 1) * 0.5 +
  Math.log10(spotifyPlays + 1) * 0.3 +
  Math.log10(soundcloudPlays + 1) * 0.2;

console.log({
  tiktok_videos: tiktokVideos,
  spotify_plays: spotifyPlays,
  soundcloud_plays: soundcloudPlays,
  heat_score: heat.toFixed(2),
});

What you get back

// Aggregated, post-composite:
{
  "tiktok_videos": 2400000, // <-- `data.total` from TikTok song/videos
  "spotify_plays": 1180000000, // <-- top track from Spotify search
  "soundcloud_plays": 8200000, // <-- track plays on SoundCloud
  "heat_score": "4.91", // <-- log-weighted composite
}

Credits cost

Cost per run: 3 credits per song (3 platforms × 1 credit). All three platforms are standard tier, so scanning a hundred tracks costs 300 credits.

Take it further

  • See Endpoint pricing for the full standard / advanced / premium tier breakdown.
  • Swap tiktokClipId to discover any sound's reach (find clip IDs via /v1/tiktok/song); change query to any track + artist string.
  • Next: Hybrid search-then-enrich shows the most powerful composition — universal search feeding into per-platform deep-fetches.
  • Platform references: TikTok API, Spotify API. New here? Quickstart.
How to Detect Songs Breaking Out on TikTok, Spotify, and SoundCloud with an API | Socialcrawl