Music and sound tracking

See which videos use a sound and read the track behind it.

The job

A track takes off when many videos use it. List the videos on a sound, then read the track and artist from a streaming catalogue.

Endpoints

EndpointReturnsCost
GET /v1/tiktok/songTikTok song details1 credit
GET /v1/tiktok/song/videosTikTok videos using a song1 credit
GET /v1/spotify/searchSpotify search1 credit
GET /v1/spotify/trackSpotify track1 credit
GET /v1/spotify/artistSpotify artist1 credit

Failed requests and cached repeats cost 0 credits. Send max_age_days to accept a recent cached copy. See credits and caching.

Recipe

  1. Open the sound on TikTok.
  2. List the videos that use it.
  3. Search the same title on Spotify.
Preview
The API is in early access. Calls use api.socialscrape.io and return the shapes in the reference.
Python
import os
import requests

API = "https://api.socialscrape.io"
HEADERS = {"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]}


def get(path, **params):
    res = requests.get(API + path, headers=HEADERS, params=params, timeout=60)
    res.raise_for_status()
    return res.json()["data"]

# Spotify search
found = get("/v1/spotify/search", query="Espresso", type="track")
# Spotify track
track = get("/v1/spotify/track", url=found["items"][0]["url"])

print(track)
TypeScript
const API = "https://api.socialscrape.io";
const headers = { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! };

async function get(path: string, params: Record<string, string | number | boolean>) {
  const query = new URLSearchParams(Object.entries(params).map(([k, v]) => [k, String(v)]));
  const res = await fetch(`${API}${path}?${query}`, { headers });
  if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
  return (await res.json()).data;
}

// Spotify search
const found = await get("/v1/spotify/search", { query: "Espresso", type: "track" });
// Spotify track
const track = await get("/v1/spotify/track", { url: found.items[0].url });

console.log(track);

Good to know

Replace the example title with your own. Counts on a TikTok sound are what the platform shows publicly at the time.

Build on social data early.

Developers and agent builders get the first keys.

Get early access