Instagram Music Licensing: Track Available Songs & Trending Audio
Audio is the backbone of Instagram Reels. Using a trending sound can increase your reach by 300% or more. But how do you know if a sound is actually trending or if it's already saturated?
In this guide, we'll build a tool that takes a Reel URL, extracts its Audio ID, and then analyzes other Reels using that same sound to calculate a "Virality Score."
The "Audio ID" Strategy
Every song or original audio on Instagram has a unique audio_id. By querying this ID, we can see:
- Total Reels: How many videos use this sound? (Low count + High views = Opportunity).
- Recency: Are the top videos from this week or last year?
- Growth Rate: Is the sound gaining momentum?
Prerequisites
You'll need a SociaVault API Key to access the Instagram endpoints.
The Analysis Script
This Node.js script performs a two-step analysis:
- Extract: Gets the
audio_idfrom a source Reel. - Analyze: Fetches other Reels using that audio to gauge performance.
analyze-audio-trend.js
const axios = require('axios');
// CONFIGURATION
const API_KEY = 'YOUR_SOCIAVAULT_API_KEY';
const SOURCE_REEL_URL = 'https://www.instagram.com/reel/C8.../'; // Replace with a Reel using the sound
const headers = {
'x-api-key': API_KEY,
'Content-Type': 'application/json'
};
async function analyzeAudioTrend() {
try {
console.log(`šµ Analyzing Audio from Reel: ${SOURCE_REEL_URL}`);
// --- STEP 1: Get Audio ID ---
const postInfoUrl = `https://api.sociavault.com/v1/scrape/instagram/post-info?url=${encodeURIComponent(SOURCE_REEL_URL)}`;
const postInfoResponse = await axios.get(postInfoUrl, { headers });
const mediaData = postInfoResponse.data.data;
// Extract Audio Details (Structure may vary based on API response, checking common paths)
const audioInfo = mediaData.clips_metadata?.audio_type ? mediaData.clips_metadata : mediaData.music_metadata;
if (!audioInfo) {
console.log('ā No audio metadata found for this Reel.');
return;
}
const audioId = audioInfo.audio_id || audioInfo.music_info?.id;
const audioTitle = audioInfo.music_info?.title || "Original Audio";
const artistName = audioInfo.music_info?.display_artist || "Unknown Artist";
console.log(`ā
Found Audio: "${audioTitle}" by ${artistName}`);
console.log(`š Audio ID: ${audioId}`);
if (!audioId) {
console.log('ā Could not extract specific Audio ID.');
return;
}
// --- STEP 2: Analyze Usage ---
console.log('\nš Fetching Reels using this Audio...');
const audioReelsUrl = `https://api.sociavault.com/v1/scrape/instagram/reels-by-song?audio_id=${audioId}`;
const audioReelsResponse = await axios.get(audioReelsUrl, { headers });
const reels = audioReelsResponse.data.data.items || [];
console.log(`š Analyzed Sample Size: ${reels.length} Reels`);
if (reels.length === 0) {
console.log('ā ļø No other reels found for this audio.');
return;
}
// Calculate Metrics
let totalViews = 0;
let totalLikes = 0;
const viewsArray = [];
reels.forEach(reel => {
const views = reel.play_count || 0;
const likes = reel.like_count || 0;
totalViews += views;
totalLikes += likes;
viewsArray.push(views);
});
const avgViews = Math.floor(totalViews / reels.length);
const avgLikes = Math.floor(totalLikes / reels.length);
const maxViews = Math.max(...viewsArray);
console.log(`\nš Performance Metrics:`);
console.log(` - Average Views: ${avgViews.toLocaleString()}`);
console.log(` - Average Likes: ${avgLikes.toLocaleString()}`);
console.log(` - Top Performing Reel: ${maxViews.toLocaleString()} views`);
// --- STEP 3: Virality Verdict ---
let verdict = "Unknown";
if (avgViews > 500000) verdict = "š„ MEGA VIRAL (High Competition)";
else if (avgViews > 100000) verdict = "š TRENDING (Good Opportunity)";
else if (avgViews > 10000) verdict = "š± RISING (Early Adopter Advantage)";
else verdict = "š¤ DORMANT (Low Reach)";
console.log(`\nšÆ Verdict: ${verdict}`);
} catch (error) {
console.error('Error analyzing audio:', error.response ? error.response.data : error.message);
}
}
analyzeAudioTrend();
How to Use This Data
1. The "Rising" Sweet Spot
Look for audio in the "Rising" category (10k - 100k average views). These sounds are gaining traction but aren't yet saturated. If you jump on these now, the algorithm is more likely to push your content to test the sound's validity.
2. Avoid "Mega Viral" (Sometimes)
If a sound has an average of 500k+ views, it might be too late. Your video will be competing with millions of others. Unless you have a unique twist, you might get drowned out.
3. Business Account Licensing
Remember, if you have a Business Account, you might not have access to copyrighted music. Use this tool to find "Original Audio" trends (user-generated sounds) which are safe for business use and often go viral faster than licensed music.
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.