Guide · Python

Find every TikTok sound ID for a song with Python

Start from a song title and end with every sound ID TikTok holds it under, the number of videos on each, and the creators behind the official versions.

ScrapingBot 10 min read
Endpoints
/feed/search, /music/info
Cost
1 credit per call
Language
Python 3.9+
Needs
requests
On this page

On TikTok a song is not one sound. The label delivers the track, then a second version, then a remix, and each gets its own sound ID. Creators upload the same audio again, sped up or cut to the chorus, as "original sounds" of their own. Anyone counting how far a song has spread, or looking for the creators who used it, needs all of those IDs, and TikTok has no place to type a song name and get them.

This guide gets them from video search. It searches videos for the song, groups the results by the sound each one uses, asks TikTok how many videos sit under every sound, and writes the list to a CSV. A second script reads the official versions and lists the creators who used them, with follower counts. Every response and output below is real, collected on November 24, 2026 for "Espresso" by Sabrina Carpenter.

Before you start

  • A ScrapingBot API key. Create a free account for 100 credits, enough for one full run of the first script (ours used 64). No card needed.
  • Python 3.9 or newer and pip install requests.
  • A song title and its artist, spelled the way TikTok shows them.

Three ways to a sound ID

A sound ID is a number of about 19 digits, such as 7364498342501435408. The sound endpoints, /music/info and /music/posts, both start from it. Which way you get one depends on what you are holding:

You haveDo thisCost
A sound linkThe ID is the digits at the end: tiktok.com/music/Espresso-7364498342501435408. You can also send the whole link to /music/info as url.Nothing
A video that uses the soundCall / with the video link and read data.music_info.id.1 credit
Only the song's nameSearch videos for it and collect the sounds they use. The rest of this guide.1 credit per page

The video route is one call:

curl -X POST https://scrapingbot.io/api/v1/tiktok \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"endpoint": "/", "params": {"url": "https://www.tiktok.com/@sabrinacarpenter/video/7356991200584305963"}}'
{
  "success": true,
  "data": {
    "id": "7356991200584305963",
    "title": "ESPRESSO VIDEO IS OUT NOW ",
    "create_time": 1712933025,
    "play_count": 16500000,
    "digg_count": 1600000,
    "author": { "unique_id": "sabrinacarpenter", "nickname": "Sabrina Carpenter", … },
    "music_info": {
      "id": "7357135802990021418",
      "title": "espresso sped up",
      "author": "anna <3",
      "album": "",
      "duration": 26,
      "original": true,
      …
    },
    …
  },
  "statusCode": 200,
  "creditsUsed": 1
}

That response already shows the problem this guide is about. The artist's own announcement video, posted on April 12, 2024, does not use the official "Espresso" sound. It uses a sound titled "espresso sped up" that another account uploaded, and 12,200 videos use that upload.

Only have a video ID?

List endpoints return a video_id but not always a link. Write the link as https://www.tiktok.com/@/video/7356991200584305963, with nothing between @ and /video/, and send it as url. We got the same video back, with the real author in data.author.unique_id.

There is no endpoint that searches sounds by name, so search videos. Send the song title and the artist together as keywords to /feed/search:

curl -X POST https://scrapingbot.io/api/v1/tiktok \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"endpoint": "/feed/search", "params": {"keywords": "espresso sabrina carpenter", "count": 30, "region": "US"}}'

Every video in the answer carries the sound it uses in music_info. One of the 30 on our first page, posted by the label the day before:

