Lodol Docs

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

ParameterTypeRequiredDescription
playlist_idstringYesThe playlist to add tracks to. Paste a Spotify playlist link, a spotify:playlist: URI, or the playlist's ID.
track_urisarrayYesThe tracks to add (up to 100). Each can be a Spotify track link, a spotify:track: URI, or a track ID.
positionnumberNoWhere 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

ParameterTypeRequiredDescription
namestringYesThe name of the new playlist.
descriptionstringNoAn optional description shown on the playlist in Spotify.
publicbooleanNoSet 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

ParameterTypeRequiredDescription
track_idstringYesThe 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

ParameterTypeRequiredDescription
playlist_idstringYesThe playlist to remove tracks from. Paste a Spotify playlist link, a spotify:playlist: URI, or the playlist's ID.
track_urisarrayYesThe 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

ParameterTypeRequiredDescription
querystringYesWhat to search for: a song, artist, or album.
limitnumberNoHow 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"
    }
  ]
}

On this page