The job
Before a deal, look at what the audience does, not only the follower count. Pull recent videos, compare views to followers, and read the comments.
Endpoints
| Endpoint | Returns | Cost |
|---|---|---|
GET /v1/youtube/channel | YouTube channel details | 1 credit |
GET /v1/youtube/channel/videos | YouTube channel videos | 1 credit |
GET /v1/youtube/video/comments | YouTube video comments | 1 credit |
GET /v1/youtube/video/sponsors | YouTube video sponsors | 1 credit |
GET /v1/tiktok/profile | TikTok profile | 1 credit |
Failed requests and cached repeats cost 0 credits. Send max_age_days to accept a recent cached copy. See credits and caching.
Recipe
- Read the channel for subscribers and verification.
- Pull the latest videos with their view, like and comment counts.
- Read comments on the most recent one.
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"]
# YouTube channel details
profile = get("/v1/youtube/channel", handle="mkbhd")
# YouTube channel videos
videos = get("/v1/youtube/channel/videos", handle="mkbhd", sort="latest")
# YouTube video comments
comments = get("/v1/youtube/video/comments", url=videos["items"][0]["url"])
followers = profile["stats"]["followers"]
for v in videos["items"]:
print(v["stats"]["views"] / followers, v["url"])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;
}
// YouTube channel details
const profile = await get("/v1/youtube/channel", { handle: "mkbhd" });
// YouTube channel videos
const videos = await get("/v1/youtube/channel/videos", { handle: "mkbhd", sort: "latest" });
// YouTube video comments
const comments = await get("/v1/youtube/video/comments", { url: videos.items[0].url });
const followers = profile.stats.followers;
for (const v of videos.items) console.log(v.stats.views / followers, v.url);Good to know
Views divided by followers is a ratio you compute; it is not a quality score. YouTube sponsor detection is marked experimental in the reference.