Spotify
API actions for the Spotify integration.
Spotify
Search tracks, build and edit playlists, and see what's playing on Spotify.
Add tracks to playlist
Add one or more tracks to a Spotify playlist.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
playlist_id | string | Yes | The playlist to add tracks to. Paste a Spotify playlist link, a spotify:playlist: URI, or the playlist's ID. |
track_uris | array | Yes | The tracks to add (up to 100). Each can be a Spotify track link, a spotify:track: URI, or a track ID. |
position | number | No | Where to place the tracks, counting from 0. Leave empty to add them at the end. |
Response
{
"snapshot_id": "abc123xyz789"
}Create playlist
Create a new playlist in your connected Spotify account. You can add a description and choose whether it's public.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The name of the new playlist. |
description | string | No | An optional description shown on the playlist in Spotify. |
public | boolean | No | Set to true to make the playlist public, or false to keep it private. |
Response
{
"playlist": {
"id": "abc123xyz789",
"name": "Sample Item",
"uri": "spotify:playlist:abc123xyz"
}
}Get current playback
Get details about what's currently playing on Spotify.
Response
{
"device": "Web Player",
"is_playing": true,
"progress_ms": 1,
"track": {
"artists": [
"mock_value"
],
"id": "abc123xyz789",
"name": "Sample Item",
"uri": "spotify:track:abc123xyz"
}
}Get track details
Look up the details of a Spotify track by its ID.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
track_id | string | Yes | The track to look up. Paste a Spotify track link, a spotify:track: URI, or the track's ID. |
Response
{
"track": {
"album": "Greatest Hits",
"artists": [
"mock_value"
],
"duration_ms": 1,
"id": "abc123xyz789",
"name": "Sample Item",
"preview_url": "https://example.com/path/123",
"uri": "spotify:track:abc123xyz"
}
}Remove tracks from playlist
Remove one or more tracks from a Spotify playlist.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
playlist_id | string | Yes | The playlist to remove tracks from. Paste a Spotify playlist link, a spotify:playlist: URI, or the playlist's ID. |
track_uris | array | Yes | The tracks to remove (up to 100). Each can be a Spotify track link, a spotify:track: URI, or a track ID. |
Response
{
"snapshot_id": "abc123xyz789"
}Search Spotify tracks
Search for tracks on Spotify by keyword and return the top matches.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | What to search for: a song, artist, or album. |
limit | number | No | How many tracks to return (1-50). Defaults to 5. |
Response
{
"tracks": [
{
"album": "Greatest Hits",
"artists": [
"mock_value"
],
"id": "abc123xyz789",
"name": "Sample Item",
"uri": "spotify:track:abc123xyz"
}
]
}