Podcast and show research

List a show's episodes, then fetch the transcript of the video version.

The job

Many shows publish audio on Spotify and video on YouTube. List episodes from one, transcribe the other, and keep both urls.

Endpoints

EndpointReturnsCost
GET /v1/spotify/searchSpotify search1 credit
GET /v1/spotify/podcastSpotify podcast1 credit
GET /v1/spotify/podcast/episodesSpotify podcast episodes1 credit
GET /v1/youtube/playlistYouTube playlist videos1 credit
GET /v1/youtube/video/transcriptYouTube video transcript1 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. Search for the show.
  2. List its episodes.
  3. Fetch the transcript of the matching YouTube video.
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"]

# Spotify search
found = get("/v1/spotify/search", query="Hard Fork", type="show")
# Spotify podcast episodes
episodes = get("/v1/spotify/podcast/episodes", url=found["items"][0]["url"])

for e in episodes["items"][:5]:
    print(e["published_at"], e["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;
}

// Spotify search
const found = await get("/v1/spotify/search", { query: "Hard Fork", type: "show" });
// Spotify podcast episodes
const episodes = await get("/v1/spotify/podcast/episodes", { url: found.items[0].url });

for (const e of episodes.items.slice(0, 5)) console.log(e.published_at, e.url);

Good to know

Spotify lists episodes 20 a page. Matching a Spotify episode to its YouTube video is a step you do by title and date.

Build on social data early.

Developers and agent builders get the first keys.

Get early access