{
  "success": true,
  "data": {
    "cursor": 30,
    "hasMore": true,
    "searchId": "20261124163802624E7A53BDB2ED13944E",
    "videos": [
      {
        "video_id": "7711511224239852830",
        "title": "Our theme song for the day ☕️ Happy National #Espresso Day! #SabrinaCarpenter ",
        "create_time": 1795476141,
        "play_count": 1790,
        "digg_count": 113,
        "author": { "id": "214255701194612736", "unique_id": "islandofficial", "nickname": "Island Records", … },
        "music_info": {
          "id": "7364498342501435408",
          "title": "Espresso",
          "author": "Sabrina Carpenter",
          "album": "Espresso",
          "duration": 60,
          "original": false,
          "play": "https://sf19.tiktokcdn-us.com/obj/…",
          …
        },
        …
      },
      …
    ]
  },
  "statusCode": 200,
  "creditsUsed": 1
}
Field in music_infoWhat it is
idThe sound ID. Group the videos on it.
title, author, albumFor a label's track, the song, artist and release. For a creator's upload, usually "original sound - " and the handle, with the account's display name as author.
originalfalse for a track from a label's catalogue, true for audio a creator uploaded.
durationLength of the sound in seconds: 60 for every official version in this guide, from 13 to 323 for the creator uploads we counted.
playA link to the audio file. It expires, so listen soon.

For the next page, send the same keywords with the previous page's cursor as offset and its searchId as search_id. Both are needed: an offset without a search ID fails with 400 and "search_id is required when offset is greater than zero." Searching TikTok videos by keyword covers paging in detail.

One song, 110 sounds

Our search ran out after 7 pages. They held 150 different videos, and those videos used 110 different sounds: 3 official versions of the song, 3 other label tracks and 104 creator uploads. If you take the first sound ID you find and stop, you are counting one slice of the song.

How many videos use each sound: /music/info

Search tells you which sounds exist. /music/info tells you how big each one is:

curl -X POST https://scrapingbot.io/api/v1/tiktok \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"endpoint": "/music/info", "params": {"music_id": "7364498342501435408"}}'
{
  "success": true,
  "data": {
    "id": "7364498342501435408",
    "title": "Espresso",
    "author": "Sabrina Carpenter",
    "album": "Espresso",
    "duration": 60,
    "original": false,
    "video_count": 542300,
    "play": "https://sf19.tiktokcdn-us.com/obj/…",
    "cover": "https://p16-common.tiktokcdn-us.com/…"
  },
  "statusCode": 200,
  "creditsUsed": 1
}

Two things to know before you loop over a list of sounds:

  • A 404 is not a zero. For 3 of the 60 sounds in our first run /music/info answered 404, "TikTok music was not found." That is not charged, and it does not mean the sound is empty: for all three, /music/posts still returned videos, 5 to 11 on the first page with more to come. Record the count as unknown.
  • Keep the title from search. /music/info can return a creator upload's title in another language: "original sound - clip.reference" in search came back as "son original - clip.reference" here, and the titles differed for 22 of the first 54 sounds we looked up. The ID, the original flag and the artist's tracks were the same in both.

The script

Save this as find_sounds.py. It pages through the search, files every sound the videos use, looks up the video count of up to MAX_LOOKUPS of them, sorts each sound into one of three kinds, and adds everything to sounds_<song>_<artist>.csv.

import csv
import os
import re
import sys
import time
from datetime import date

import requests

API = "https://scrapingbot.io/api/v1/tiktok"
HEADERS = {"x-api-key": "YOUR_API_KEY"}
MAX_LOOKUPS = 60  # /music/info calls per run, 1 credit each
FIELDS = ["sound_id", "kind", "named", "use", "videos", "counted", "found_in", "views_found",
          "seconds", "title", "author", "example", "sound_url"]
credits = {"used": 0}


class NotFound(Exception):
    pass


class Refused(Exception):
    """Bad input, a bad key or an empty balance: the next call would fail the same way."""


def call(endpoint, params, tries=4):
    """One API call (1 credit). Failed calls are refunded, so a retry costs nothing extra."""
    error = "no answer"
    for attempt in range(tries):
        try:
            res = requests.post(API, headers=HEADERS, timeout=60,
                                json={"endpoint": endpoint, "params": params})
            body = res.json()
            if not isinstance(body, dict):
                raise ValueError("unexpected response")
        except (requests.RequestException, ValueError) as err:
            error = str(err)  # a dropped connection or a non-JSON answer: try again
        else:
            if body.get("success"):
                credits["used"] += body.get("creditsUsed", 0)
                return body.get("data") or {}
            error = body.get("error") or f"HTTP {res.status_code}"
            if res.status_code == 404:
                raise NotFound(error)
            if res.status_code in (400, 401, 402, 403):
                raise Refused(error)
        time.sleep(2 ** attempt)  # 408, 429 or 5xx: wait and try again
    raise RuntimeError(f"kept failing: {error}")


