Build your TikTok song shortlist with SocQ. Bring chart entries, sound IDs, artists and video usage counts together, then connect each sound to its details and example videos for a source-backed content brief.
The SocQ TikTok Popular Songs API reads the TikTok app's Top 50 and Viral 50 charts. This guide covers chart selection, requests, JSON and CSV exports, and video lookup by sound ID.
Quick answer: Send
chart_type=toporchart_type=viraltoPOST /v1/tiktok/popular-songs. Save the returned task ID, wait for success and readdata.results.items. The default is Top 50 with a limit of 20;results_limitaccepts integers from 1 to 50.
Choose Top 50 or Viral 50
| Input | Chart selected | When to use it |
|---|---|---|
chart_type: "top" | TikTok app Top 50 | Build a list from this named chart |
chart_type: "viral" | TikTok app Viral 50 | Build a Viral 50 list or compare its sound IDs with Top 50 |
Omit chart_type | Top 50 | Use the default chart |
When collecting both charts, save chart_type alongside each record. Keep both chart observations when a sound appears in both lists, and use audio.id to match the sound across them.
chart_type selects the chart and results_limit sets the collection cap. Viral 50 is the name of a TikTok app chart. Country filters, date filters and growth measurements are addressed in the FAQ below.
Request the Songs Chart
Set SOCQ_API_KEY in your environment and submit the request:
curl -X POST "https://api.socq.ai/v1/tiktok/popular-songs" \
-H "Authorization: Bearer $SOCQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"chart_type":"top","results_limit":20}'
Change top to viral to select Viral 50. Set results_limit to 50 to collect up to 50 entries from that chart; the task's result_count gives the actual number saved.
The submission response contains data.task_id. Assign that value to TASK_ID, then query the existing task:
curl "https://api.socq.ai/v1/tasks/$TASK_ID?limit=50" \
-H "Authorization: Bearer $SOCQ_API_KEY"
Wait while the status is queued, running or retrying. Read data.results.items after succeeded; inspect data.error_message after failed. Keep a task ID when a client request times out so you can resume querying it.
results_limit sets the collection cap. In task retrieval, limit sets the page size and cursor identifies the next saved page. The songs collection cap is 50 entries.
Identify the Sound Behind Each Song
This song-record example shows the sound ID, title, artist, video usage count and collection time:
{
"id": "6711980022204205826",
"type": "music",
"name": "we fell in love in october",
"audio": {
"id": "6711980022204205826",
"title": "we fell in love in october",
"artist": "girl in red"
},
"duration_seconds": 42,
"metrics": {"videos_count": 2031150},
"collected_at": "2026-10-15T08:12:54.524359Z"
}
Use audio.id for follow-up calls. Save it as a string and import it as text in spreadsheet tools to retain every digit. Matching by sound ID distinguishes separate sounds that share a title.
metrics.videos_count is the reported total of videos using the sound. Null means the source omitted the measurement; 0 is a returned count of zero. To compare captures, match the sound IDs and calculate the difference between the two counts.
cover_url holds the cover address and audio.url holds the audio address. When audio.url is null, use the sound ID, title and artist to organize the list. Check the response from an audio URL when accessing the media.
Export a Sound List to JSON and CSV with Python
Save the following task helper as socq_collect.py. It uses Python's standard library, prints the task ID and reads every saved result page:
import json
import os
import time
from urllib.parse import urlencode
from urllib.request import Request, urlopen
BASE = "https://api.socq.ai/v1"
PENDING = {"queued", "running", "retrying"}
def api(method, path, payload=None):
body = json.dumps(payload).encode("utf-8") if payload is not None else None
request = Request(
BASE + path, data=body, method=method,
headers={
"Authorization": "Bearer " + os.environ["SOCQ_API_KEY"],
"Content-Type": "application/json",
},
)
with urlopen(request, timeout=60) as response:
result = json.load(response)
if result.get("code") != 200:
raise RuntimeError(result)
return result["data"]
def collect(endpoint, payload):
task_id = api("POST", "/" + endpoint, payload)["task_id"]
print("Task:", task_id, flush=True)
path = "/tasks/" + task_id
deadline = time.monotonic() + 600
data = api("GET", path + "?limit=100")
while data["status"] in PENDING:
if time.monotonic() >= deadline:
raise TimeoutError("Resume GET " + path + "; do not resubmit automatically")
time.sleep(2)
data = api("GET", path + "?limit=100")
if data["status"] != "succeeded":
raise RuntimeError(data.get("error_message") or data["status"])
items, seen_cursors = [], set()
while True:
if time.monotonic() >= deadline:
raise TimeoutError("Resume pagination for " + task_id)
page = data["results"]
items.extend(page["items"])
if not page["has_more"]:
return task_id, items
cursor = page.get("next_cursor")
if not cursor or cursor in seen_cursors:
raise RuntimeError("Missing or repeated result cursor")
seen_cursors.add(cursor)
data = api("GET", path + "?" + urlencode({"limit": 100, "cursor": cursor}))
if data["status"] != "succeeded":
raise RuntimeError("Task is not ready for result pagination")
Save this export as export_songs.py in the same directory:
import csv
import json
import sys
from socq_collect import collect
chart = sys.argv[1] if len(sys.argv) > 1 else "top"
if chart not in {"top", "viral"}:
raise SystemExit("Usage: python3 export_songs.py [top|viral]")
payload = {"chart_type": chart, "results_limit": 20}
task_id, items = collect("tiktok/popular-songs", payload)
with open(f"songs-{chart}.json", "w", encoding="utf-8") as f:
json.dump({"task_id": task_id, "input": payload, "items": items},
f, ensure_ascii=False, indent=2)
fields = ["chart_type", "sound_id", "title", "artist", "videos_count",
"duration_seconds", "url", "collected_at"]
def csv_cell(value):
if value is None:
return ""
if isinstance(value, str) and value.lstrip().startswith(("=", "+", "-", "@")):
return "'" + value
return value
with open(f"songs-{chart}.csv", "w", encoding="utf-8-sig", newline="") as f:
writer = csv.DictWriter(f, fieldnames=fields)
writer.writeheader()
for item in items:
audio = item.get("audio") or {}
row = {"chart_type": chart, "sound_id": audio.get("id"),
"title": item.get("name"), "artist": audio.get("artist"),
"videos_count": (item.get("metrics") or {}).get("videos_count"),
"duration_seconds": item.get("duration_seconds"),
"url": item.get("url"), "collected_at": item.get("collected_at")}
writer.writerow({k: csv_cell(v) for k, v in row.items()})
python3 export_songs.py top
python3 export_songs.py viral
Each command creates a separate collection task. The JSON keeps the original records and request; the CSV is a review table. Formula-like public text is escaped in CSV while JSON retains the original values. Import sound IDs as text in spreadsheet tools.
Save exports by capture date. Comparing the same sound's metrics.videos_count gives a difference between those two observations. Label a sound absent from a later chart as "not observed in this capture"; check the individual sound separately to investigate deletion.
Find Videos That Use a Returned Sound
Choose a sound from the export and pass its audio.id to TikTok Song Videos:
curl -X POST "https://api.socq.ai/v1/tiktok/song-videos" \
-H "Authorization: Bearer $SOCQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"music_ids":["6711980022204205826"],"results_limit":20}'
This creates a separate video collection task, with its own results_limit. Use TikTok Song for sound details, or the TikTok search tutorial to research a topic across videos and image posts.
For a content brief, keep the sound ID, chart type, capture time, source URL and example videos together so a reviewer can check each item.
Put the Charts to Work in Your Music Research
SocQ connects chart retrieval, sound details and related-video lookup through the same task workflow. Use the export code to organize research by chart and capture time, then add video examples to each sound. Your next shortlist starts with records you can review and reuse.
Open the Popular Songs API and build your shortlist.
FAQ
Is this a TikTok trending sounds API?
Yes. Its scope is the TikTok app's Top 50 and Viral 50 charts. Select a chart with chart_type and organize the returned sounds by ID.
Can I choose a country or a date range?
Collection is organized by chart type. The supported inputs are chart_type, results_limit and optional task-completion callback_url. Country, date, new-entry and commercial-music filters are not provided.
Can I get more than 50 songs with pagination?
Each task collects up to 50 entries. Result pagination reads the songs already saved by that task.
Does Viral 50 include a growth score or rank change?
The standard record provides sound information and video usage counts; growth scores and rank changes are not included. Save repeated captures and calculate differences by sound ID when comparing observations.
Does a sound ID identify every recording of the same song?
A sound ID identifies one TikTok sound. Save separate clips or versions under their own IDs, even when they share a song title.
Can I download every song or filter for business-approved music?
When audio.url has a value, try that address to access the audio. When it is null, retain the sound ID for a details lookup. Commercial-use eligibility requires a separate check; this endpoint provides neither an approval field nor a corresponding filter.
How do I get videos using one of the songs?
Send the returned audio.id in the music_ids array to TikTok Song Videos. It is a separate task with its own collection limit and billing. Check the Popular Songs API page for the current input and billing details.
TIKTOK API
Test the workflow with a public TikTok URL
Submit public inputs and receive normalized records with traceable source context.
Explore TikTok APIs