API recipe

Get podcast listing links from a feed URL

For developers building podcast imports: get Apple Podcasts, Spotify and YouTube links from an RSS feed URL.

beginner 5 minutes Pod Engine Team
PodcastsRSSIntegration

Before you start

  • API token with access to podcast details
  • An RSS feed URL

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, PodEngineApiError } 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 rssFeedUrl = process.env.PODENGINE_RSS_FEED_URL || 'https://anchor.fm/s/7c624c84/podcast/rss';
Complete runnable script
Download script
import { PodEngine, PodEngineApiError } 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 rssFeedUrl = process.env.PODENGINE_RSS_FEED_URL || 'https://anchor.fm/s/7c624c84/podcast/rss';

// Optional: remove this block to go straight to the details call.
const { podcast } = await pe.podcasts.getPodcastIdLookup({ rssFeedUrl });
if (!podcast) {
  console.log('Pod Engine does not track this feed');
  process.exit(0);
}

let platforms;
try {
  // The SDK URL-encodes rssFeedUrl and unwraps the API's data envelope.
  ({ platforms } = await pe.podcasts.getPodcastByFeedUrl({ rssFeedUrl }));
} catch (error) {
  if (!(error instanceof PodEngineApiError) || error.status !== 404) throw error;
  console.log('Pod Engine does not track this feed');
  process.exit(0);
}

if (!platforms) throw new Error('No platform data returned; check the API version');
console.log('Apple Podcasts (certain):', platforms.apple.url);
if (platforms.spotify) {
  console.log('Spotify (inferred):', platforms.spotify.url);
} else {
  console.log('Spotify: no match yet; the show may still be on Spotify');
}
if (platforms.youtube) {
  const confidence = platforms.youtube.tier === 'associated' ? 'passed checks' : 'confirm with the publisher';
  console.log(`YouTube (${platforms.youtube.tier}; ${confidence}):`, platforms.youtube.url);
} else {
  console.log('YouTube: no channel match yet');
}
1

Check whether we track the feed (optional)

Start with the feed URL you already have. These examples use This Week in Startups: https://anchor.fm/s/7c624c84/podcast/rss. Set PODENGINE_RSS_FEED_URL to try another feed. Call GET /api/v1/podcasts/id/lookup with rssFeedUrl to check whether Pod Engine tracks it. This call is free: it does not use podcastLookups. A successful response can contain data.podcast: null; stop if it does.

// Optional: remove this block to go straight to the details call.
const { podcast } = await pe.podcasts.getPodcastIdLookup({ rssFeedUrl });
if (!podcast) {
  console.log('Pod Engine does not track this feed');
  process.exit(0);
}
4

Account for monthly usage

The details call uses one podcastLookups unit per podcast per month. Fetching the same podcast again that month does not use another unit. The optional ID lookup does not use a unit.