def video_id(video):
    """A video's ID. Some pages leave video_id empty and carry the number in aweme_id."""
    for key in ("video_id", "aweme_id"):
        value = str(video.get(key) or "")
        if value.isascii() and value.isdigit():
            return value
    return ""


def text(value):
    """Titles and names are free text: keep a spreadsheet from running one as a formula."""
    value = " ".join(str(value or "").split())
    return "'" + value if value[:1] in ("=", "+", "-", "@") else value


def words(value):
    return " " + " ".join(re.findall(r"\w+", str(value).lower())) + " "


def kind(music, song, artist):
    """release: the artist's own track. upload: a creator's audio. other: a different track."""
    if music.get("original"):
        return "upload"
    if words(song) in words(music.get("title")) and words(artist) in words(music.get("author")):
        return "release"
    return "other"


def chosen(row):
    """The rows that are the song: the artist's releases, and uploads the reader marked use = yes."""
    return row["kind"] == "release" or (row.get("use") or "").strip().lower() == "yes"


def search_sounds(keywords, pages, rows, seen, found, song, artist, region="US"):
    """Search videos for the song and file every sound they use under its ID."""
    params = {"keywords": keywords, "count": 30, "region": region}
    for _ in range(pages):
        try:
            data = call("/feed/search", params)
        except RuntimeError as err:
            print(f"search stopped after {len(seen)} videos: {err}")
            break
        batch = data.get("videos") or []
        for v in batch:
            music = v.get("music_info") or {}
            vid, sound_id = video_id(v), str(music.get("id") or "")
            if not vid or vid in seen or not sound_id:
                continue
            seen.add(vid)
            if sound_id not in found:
                found[sound_id] = {"found_in": 0, "views_found": 0}
                handle = (v.get("author") or {}).get("unique_id") or ""
                slug = "-".join(re.findall(r"\w+", music.get("title") or "")) or "sound"
                old = rows.get(sound_id, {})
                rows[sound_id] = {  # the count and the reader's own "use" mark survive a refresh
                    "sound_id": sound_id, "kind": kind(music, song, artist),
                    "named": "yes" if words(song) in words(music.get("title")) else "",
                    "use": old.get("use", ""), "videos": old.get("videos"),
                    "counted": old.get("counted", ""), "seconds": old.get("seconds", ""),
                    "title": text(music.get("title")), "author": text(music.get("author")),
                    "example": f"https://www.tiktok.com/@{handle}/video/{vid}",
                    "sound_url": f"https://www.tiktok.com/music/{slug}-{sound_id}"}
            found[sound_id]["found_in"] += 1
            found[sound_id]["views_found"] += v.get("play_count") or 0
            rows[sound_id].update(found[sound_id])
        if not data.get("hasMore") or not batch:
            break
        # The next page needs both the cursor and the search ID from this one.
        params = {**params, "offset": data["cursor"], "search_id": data["searchId"]}


def add_counts(rows, found):
    """Ask /music/info how many videos use each sound, the sounds that matter most first."""
    def priority(r):
        if chosen(r):
            return 0  # the song itself: always refreshed
        if r["videos"] is None and r["counted"] == "":
            return 1  # never counted, from this run or an earlier one
        return 2 if r["sound_id"] in found else 3  # counted before and seen again
    order = sorted((r for r in rows.values() if priority(r) < 3),
                   key=lambda r: (priority(r), r["kind"] == "upload",
                                  -int(r["found_in"] or 0), -int(r["views_found"] or 0)))
    for r in order[:MAX_LOOKUPS]:
        try:
            info = call("/music/info", {"music_id": r["sound_id"]})
        except NotFound:
            r["counted"] = "no details"  # the count is unknown, not zero: its videos may still be listed
            continue
        except RuntimeError:
            continue  # kept failing: stays uncounted for the next run
        if info.get("video_count") is None:
            r["counted"] = "no details"
            continue
        r["videos"], r["counted"] = int(info["video_count"]), date.today().isoformat()
        r["seconds"] = info.get("duration") or ""


