1. Use cases
  2. Music and sound tracking

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

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

EndpointReturnsCost
TikTok song details1 credit
TikTok videos using a song1 credit
Spotify search1 credit
Spotify track1 credit
Spotify artist1 credit

Recipe

  1. Open the sound on TikTok.
  2. List the videos that use it.
  3. Search the same title on Spotify.
1import os2import requests34API = "https://api.socialscrape.dev"5HEADERS = {"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]}678def get(path, **params):9    res = requests.get(API + path, headers=HEADERS, params=params, timeout=60)10    res.raise_for_status()11    return res.json()["data"]1213# Spotify search14found = get("/v1/spotify/search", query="Espresso", type="track")15# Spotify track16track = get("/v1/spotify/track", url=found["items"][0]["url"])1718print(track)

Calls use api.socialscrape.dev and return the shapes in the reference.

Good to know

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

Related