Spotify API Endpoints
Complete reference for all Spotify API endpoints
The Spotify plugin provides access to Spotify's Web API for music playback, library management, and search.
New to Corsair? Learn about core concepts like API access, authentication, and error handling.
Full Implementation: For the complete, up-to-date list, see the Spotify plugin source code.
Albums
get
albums.get
Get info about an album.
const album = await corsair.spotify.api.albums.get({
id: "album-id",
});Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Spotify album ID |
getNewReleases
albums.getNewReleases
Get newly released albums.
const releases = await corsair.spotify.api.albums.getNewReleases({
limit: 20,
offset: 0,
});Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
limit | number | No | Max results (default: 20) |
offset | number | No | Pagination offset |
getTracks
albums.getTracks
Get tracks from an album.
const tracks = await corsair.spotify.api.albums.getTracks({
id: "album-id",
limit: 50,
});Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Album ID |
limit | number | No | Max tracks to return |
offset | number | No | Pagination offset |
search
albums.search
Search for albums.
const results = await corsair.spotify.api.albums.search({
q: "Dark Side of the Moon",
limit: 10,
});Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
q | string | Yes | Search query |
limit | number | No | Max results |
offset | number | No | Pagination offset |
Artists
get
artists.get
Get info about an artist.
const artist = await corsair.spotify.api.artists.get({
id: "artist-id",
});getTopTracks
artists.getTopTracks
Get top tracks for an artist.
const tracks = await corsair.spotify.api.artists.getTopTracks({
id: "artist-id",
market: "US",
});Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Artist ID |
market | string | No | Market code (e.g., US) |
search
artists.search
Search for artists.
const artists = await corsair.spotify.api.artists.search({
q: "Queen",
limit: 5,
});Library
getLikedTracks
library.getLikedTracks
Get the current user's liked (saved) tracks.
const liked = await corsair.spotify.api.library.getLikedTracks({
limit: 50,
offset: 0,
});Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
limit | number | No | Max tracks to return (default: 20, max: 50) |
offset | number | No | Pagination offset |
Player
getCurrentlyPlaying
player.getCurrentlyPlaying
Get the currently playing track.
const current = await corsair.spotify.api.player.getCurrentlyPlaying({}); Parameters: None
startPlayback
player.startPlayback
Start or resume playback.
await corsair.spotify.api.player.startPlayback({
context_uri: "spotify:album:album-id",
device_id: "device-id",
});Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
context_uri | string | No | Spotify URI to play (album, playlist, artist) |
uris | string[] | No | Track URIs to play |
device_id | string | No | Device ID to play on |
pause
player.pause
Pause playback.
await corsair.spotify.api.player.pause({});resume
player.resume
Resume playback.
await corsair.spotify.api.player.resume({});skipToNext
player.skipToNext
Skip to the next track.
await corsair.spotify.api.player.skipToNext({});setVolume
player.setVolume
Set the playback volume.
await corsair.spotify.api.player.setVolume({
volume_percent: 75,
});Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
volume_percent | number | Yes | Volume (0-100) |
addToQueue
player.addToQueue
Add a track to the playback queue.
await corsair.spotify.api.player.addToQueue({
uri: "spotify:track:track-id",
});Playlists
create
playlists.create
Create a new playlist.
const playlist = await corsair.spotify.api.playlists.create({
name: "My Playlist",
description: "Created via Corsair",
public: false,
});Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Playlist name |
description | string | No | Playlist description |
public | boolean | No | Whether the playlist is public |
addItem
playlists.addItem
Add a track to a playlist.
await corsair.spotify.api.playlists.addItem({
playlist_id: "playlist-id",
uris: ["spotify:track:track-id"],
});getTracks
playlists.getTracks
Get tracks in a playlist.
const tracks = await corsair.spotify.api.playlists.getTracks({
playlist_id: "playlist-id",
limit: 100,
});Tracks
search
tracks.search
Search for tracks.
const tracks = await corsair.spotify.api.tracks.search({
q: "Bohemian Rhapsody Queen",
limit: 10,
});getAudioFeatures
tracks.getAudioFeatures
Get audio features for a track (tempo, key, danceability, etc.).
const features = await corsair.spotify.api.tracks.getAudioFeatures({
id: "track-id",
});