def load(path):
    if not os.path.exists(path):
        return {}
    with open(path, newline="", encoding="utf-8") as f:
        rows = {r["sound_id"]: {k: r.get(k) or "" for k in FIELDS} for r in csv.DictReader(f)}
    for r in rows.values():
        r["videos"] = int(r["videos"]) if r["videos"].isdigit() else None
    return rows


if __name__ == "__main__":
    if len(sys.argv) < 3:
        sys.exit('usage: python find_sounds.py "Song title" "Artist" [pages] ["other keywords"]')
    song, artist = sys.argv[1], sys.argv[2]
    pages = int(sys.argv[3]) if len(sys.argv) > 3 else 3
    keywords = sys.argv[4] if len(sys.argv) > 4 else f"{song} {artist}"
    # One file per song and artist: another artist's song of the same name gets its own.
    path = "sounds_" + "_".join(re.findall(r"\w+", f"{song} {artist}".lower())) + ".csv"

    rows = load(path)  # sounds found by earlier runs stay in the file
    known = len(rows)
    stopped, seen, found = None, set(), {}
    try:
        search_sounds(keywords, pages, rows, seen, found, song, artist)
        add_counts(rows, found)
    except Refused as err:
        stopped = err  # every sound found before the refused call is still saved
    ranked = sorted(rows.values(), key=lambda r: -1 if r["videos"] is None else r["videos"],
                    reverse=True)

    print(f'"{keywords}": {len(seen)} videos, {len(found)} different sounds, '
          f"{len(rows) - known} new in {path}")
    print(f"{'sound_id':<21}{'kind':<8}{'videos':>9}  title")
    for r in [r for r in ranked if r["kind"] != "other" and r["videos"] is not None][:12]:
        print(f"{r['sound_id']:<21}{r['kind']:<8}{r['videos']:>9,}  {r['title'][:44]}")
    print(f"{'kind':<8}{'sounds':>6}{'counted':>8}{'videos':>12}")
    for k, named, note in (("release", "yes", "the artist's own versions"),
                           ("upload", "yes", "creator audio that names the song"),
                           ("upload", "", "other creator audio: check by ear"),
                           ("other", None, "different tracks")):
        part = [r for r in ranked if r["kind"] == k and named in (None, r["named"])]
        counts = [r["videos"] for r in part if r["videos"] is not None]
        print(f"{k:<8}{len(part):>6}{len(counts):>8}{sum(counts):>12,}  {note}")

    with open(path + ".tmp", "w", newline="", encoding="utf-8") as f:
        writer = csv.DictWriter(f, fieldnames=FIELDS, extrasaction="ignore")
        writer.writeheader()
        writer.writerows({**r, "videos": "" if r["videos"] is None else r["videos"]} for r in ranked)
    os.replace(path + ".tmp", path)
    print(f"{credits['used']} credits; {len(ranked)} sounds in {path}")
    if stopped:
        sys.exit(f"stopped early: {stopped}")
  • Three kinds. A sound is a release when TikTok does not mark it original, its title contains the song title and its author contains the artist. It is an upload when a creator uploaded it. Everything else is other: a different track that a matching video happened to use. The named column says whether the sound's own title contains the song title, which is the best hint an upload gives you.
  • Every sound is saved, counted or not. A search can turn up more sounds than one run counts. The ones over the limit go into the file with an empty videos cell, and the next run counts them without having to find them again. counted holds the date of a sound's last count, or "no details" after a 404.
  • The song comes first. Each run spends its lookups on the artist's releases and the rows you marked, then on sounds that have never been counted, label tracks before uploads and the most used first, and last on refreshing sounds it has seen again. Raise MAX_LOOKUPS to count more per run; each lookup is 1 credit.
  • Runs add up. The CSV is read before it is written, so a run with other keywords, or the same search another day, adds the sounds it finds. Nothing an earlier run found is dropped, and the file is named after the song and the artist, so another artist's song of the same name gets its own.
  • The search stops by itself. pages is a ceiling. TikTok ended our first search after 7 pages, so asking for 10 cost 7 credits.
  • Errors. A bad key, an empty balance or bad input stops the run, and every sound found up to then is still written. Timeouts, 429 and server errors are retried with a growing pause; a sound that keeps failing stays uncounted for the next run. Failed calls are refunded.

