1. Use cases
  2. Brand monitoring API

Brand monitoring API

Find videos that mention your brand and read what people say under them.

The job

Search your brand name and campaign hashtag, then open the comments on the videos that matter. Keep the ids to avoid reading the same video twice.

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 videos by hashtag1 credit
TikTok video search1 credit
YouTube search1 credit
TikTok video comments1 credit
YouTube video comments1 credit

Recipe

  1. Search the brand and the hashtag.
  2. Open comments on the top videos.
  3. Store what you have seen by id.
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# TikTok videos by hashtag14tagged = get("/v1/tiktok/search/hashtag", hashtag="standingdesk")15# TikTok video comments16comments = get("/v1/tiktok/video/comments", url=tagged["items"][0]["url"])1718for c in comments["items"]:19    print(c["stats"]["likes"], c["text"])

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

Good to know

TikTok hashtag search can return duplicates, so de-duplicate by id.

Related