← RSS + Spotify integrations

Get a Playlist's Items with Spotify APIon New Item in Feed from RSS API

Pipedream makes it easy to connect APIs for Spotify, RSS and 800+ other apps remarkably fast.

Trigger workflow on
New Item in Feed from the RSS API
Next, do this
Get a Playlist's Items with the Spotify API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

This integration creates a workflow with a RSS trigger and Spotify action. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Select this integration
  2. Configure the New Item in Feed trigger
    1. Connect your RSS account
    2. Configure timer
    3. Configure Feed URL
  3. Configure the Get a Playlist's Items action
    1. Connect your Spotify account
    2. Select a Playlist ID
    3. Optional- Configure Fields
    4. Optional- Configure Limit
    5. Optional- Configure Offset
    6. Optional- Select one or more Additional Types
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger

Details

This integration uses pre-built, open source components from Pipedream's GitHub repo. These components are developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Trigger

Description:Emit new items from an RSS feed
Version:1.0.3
Key:rss-new-item-in-feed

Trigger Code

import rss from "../../app/rss.app.mjs";
import { defineSource } from "@pipedream/types";
import rssCommon from "../common/common.mjs";
export default defineSource({
    ...rssCommon,
    key: "rss-new-item-in-feed",
    name: "New Item in Feed",
    description: "Emit new items from an RSS feed",
    version: "1.0.3",
    type: "source",
    dedupe: "unique",
    props: {
        ...rssCommon.props,
        url: {
            propDefinition: [
                rss,
                "url",
            ],
        },
    },
    hooks: {
        async activate() {
            // Try to parse the feed one time to confirm we can fetch and parse.
            // The code will throw any errors to the user.
            await this.rss.fetchAndParseFeed(this.url);
        },
    },
    async run() {
        const items = await this.rss.fetchAndParseFeed(this.url);
        this.rss.sortItems(items).forEach((item) => {
            const meta = this.generateMeta(item);
            this.$emit(item, meta);
        });
    },
});

Trigger Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
RSSrssappThis component uses the RSS app.
timer$.interface.timer

How often you want to poll the feed for new items

Feed URLurlstring

Enter the URL for any public RSS feed

Trigger Authentication

The RSS API does not require authentication.

About RSS

Real Simple Syndication

Action

Description:Get full details of the items of a playlist owned by a Spotify user. [See the docs here](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-playlists-tracks).
Version:0.0.3
Key:spotify-get-playlist-items

Action Code

import { axios } from "@pipedream/platform";
import get from "lodash/get.js";
import spotify from "../../spotify.app.mjs";

export default {
  name: "Get a Playlist's Items",
  description: "Get full details of the items of a playlist owned by a Spotify user. [See the docs here](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-playlists-tracks).",
  key: "spotify-get-playlist-items",
  version: "0.0.3",
  type: "action",
  props: {
    spotify,
    playlistId: {
      propDefinition: [
        spotify,
        "playlistId",
      ],
    },
    fields: {
      type: "string",
      label: "Fields",
      description: "Filters for the query: a comma-separated list of the fields to return. If omitted, all fields are returned. For example, to get just the total number of items and the request limit: `total,limit`. [See the docs](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-playlists-tracks) for more information.",
      optional: true,
    },
    limit: {
      propDefinition: [
        spotify,
        "limit",
      ],
    },
    offset: {
      propDefinition: [
        spotify,
        "offset",
      ],
    },
    additionalTypes: {
      type: "string[]",
      label: "Additional Types",
      description: "A comma-separated list of item types that your client supports besides the default `track` type. Valid types are: `track` and `episode`. **Note**: This parameter was introduced to allow existing clients to maintain their current behaviour and might be deprecated in the future. In addition to providing this parameter, make sure that your client properly handles cases of new types in the future by checking against the `type` field of each object.",
      optional: true,
      options: [
        "Track",
        "Episode",
      ],
    },
  },
  async run({ $ }) {
    const {
      playlistId,
      market,
      fields,
      limit,
      offset,
      additionalTypes,
    } = this;

    const res = await axios($, this.spotify._getAxiosParams({
      method: "GET",
      path: `/playlists/${get(playlistId, "value", playlistId)}/tracks`,
      params: {
        fields,
        market,
        limit,
        offset,
        additional_types: additionalTypes && additionalTypes.join(",").toLowerCase(),
      },
    }));

    $.export("$summary", `Successfully fetched details for "${get(playlistId, "label", playlistId)}"`);

    return get(res, "items", []);
  },
};

Action Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI.

LabelPropTypeDescription
SpotifyspotifyappThis component uses the Spotify app.
Playlist IDplaylistIdstringSelect a value from the drop down menu.
Fieldsfieldsstring

Filters for the query: a comma-separated list of the fields to return. If omitted, all fields are returned. For example, to get just the total number of items and the request limit: total,limit. See the docs for more information.

Limitlimitinteger

The maximum number of items to return. The default is 100.

Offsetoffsetinteger

The index of the first item to return. Default: 0 (the first object). Use with limit to get the next set of items.

Additional TypesadditionalTypesstring[]Select a value from the drop down menu:TrackEpisode

Action Authentication

Spotify uses OAuth authentication. When you connect your Spotify account, Pipedream will open a popup window where you can sign into Spotify and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Spotify API.

Pipedream requests the following authorization scopes when you connect your account:

playlist-read-collaborativeplaylist-modify-privateplaylist-modify-publicplaylist-read-privateuser-modify-playback-stateuser-read-currently-playinguser-read-playback-stateuser-read-privateuser-read-emailuser-library-modifyuser-library-readuser-follow-modifyuser-follow-readuser-read-recently-playeduser-top-readstreamingapp-remote-controlugc-image-uploaduser-read-playback-position

About Spotify

Music streaming

More Ways to Connect Spotify + RSS