Run it

Pass the song, the artist and the most pages you are willing to pay for:

python find_sounds.py "Espresso" "Sabrina Carpenter" 10
"Espresso Sabrina Carpenter": 150 videos, 110 different sounds, 110 new in sounds_espresso_sabrina_carpenter.csv
sound_id             kind       videos  title
7364498342501435408  release   542,300  Espresso
7065812624075655942  upload    224,400  original sound - scarflosgf
7369680652205459472  release   210,200  Espresso - On Vacation Version
7384481148137065248  upload     26,800  original sound - 13gracies
7486881250561592087  upload     13,800  original sound - clip.reference
7357135802990021418  upload     12,200  espresso sped up
7413088520594459425  upload      4,308  original sound - speed.up.editz_audios
7627915397060233998  upload      3,769  original sound - _dvndelion
7374921172830439425  release     3,264  Espresso
7588557287775898386  upload      2,563  original sound - elvizmagician
7432472174692207406  upload      1,374  original sound - melanieae
7492475469552503594  upload        728  original sound - gigi.lyricsss
kind    sounds counted      videos
release      3       3     755,764  the artist's own versions
upload       3       1      12,200  creator audio that names the song
upload     101      51     279,840  other creator audio: check by ear
other        3       2   1,100,171  different tracks
64 credits; 110 sounds in sounds_espresso_sabrina_carpenter.csv

Seven search pages and 60 lookups, three of them free 404s: 64 credits and 53 seconds. All 110 sounds are in the file and 57 have a count. Three official versions turned up, and the second-biggest sound on the list is a creator's upload. More on those below.

What you get is the sounds used by the videos TikTok returned for one search, not a catalogue. Results change from run to run, and one phrasing does not reach every version. So run it again with the words people add when they look for edits. The fourth argument replaces the search keywords; the song and artist are still used to sort the sounds:

python find_sounds.py "Espresso" "Sabrina Carpenter" 10 "espresso sped up"
"espresso sped up": 111 videos, 80 different sounds, 63 new in sounds_espresso_sabrina_carpenter.csv
sound_id             kind       videos  title
7364498342501435408  release   542,300  Espresso
7360647485422963457  upload    251,900  ESPRESSO
7065812624075655942  upload    224,400  original sound - scarflosgf
7369680652205459472  release   210,200  Espresso - On Vacation Version
7358680993638697774  upload    101,800  Espresso
7361124947986811680  upload     81,500  original sound - spexdsoundsx
7369680652205443088  release    81,300  Espresso - Double Shot Version
7356767719389268768  upload     47,800  espresso sped up
7384481148137065248  upload     26,800  original sound - 13gracies
7410208076378835755  upload     24,600  original sound - carneyval
7379462945899776814  upload     15,300  E S P R E S S O
7486881250561592087  upload     13,800  original sound - clip.reference
kind    sounds counted      videos
release      4       4     837,064  the artist's own versions
upload      12       8     416,855  creator audio that names the song
upload     150      96     406,130  other creator audio: check by ear
other        7       6   4,135,485  different tracks
65 credits; 173 sounds in sounds_espresso_sabrina_carpenter.csv

63 sounds the first search had not shown, among them a fourth official version and the largest creator uploads. Then the first command again, two minutes after the first run:

