DEV Community

Intropix-team
Intropix-team

Posted on AI-assisted

Which songs do brands put behind their Instagram reels? How we pulled reel music with Python

A client asked which tracks the big sportswear brands were using in their reels, and whether licensed songs did better than original sound. Answering that by hand means opening each reel and reading the audio label at the bottom. Fine for ten reels, useless for three brands and a quarter of posts.

How we solved it

The audio is part of the post data. We built the PRO Instagram Posts & Reels Scraper on Apify (disclosure: it's ours), which returns audio_title, audio_artist, audio_id and is_original_audio on every post, with no Instagram login. The input per brand:

{
  "usernames": ["nike"],
  "maxPosts": 60,
  "mediaType": "video"
}
Enter fullscreen mode Exit fullscreen mode

maxPosts is one budget per run, spent account by account in input order, so one brand per run. The grouping is by audio_id, because titles collide and the id does not:

from apify_client import ApifyClient
import pandas as pd

client = ApifyClient("YOUR_APIFY_TOKEN")
reels = []
for brand in ["nike", "adidas", "puma"]:
    run = client.actor("intropix/instagram-posts-reels-scraper-pro").call(
        run_input={"usernames": [brand], "maxPosts": 60, "mediaType": "video"})
    reels += list(client.dataset(run["defaultDatasetId"]).iterate_items())

df = pd.DataFrame(reels)
df = df[df["is_original_audio"].notna()]  # drop posts with no audio
tracks = (df[df["is_original_audio"].eq(False)]
          .groupby("audio_id")
          .agg(title=("audio_title", "first"), artist=("audio_artist", "first"),
               brands=("username", "nunique"), views=("view_count", "sum"))
          .sort_values(["brands", "views"], ascending=False))
print(df.groupby(["username", "is_original_audio"])["view_count"].median())
print(tracks.head(20))
Enter fullscreen mode Exit fullscreen mode

What came out

Every reel carries the same four audio fields. A real Red Bull reel from 17-10-2026:

{
  "username": "redbull",
  "view_count": 1588744,
  "share_count": 3450,
  "audio_title": "Original audio",
  "audio_artist": "redbull",
  "audio_id": "26590578263972833",
  "is_original_audio": true
}
Enter fullscreen mode Exit fullscreen mode

The first print is the licensed-versus-original split per brand, as median views. The second is the playlist the client asked for: licensed tracks ranked by how many of the brands used them, then by total views.

Cost

At most $0.005 + $0.002 + 60 x $0.0039 = $0.241 per brand. Photos skipped by mediaType are never billed, so it is usually less.

The caveat

mediaType: "video" still reads maxPosts posts and drops the photos, so a brand whose newest 60 posts are half photos gives you about 30 reels. It also skips photo posts with a music sticker, which carry the same audio fields. And an original sound is a black box: if it is a re-upload of a song, the data does not say so.

To try it without code, the Find the music brands use in Instagram reels task runs the PRO Instagram Posts & Reels Scraper on one account's reels. If captions, likes, comments, views and dates are all you need, without the music fields, the standard Instagram Posts & Reels Scraper returns those at $1.90 per 1,000 posts.

Field list, pricing and n8n or MCP setup are in the PRO actor overview.

Top comments (0)