Skip to Content
Podcast Lookup

Follow new episodes

Watch a list of podcasts and react when they publish.

There are no webhooks yet, so following shows means checking them on a schedule. Done right, it costs one or two credits per show per check.

The loop

For each podcast you follow:

  1. POST /podcasts/:id/refresh: re-reads the feed. The response says how many new_episodes it found.
  2. If new_episodes > 0, GET /podcasts/:id/episodes?page_size=<new_episodes> returns exactly the new ones, newest first.
watch.ts
import { lookup } from "./lookup" // see "Transcripts end to end"

const following = [8017674, 920666, 1234567]

for (const podcastId of following) {
  try {
    const { new_episodes } = await lookup<any>(`/podcasts/${podcastId}/refresh`, { method: "POST" })
    if (new_episodes === 0) continue

    const { episodes } = await lookup<any>(`/podcasts/${podcastId}/episodes?page_size=${Math.min(new_episodes, 100)}`)
    for (const episode of episodes) console.log("new:", episode.title, episode.url)
  } catch (error: any) {
    // refresh_too_soon: someone refreshed it in the last minute, the episodes are already fresh
    if (error.code !== "refresh_too_soon") console.error(podcastId, error.code, error.message)
  }
}

How often?

Most shows publish weekly. Checking every few hours is plenty, and keeps costs low:

Shows followedChecks per dayCredits per month (approx.)
54600 + new episodes
2021,200 + new episodes
10013,000 + new episodes
Mind the per-minute limit

On Free, 10 calls per minute means pausing between podcasts when you follow many. On Pro the limit is 600.

Cheaper alternative for many shows

Search with updated_within=30d and sort=recent shows which podcasts published recently, 24 at a time, refreshed daily for every show. Use it to decide which shows to refresh, instead of refreshing all of them.