"Espresso Sabrina Carpenter": 134 videos, 98 different sounds, 34 new in sounds_espresso_sabrina_carpenter.csv
…
kind    sounds counted      videos
release      5       5     861,064  the artist's own versions
upload      12      10     416,857  creator audio that names the song
upload     181     147     509,315  other creator audio: check by ear
other        9       8  31,635,486  different tracks
66 credits; 207 sounds in sounds_espresso_sabrina_carpenter.csv

The same search found 34 more sounds, one of them a fifth official version with 24,000 videos, and 56 more sounds got a count: 170 of the 207 in the file now have one. The official versions, with the album /music/info reports for each:

Sound IDTitleAlbumVideosFirst found by
7364498342501435408EspressoEspresso542,300Run 1
7369680652205459472Espresso - On Vacation VersionEspresso EP210,200Run 1
7369680652205443088Espresso - Double Shot VersionEspresso EP81,300Run 2
7364506751167023120EspressoEspresso24,000Run 3
7374921172830439425EspressoEspresso - Working Late Remixes3,264Run 1

Five sounds, 861,064 videos. The main one holds 542,300 of them, 63%. A report built on that one ID would miss 318,764 videos made with the label's own versions of the song. Three of the five are titled plain "Espresso", so the title alone will not tell them apart: keep the ID. And since it took three searches to see all five, there may be a sixth: when the list matters, run the search on more than one day.

The CSV has one row per sound, sorted by video count. Its header and the main sound's row:

sound_id,kind,named,use,videos,counted,found_in,views_found,seconds,title,author,example,sound_url
7364498342501435408,release,yes,,542300,2026-11-24,36,36014940,60,Espresso,Sabrina Carpenter,https://www.tiktok.com/@islandofficial/video/7711511224239852830,https://www.tiktok.com/music/Espresso-7364498342501435408

found_in is how many videos of the latest search that showed the sound used it, and views_found is their views added up. example is one of those videos and sound_url is the sound's page, for listening. use is yours to fill in; the next section says when.

Creator uploads: listen before you count

The 193 creator uploads in the file are candidates, not answers. Some name the song in their own title:

Sound IDTitleSecondsVideos
7360647485422963457ESPRESSO46251,900
7358680993638697774Espresso18101,800
7356767719389268768espresso sped up1647,800
7357135802990021418espresso sped up2612,200

Twelve uploads do. The ten with a count hold 416,857 videos between them, almost half as many again as the official versions. If they are what their titles say, the second-largest "Espresso" sound in this file is a creator's upload, ahead of four of the five official versions.

Others are probably not. "back on 74 filmsbymai_", with 94,900 videos, is in the file because one video from the artist's account used it; its title names a different song. And 120 of the 157 uploads counted so far have fewer than 100 videos. Three checks, cheapest first:

  • named is yes. An upload whose own title says "espresso" is very likely the song.
  • found_in is 2 or more. A sound that several of the matching videos use is a better bet than one that appears once.
  • Listen. Open sound_url or the example video. Nothing in the data says what the audio contains, and for a sound with 80,000 videos it takes ten seconds to be sure.

When an upload is the song, write yes in its use column. The next script reads every release row and every row marked that way, and later runs of find_sounds.py keep your mark and refresh that sound's count along with the releases.

From sounds to creators

With the sound IDs in a file, the question most people came with is one loop away: who used the song? Save this next to the first script as sound_creators.py. For every release row, and every row you marked use, it pages through /music/posts, adds up videos and views per creator, then looks up follower counts for the creators with the most views.

import csv
import sys

from find_sounds import NotFound, Refused, call, chosen, credits, text, video_id

FIELDS = ["creator", "followers", "videos", "views", "likes", "top_video", "name"]


def sound_pages(sound_id, pages):
    """Up to `pages` pages of the videos using a sound, about 10 a page, one page at a time."""
    params = {"music_id": sound_id, "count": 35}
    for _ in range(pages):
        data = call("/music/posts", params)
        yield data.get("videos") or []
        # Only hasMore 0 ends the list; a cursor that stops moving would repeat the page.
        if not data.get("hasMore") or data.get("cursor") == params.get("cursor"):
            break
        params = {"music_id": sound_id, "count": 35, "cursor": data["cursor"]}


