Skip to main content
Community Plugin
View plugin on GitHub
See starters using this

gatsby-source-podcast-rss-feed

This source plugin for Gatsby will load episode metadata from a podcast rss feed and make it available in GraphQL queries.

Installation

npm install --save gatsby-source-podcast-rss-feed

or

yarn add gatsby-source-podcast-rss-feed

Usage

// In your `gatsby-config.js`
module.exports = {
  plugins: [
    {
        resolve: `gatsby-source-podcast-rss-feed`,
        options: {
          feedURL: `https://some.url/yourpodcastfeed.rss`,
          id: 'guid',
        },
    },
  ],
}

Options

feedURL

Set feedURL to a live podcast rss feed.

id

Optional.

Determines which field in the given feedURL, within the podcast episode entries, to use as a unique id / key for each episode.

Defaults to using link if you don’t include it here in the options.

Querying

Once the plugin is configured, two new queries are available in GraphQL: allpodcastRssFeedEpisode and podcastRssFeedEpisode.

Here’s an example query to load the three (3) most recent episodes from your podcast rss feed:

query PodcastQuery {
  allPodcastRssFeedEpisode(limit: 3) {
    nodes {
      item {
        title
        link
        itunes {
          duration
        }
      }
    }
  }
}

See Apple Podcasts Connect Help or Google Feed Requirements for info about podcast rss feed specification.