Livestream monitoring

Check whether a creator is live and when they usually stream.

The job

Live is time-bound. Check on a schedule, record when a stream starts, and keep the Twitch schedule beside what actually happened.

Endpoints

EndpointReturnsCost
GET /v1/tiktok/profile/liveIs a TikTok user live1 credit
GET /v1/tiktok/liveTikTok live room info1 credit
GET /v1/twitch/user/scheduleTwitch stream schedule1 credit
GET /v1/twitch/user/videosTwitch user videos1 credit
GET /v1/youtube/channel/livesYouTube channel live streams1 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. Check the creator's live room.
  2. Read the Twitch schedule.
  3. Store start times next to the schedule.
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"]

# Twitch stream schedule
schedule = get("/v1/twitch/user/schedule", handle="shroud")
# Twitch user videos
videos = get("/v1/twitch/user/videos", handle="shroud", type="archive", sort="time", limit=10)

print(schedule)
for v in videos["items"]:
    print(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;
}

// Twitch stream schedule
const schedule = await get("/v1/twitch/user/schedule", { handle: "shroud" });
// Twitch user videos
const videos = await get("/v1/twitch/user/videos", { handle: "shroud", type: "archive", sort: "time", limit: 10 });

console.log(schedule);
for (const v of videos.items) console.log(v.url);

Good to know

TikTok live data is room-level. Find the room first with the profile live endpoint.

Build on social data early.

Developers and agent builders get the first keys.

Get early access