if __name__ == "__main__":
    if len(sys.argv) < 2:
        sys.exit("usage: python sound_creators.py <sounds csv> [pages per sound] [profiles]")
    path = sys.argv[1]
    pages = int(sys.argv[2]) if len(sys.argv) > 2 else 20
    profiles = int(sys.argv[3]) if len(sys.argv) > 3 else 25
    with open(path, newline="", encoding="utf-8") as f:
        sounds = [row for row in csv.DictReader(f) if chosen(row)]
    if not sounds:
        sys.exit(f"no rows with kind = release or use = yes in {path}")

    stopped = None
    videos, creators = {}, {}
    for row in sounds:
        read, note = 0, ""
        try:
            for page in sound_pages(row["sound_id"], pages):
                for v in page:  # kept page by page: a later failure loses nothing already read
                    vid = video_id(v)
                    if vid and vid not in videos:
                        videos[vid] = v
                        read += 1
        except (NotFound, RuntimeError) as err:
            note = f" (stopped: {err})"  # often a sound TikTok no longer lists
        except Refused as err:
            stopped, note = err, f" (stopped: {err})"
        print(f"{row['sound_id']}  {read} videos read{note}  {row['title']}")
        if stopped:
            break  # a bad key or an empty balance: the next sound would fail the same way

    for vid, v in videos.items():
        author = v.get("author") or {}
        if not author.get("unique_id"):
            continue
        c = creators.setdefault(author["unique_id"], {
            "creator": author["unique_id"], "name": text(author.get("nickname")),
            "followers": "", "videos": 0, "views": 0, "likes": 0, "top_video": "", "top": -1})
        c["videos"] += 1
        c["views"] += v.get("play_count") or 0
        c["likes"] += v.get("digg_count") or 0
        if (v.get("play_count") or 0) > c["top"]:
            c["top"] = v.get("play_count") or 0
            c["top_video"] = f"https://www.tiktok.com/@{c['creator']}/video/{vid}"
    ranked = sorted(creators.values(), key=lambda c: c["views"], reverse=True)

    try:
        for c in ranked[:0 if stopped else profiles]:  # follower counts for the most-viewed creators
            try:
                info = call("/user/info", {"unique_id": c["creator"]})
            except (NotFound, RuntimeError):
                continue  # renamed, banned or deleted since the video was posted
            c["followers"] = (info.get("stats") or {}).get("followerCount", "")
    except Refused as err:
        stopped = err

    print(f"{'creator':<25}{'followers':>11}{'videos':>8}{'views':>15}")
    for c in ranked[:10]:
        followers = f"{c['followers']:,}" if isinstance(c["followers"], int) else "?"
        print(f"@{c['creator']:<24}{followers:>11}{c['videos']:>8}{c['views']:>15,}")
    out = path.rsplit(".", 1)[0] + "_creators.csv"
    with open(out, "w", newline="", encoding="utf-8") as f:
        writer = csv.DictWriter(f, fieldnames=FIELDS, extrasaction="ignore")
        writer.writeheader()
        writer.writerows(ranked)
    print(f"{len(videos)} videos by {len(ranked)} creators, {credits['used']} credits; saved to {out}")
    if stopped:
        sys.exit(f"stopped early: {stopped}")
python sound_creators.py sounds_espresso_sabrina_carpenter.csv 20 25

That is 20 pages per sound and follower counts for the top 25 creators:

7364498342501435408  204 videos read  Espresso
7369680652205459472  209 videos read  Espresso - On Vacation Version
7369680652205443088  186 videos read  Espresso - Double Shot Version
7364506751167023120  168 videos read  Espresso
7374921172830439425  175 videos read  Espresso
creator                    followers  videos          views
@jeshastevens              3,500,000       4     91,005,966
@kimnlizasmr               7,400,000      19     76,854,272
@gala.fr                  19,700,000       8     64,926,221
@jasminelars                 250,300       1     47,569,270
@anhelamakeup                122,600       3     38,637,357
@guma_cook                 2,100,000       4     31,930,030
@teamsabrina               9,000,000       7     30,733,245
@ive.official             12,500,000       1     30,707,349
@kokomyothae                 232,300      13     25,516,205
@sobrizzle                   225,100       2     24,401,079
942 videos by 826 creators, 125 credits; saved to sounds_espresso_sabrina_carpenter_creators.csv

