- Use cases
- Sponsorship and brand deal tracking
Sponsorship and brand deal tracking
Find videos that disclose paid promotion and read the sponsor segments.
The job
A sponsor read is in the transcript. Check the disclosure flag, then search the timestamped text for the brand.
Endpoints
Failed requests and cached repeats cost 0 credits. Send max_age_days to accept a recent cached copy. See credits and caching.
| Endpoint | Returns | Cost |
|---|---|---|
| YouTube video sponsors | 1 credit | |
| YouTube video transcript | 1 credit | |
| YouTube channel videos | 1 credit | |
| TikTok video details | 1 credit | |
| Instagram profile posts | 1 credit |
Recipe
- List a channel's videos.
- Check each for a paid-promotion disclosure.
- Find the brand's name in the transcript.
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# YouTube channel videos14videos = get("/v1/youtube/channel/videos", handle="mkbhd", sort="latest")15# YouTube video sponsors16sponsors = get("/v1/youtube/video/sponsors", url=videos["items"][0]["url"])17# YouTube video transcript18transcript = get("/v1/youtube/video/transcript", url=videos["items"][0]["url"])1920brand = "squarespace"21hits = [s for s in transcript["segments"] if brand in s["text"].lower()]22print(sponsors["extra"], len(hits))1const API = "https://api.socialscrape.dev";2const headers = { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! };34async function get(path: string, params: Record<string, string | number | boolean>) {5 const query = new URLSearchParams(Object.entries(params).map(([k, v]) => [k, String(v)]));6 const res = await fetch(`${API}${path}?${query}`, { headers });7 if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);8 return (await res.json()).data;9}1011// YouTube channel videos12const videos = await get("/v1/youtube/channel/videos", { handle: "mkbhd", sort: "latest" });13// YouTube video sponsors14const sponsors = await get("/v1/youtube/video/sponsors", { url: videos.items[0].url });15// YouTube video transcript16const transcript = await get("/v1/youtube/video/transcript", { url: videos.items[0].url });1718const brand = "squarespace";19const hits = transcript.segments.filter((s: any) => s.text.toLowerCase().includes(brand));20console.log(sponsors.extra, hits.length);Calls use api.socialscrape.dev and return the shapes in the reference.
Good to know
Sponsor inference is experimental and returns a confidence. Treat it as a lead to check, not a verdict.