API recipe

Find Your Next Podcast Guest

Build a guest shortlist from recent appearances on podcasts your audience already enjoys.

beginner 10 minutes PodEngine Team
PodcastsGuestsHosting

Before you start

  • API token
  • The Pod Engine ID or slug of a similar podcast

Choose your example

Your selection applies to every step. HTTP uses built-in clients without the Pod Engine libraries.

Use Node.js 22 or newer. Save the complete script as recipe.mjs.

npm install @podengine/sdk
# macOS / Linux shell; set the same variable in your shell on Windows
export PODENGINE_API_KEY="YOUR_API_KEY"
node recipe.mjs

Set up the client

Start your file with this setup, then append each step in order. The complete script below includes everything.

import { PodEngine } from '@podengine/sdk';

const apiKey = process.env.PODENGINE_API_KEY;
if (!apiKey) throw new Error('Set PODENGINE_API_KEY before running this recipe');
const pe = new PodEngine({
  apiKey,
  baseUrl: process.env.PODENGINE_API_URL || 'https://api.podengine.ai',
});
Complete runnable script
Download script
import { PodEngine } from '@podengine/sdk';

const apiKey = process.env.PODENGINE_API_KEY;
if (!apiKey) throw new Error('Set PODENGINE_API_KEY before running this recipe');
const pe = new PodEngine({
  apiKey,
  baseUrl: process.env.PODENGINE_API_URL || 'https://api.podengine.ai',
});

const podcastIdOrSlug = 'this-week-in-startups';
const { podcast, guests: summary } = await pe.podcasts.getPodcastGuests({
  podcastIdOrSlug,
  sinceDays: 90,
  role: 'guest',
});
console.table([
  {
    podcast: podcast.title,
    analyzedEpisodes: summary.episodesCount,
    oldestAnalyzedEpisode: summary.oldestEpisodeDate,
    newestAnalyzedEpisode: summary.mostRecentEpisodeDate,
  },
]);

const shortlist = [...summary.guests]
  .sort((a, b) => new Date(b.mostRecentAppearanceDate).getTime() - new Date(a.mostRecentAppearanceDate).getTime())
  .slice(0, 10)
  .map((item) => ({
    name: item.name,
    appearances: item.appearancesCount,
    latestAppearance: item.mostRecentAppearanceDate,
    sourcePodcast: podcast.title,
  }));
if (summary.episodesCount === 0) {
  console.info('No analyzed episodes. Try a wider window or another show.');
} else if (!shortlist.length) {
  console.info('No guests returned from the analyzed episodes.');
} else {
  console.table(shortlist);
}
1

Find recent guests on a similar show

Choose a podcast with a similar audience and interview format. Its recent guests can give you ideas for people and topics to bring to your own show.

Choose your language and SDK or HTTP above. Run the setup first, then append each step to the same file. Replace the example podcast slug with your chosen show.

The Podcast Guests endpoint accepts sinceDays=90 to look back 90 days and role=guest to exclude hosts. In the HTTP response, the summary is at data.guests and the people at data.guests.guests.

const podcastIdOrSlug = 'this-week-in-startups';
const { podcast, guests: summary } = await pe.podcasts.getPodcastGuests({
  podcastIdOrSlug,
  sinceDays: 90,
  role: 'guest',
});
console.table([
  {
    podcast: podcast.title,
    analyzedEpisodes: summary.episodesCount,
    oldestAnalyzedEpisode: summary.oldestEpisodeDate,
    newestAnalyzedEpisode: summary.mostRecentEpisodeDate,
  },
]);
2

Build a shortlist of recent appearances

Append this code to the same file. It sorts guests by their latest appearance and keeps ten names to research. The appearance dates refer to episode publication dates.

Check the analyzed episode count and date range alongside the names. An empty result does not prove the show had no guests; there may be no usable analysis in your chosen window. When no analyzed episodes are included, the summary dates are null.

const shortlist = [...summary.guests]
  .sort((a, b) => new Date(b.mostRecentAppearanceDate).getTime() - new Date(a.mostRecentAppearanceDate).getTime())
  .slice(0, 10)
  .map((item) => ({
    name: item.name,
    appearances: item.appearancesCount,
    latestAppearance: item.mostRecentAppearanceDate,
    sourcePodcast: podcast.title,
  }));
if (summary.episodesCount === 0) {
  console.info('No analyzed episodes. Try a wider window or another show.');
} else if (!shortlist.length) {
  console.info('No guests returned from the analyzed episodes.');
} else {
  console.table(shortlist);
}
3

Turn the shortlist into interview ideas

For each candidate, listen to a recent interview and write down one question your audience would want answered that the other show did not cover. Prioritize guests whose experience fits your next few episodes, then use their public website or booking channel to prepare a personal invitation.

Repeat with a few similar shows to broaden the list. Check identities before combining matching names across podcasts.

For host collaborations or crossover episodes, change the request to role=host. Omit role to include guests, hosts, and mentioned people. The role filter changes the people returned; episodesWithGuestsCount still counts analyzed episodes containing guests.

The summary provides names, appearance counts, and dates. It does not provide guest contact details or booking availability.