100 pages and 25 profile lookups: 125 credits and 3 minutes 30 seconds. What the run showed:

  • A page holds about 10 videos, whatever count says. 20 pages returned between 168 and 209 videos per sound. Budget one credit per 10 videos.
  • The biggest videos come first. On the main sound, the median video on page 1 had 20.5 million views; on page 20 it had 1.5 million. Of the 204 videos, 152 were posted in 2024. So the first pages are a sound's hits, not its newest videos. For what is being posted now, snapshot the sound every day with the daily sound tracker.
  • Almost every video is a different creator. 942 videos came from 826 accounts, and only 43 of them posted more than one.
  • Views and followers are different lists. 14 of the 25 most-viewed creators have fewer than 500,000 followers. @jasminelars, with 250,300, has one video on the song with 47.6 million views.
  • Each official version brings its own creators. Reading only the main sound would have returned 204 of these 942 videos.
  • Pages are kept as they arrive. If a page keeps failing or the balance runs out, the videos already read still go into the report, and that sound's line says where it stopped. A video is identified by video_id, or by a numeric aweme_id on the pages that leave video_id empty.

The CSV has every creator, not only the ten printed: creator, followers (filled for the top 25), videos, views, likes, a link to their most-viewed video on the song, and their display name. A display name that starts with @, =, + or - gets a leading apostrophe so a spreadsheet does not run it as a formula. To size up the shortlist further, TikTok follower and like counts with Python adds engagement from each creator's recent videos.

What it costs

StepCalls in our runCredits
First search, to the end7 pages, 57 sounds counted64
Second search, other keywordsthe pages TikTok had, up to 60 lookups65
The first search againthe pages TikTok had, up to 60 lookups66
Creators of 5 official versions100 pages, 25 profiles125

320 credits for one song, start to finish: about 6 cents on the Starter plan ($49.99 for 275,000 credits). A new account's 100 free credits cover the first search. Failed calls are refunded, and a 404 from /music/info costs nothing.

Where to go from here

Common questions

Is there an API to search TikTok sounds by song name?

Not as one call: /music/info and /music/posts both need a sound ID. Search videos instead. POST {"endpoint": "/feed/search", "params": {"keywords": "espresso sabrina carpenter", "count": 30, "region": "US"}} to https://scrapingbot.io/api/v1/tiktok with your key in the x-api-key header, and read music_info.id on every result. One search for that song returned 150 videos that used 110 different sounds.

How do I get the sound ID from a TikTok video?

Send the video link as url to the / endpoint and read data.music_info.id. The same music_info object is on every video in search results. It costs 1 credit and needs no TikTok login.

Can I look up a TikTok video when I only have its ID?

Yes. Write the link as https://www.tiktok.com/@/video/ followed by the ID and send it as url to the / endpoint. The handle can stay empty: the response carries the real author in data.author.unique_id.

Why does one song have several sound IDs on TikTok?

Every release version is a sound of its own, and anyone can upload the same audio again as an "original sound". For "Espresso" by Sabrina Carpenter three searches found five official versions with 861,064 videos between them on November 24, 2026. The main one held 63% of those.

What does original: true mean on a TikTok sound?

A creator uploaded the audio; it did not come from a label's catalogue. It can be the song (sped up, slowed down, a short clip), or something unrelated that a matching video happened to use. The API cannot tell you which, so open the sound and listen before you count it.

How many credits does finding a song's sounds use?

One credit per search page and one per sound counted. Our first run used 7 pages and counted 57 sounds, 64 credits, which fits inside the 100 free credits of a new account. A sound whose details are not available answers 404 and is not charged.

Start scraping in the next five minutes.

100 free credits, no credit card. One API key works for websites, TikTok, Instagram, Google, Amazon and ChatGPT.