The Spotify API on Pipedream offers a creative playground for music lovers and developers alike. With it, you can manage playlists, search for music, get recently played tracks, and manipulate playback among other features. It's a gateway to a rich dataset of music and user information, enabling the creation of personalized and dynamic music experiences.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
spotify: {
type: "app",
app: "spotify",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.spotify.com/v1/me`,
headers: {
Authorization: `Bearer ${this.spotify.$auth.oauth_access_token}`,
},
})
},
})
Automated Playlist Creation: Generate playlists automatically based on user-defined criteria such as mood, genre, or recent activity. For instance, create a "Workout Hits" playlist that updates weekly with high-energy tracks popular in your region.
Music Discovery and Sharing: Set up a workflow that curates new music based on your listening habits, then shares these discoveries to your social media accounts or with friends via email or messaging platforms like Slack.
Listening Analytics: Build a custom dashboard that collects your streaming data such as favorite artists, tracks, and genres over time. Integrate this with data visualization tools to gain insights into your listening habits.
Emit new event when a new playlist is created or followed by the current Spotify user.
Emit new event for each new track saved to the current Spotify user's Music Library.
Emit new event for each new Spotify track related with an artist. see docs here
Emit new event for each new Spotify track added to a playlist
Add one or more items to a user’s playlist. See the docs here.
Create a playlist for a Spotify user. The playlist will be empty until you add tracks. See the docs here.
Get a list of Spotify playlists tagged with a particular category. See the docs here.
Get full details of the items of a playlist owned by a Spotify user. See the docs here.
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-collaborative
playlist-modify-private
playlist-modify-public
playlist-read-private
user-modify-playback-state
user-read-currently-playing
user-read-playback-state
user-read-private
user-read-email
user-library-modify
user-library-read
user-follow-modify
user-follow-read
user-read-recently-played
user-top-read
streaming
app-remote-control
ugc-image-upload
user-read-playback-position
GET
https://accounts.spotify.com/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://accounts.spotify.com/api/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://accounts.spotify.com/api/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}