Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Spotify Web Api Php Laravel Package

jwilsson/spotify-web-api-php

View on GitHub
Deep Wiki
Context7

SpotifyWebAPI

Table of Contents

Constants

Methods

__construct

SpotifyWebAPI::__construct($options, $session, $request)

Constructor Set options and class instances to use.

Arguments

* `$options` **array\|object** - Optional. Options to set.
* `$session` **\SpotifyWebAPI\Session** - Optional. The Session object to use.
* `$request` **\SpotifyWebAPI\Request** - Optional. The Request object to use.

addMyAlbums

Deprecated. Use SpotifyWebAPI::addMyLibrary() instead.

SpotifyWebAPI::addMyAlbums($albums)

Add albums to the current user's Spotify library. https://developer.spotify.com/documentation/web-api/reference/save-albums-user

Arguments

* `$albums` **string\|array** - Album IDs or URIs to add.

Return values

  • bool Whether the albums was successfully added.

addMyAudiobooks

Deprecated. Use SpotifyWebAPI::addMyLibrary() instead.

SpotifyWebAPI::addMyAudiobooks($audiobooks)

Add audiobooks to the current user's Spotify library. https://developer.spotify.com/documentation/web-api/reference/save-audiobooks-user

Arguments

* `$audiobooks` **string\|array** - Audiobook IDs or URIs to add.

Return values

  • bool Whether the audiobooks was successfully added.

addMyEpisodes

Deprecated. Use SpotifyWebAPI::addMyLibrary() instead.

SpotifyWebAPI::addMyEpisodes($episodes)

Add episodes to the current user's Spotify library. https://developer.spotify.com/documentation/web-api/reference/save-episodes-user

Arguments

* `$episodes` **string\|array** - Episode IDs or URIs to add.

Return values

  • bool Whether the episodes was successfully added.

addMyLibrary

SpotifyWebAPI::addMyLibrary($uris)

Add items to the current user's Spotify library. https://developer.spotify.com/documentation/web-api/reference/save-library-items

Arguments

* `$uris` **string\|array** - Spotify URIs to add.

Return values

  • bool Whether the items was successfully added.

addMyShows

Deprecated. Use SpotifyWebAPI::addMyLibrary() instead.

SpotifyWebAPI::addMyShows($shows)

Add shows to the current user's Spotify library. https://developer.spotify.com/documentation/web-api/reference/save-shows-user

Arguments

* `$shows` **string\|array** - Show IDs or URIs to add.

Return values

  • bool Whether the shows was successfully added.

addMyTracks

Deprecated. Use SpotifyWebAPI::addMyLibrary() instead.

SpotifyWebAPI::addMyTracks($tracks)

Add tracks to the current user's Spotify library. https://developer.spotify.com/documentation/web-api/reference/save-tracks-user

Arguments

* `$tracks` **array\|object** - Track IDs or URIs to add. One of "ids" or "timestamped_ids" key must be present.
  • array ids Optional. An array of track IDs or URIs.
  • array timestamped_ids Optional. An array of objects containing track IDs or URIs and added_at timestamp.

Return values

  • bool Whether the tracks was successfully added.

addPlaylistItems

SpotifyWebAPI::addPlaylistItems($playlistId, $items, $options)

Add items to a playlist. https://developer.spotify.com/documentation/web-api/reference/add-items-to-playlist

Arguments

* `$playlistId` **string** - ID of the playlist to add items to.
* `$items` **string\|array** - Track and episode URIs to add.
* `$options` **array\|object** - Optional. Options for the new items.
  • int position Optional. Zero-based track position in playlist. Items will be appended if omitted or false.

Return values

  • string|bool A new snapshot ID or false if the items weren't successfully added.

addPlaylistTracks

Deprecated. Use SpotifyWebAPI::addPlaylistItems() instead.

SpotifyWebAPI::addPlaylistTracks($playlistId, $tracks, $options)

Add tracks to a playlist. https://developer.spotify.com/documentation/web-api/reference/add-tracks-to-playlist

Arguments

* `$playlistId` **string** - ID of the playlist to add tracks to.
* `$tracks` **string\|array** - Track IDs, track URIs, and episode URIs to add.
* `$options` **array\|object** - Optional. Options for the new tracks.
  • int position Optional. Zero-based track position in playlist. Tracks will be appended if omitted or false.

Return values

  • string|bool A new snapshot ID or false if the tracks weren't successfully added.

changeMyDevice

SpotifyWebAPI::changeMyDevice($options)

Change the current user's playback device. https://developer.spotify.com/documentation/web-api/reference/transfer-a-users-playback

Arguments

* `$options` **array\|object** - Options for the playback transfer.
  • string|array device_ids Required. ID of the device to switch to.
  • bool play Optional. Whether to start playing on the new device

Return values

  • bool Whether the playback device was successfully changed.

changeVolume

SpotifyWebAPI::changeVolume($options)

Change playback volume for the current user. https://developer.spotify.com/documentation/web-api/reference/set-volume-for-users-playback

Arguments

* `$options` **array\|object** - Optional. Options for the playback volume.
  • int volume_percent Required. The volume to set.
  • string device_id Optional. ID of the device to target.

Return values

  • bool Whether the playback volume was successfully changed.

createPlaylist

SpotifyWebAPI::createPlaylist($userId, $options)

Create a new playlist for the current user. https://developer.spotify.com/documentation/web-api/reference/create-playlist

Arguments

* `$userId` **string** - Deprecated. The current user will always be used.
* `$options` **array\|object** - Options for the new playlist.
  • string name Required. Name of the playlist.
  • bool collaborative Optional. Whether the playlist should be collaborative or not.
  • string description Optional. Description of the playlist.
  • bool public Optional. Whether the playlist should be public or not.

Return values

  • array|object The new playlist. Type is controlled by the return_assoc option.

currentUserFollows

Deprecated. Use SpotifyWebAPI::myLibraryContains() instead.

SpotifyWebAPI::currentUserFollows($type, $ids)

Check to see if the current user is following one or more artists or other Spotify users. https://developer.spotify.com/documentation/web-api/reference/check-current-user-follows

Arguments

* `$type` **string** - The type to check: either 'artist' or 'user'.
* `$ids` **string\|array** - IDs or URIs of the users or artists to check for.

Return values

  • array Whether each user or artist is followed.

currentUserFollowsPlaylist

Deprecated. Use SpotifyWebAPI::myLibraryContains() instead.

SpotifyWebAPI::currentUserFollowsPlaylist($playlistId)

Check if the current user is following a playlist. https://developer.spotify.com/documentation/web-api/reference/check-if-user-follows-playlist

Arguments

* `$playlistId` **string** - ID or URI of the playlist to check.

Return values

  • array Array containing one boolean describing whether the playlist is followed.

deleteMyAlbums

Deprecated. Use SpotifyWebAPI::deleteMyLibrary() instead.

SpotifyWebAPI::deleteMyAlbums($albums)

Delete albums from the current user's Spotify library. https://developer.spotify.com/documentation/web-api/reference/remove-albums-user

Arguments

* `$albums` **string\|array** - Album IDs or URIs to delete.

Return values

  • bool Whether the albums was successfully deleted.

deleteMyAudiobooks

Deprecated. Use SpotifyWebAPI::deleteMyLibrary() instead.

SpotifyWebAPI::deleteMyAudiobooks($audiobooks)

Delete audiobooks from the current user's Spotify library. https://developer.spotify.com/documentation/web-api/reference/remove-audiobooks-user

Arguments

* `$audiobooks` **string\|array** - Audiobook IDs or URIs to delete.

Return values

  • bool Whether the audiobooks was successfully deleted.

deleteMyEpisodes

Deprecated. Use SpotifyWebAPI::deleteMyLibrary() instead.

SpotifyWebAPI::deleteMyEpisodes($episodes)

Delete episodes from the current user's Spotify library. https://developer.spotify.com/documentation/web-api/reference/remove-episodes-user

Arguments

* `$episodes` **string\|array** - Episode IDs or URIs to delete.

Return values

  • bool Whether the episodes was successfully deleted.

deleteMyLibrary

SpotifyWebAPI::deleteMyLibrary($uris)

Delete items from the current user's Spotify library. https://developer.spotify.com/documentation/web-api/reference/remove-library-items

Arguments

* `$uris` **string|array**

Return values

  • bool Whether the items were successfully deleted.

deleteMyShows

Deprecated. Use SpotifyWebAPI::deleteMyLibrary() instead.

SpotifyWebAPI::deleteMyShows($shows)

Delete shows from the current user's Spotify library. https://developer.spotify.com/documentation/web-api/reference/remove-shows-user

Arguments

* `$shows` **string\|array** - Show IDs or URIs to delete.

Return values

  • bool Whether the shows was successfully deleted.

deleteMyTracks

Deprecated. Use SpotifyWebAPI::deleteMyLibrary() instead.

SpotifyWebAPI::deleteMyTracks($tracks)

Delete tracks from the current user's Spotify library. https://developer.spotify.com/documentation/web-api/reference/remove-tracks-user

Arguments

* `$tracks` **string\|array** - Track IDs or URIs to delete.

Return values

  • bool Whether the tracks was successfully deleted.

deletePlaylistItems

SpotifyWebAPI::deletePlaylistItems($playlistId, $items, $snapshotId)

Delete items from a playlist and retrieve a new snapshot ID. https://developer.spotify.com/documentation/web-api/reference/remove-items-playlist

Arguments

* `$playlistId` **string** - ID or URI of the playlist to delete tracks from.
* `$items` **array** - An array of objects containing track or episode URIs.
* `$snapshotId` **string** - Optional. The playlist's snapshot ID.

Return values

  • string|bool A new snapshot ID or false if the items weren't successfully deleted.

deletePlaylistTracks

Deprecated. Use SpotifyWebAPI::deletePlaylistItems() instead.

SpotifyWebAPI::deletePlaylistTracks($playlistId, $tracks, $snapshotId)

Delete tracks from a playlist and retrieve a new snapshot ID. https://developer.spotify.com/documentation/web-api/reference/remove-tracks-playlist

Arguments

* `$playlistId` **string** - ID or URI of the playlist to delete tracks from.
* `$tracks` **array** - An array with the key "tracks" containing arrays or objects with tracks to delete.

Or an array with the key "positions" containing integer positions of the tracks to delete. If the "tracks" key is used, the following fields are also available:

  • string uri Required. Track ID, track URI, or episode URI.
  • int|array positions Optional. The track's positions in the playlist.
    • $snapshotId string - Required when $tracks['positions'] is used, optional otherwise. The playlist's snapshot ID.

Return values

  • string|bool A new snapshot ID or false if the tracks weren't successfully deleted.

followArtistsOrUsers

Deprecated. Use SpotifyWebAPI::addMyLibrary() instead.

SpotifyWebAPI::followArtistsOrUsers($type, $ids)

Add the current user as a follower of one or more artists or other Spotify users. https://developer.spotify.com/documentation/web-api/reference/follow-artists-users

Arguments

* `$type` **string** - The type of ID to follow: either 'artist' or 'user'.
* `$ids` **string\|array** - IDs or URIs of the users or artists to follow.

Return values

  • bool Whether the artist or user was successfully followed.

followPlaylist

Deprecated. Use SpotifyWebAPI::addMyLibrary() instead.

SpotifyWebAPI::followPlaylist($playlistId, $options)

Add the current user as a follower of a playlist. https://developer.spotify.com/documentation/web-api/reference/follow-playlist

Arguments

* `$playlistId` **string** - ID or URI of the playlist to follow.
* `$options` **array\|object** - Unused. Use SpotifyWebAPI::updatePlaylist() instead.

Return values

  • bool Whether the playlist was successfully followed.

getAlbum

SpotifyWebAPI::getAlbum($albumId, $options)

Get an album. https://developer.spotify.com/documentation/web-api/reference/get-an-album

Arguments

* `$albumId` **string** - ID or URI of the album.
* `$options` **array\|object** - Optional. Options for the album.
  • string market Optional. ISO 3166-1 alpha-2 country code, provide this if you wish to apply Track Relinking.

Return values

  • array|object The requested album. Type is controlled by the return_assoc option.

getAlbums

Deprecated. See https://developer.spotify.com/blog/2026-02-06-update-on-developer-access-and-platform-security

SpotifyWebAPI::getAlbums($albumIds, $options)

Get multiple albums. https://developer.spotify.com/documentation/web-api/reference/get-multiple-albums

Arguments

* `$albumIds` **array** - IDs or URIs of the albums.
* `$options` **array\|object** - Optional. Options for the albums.
  • string market Optional. ISO 3166-1 alpha-2 country code, provide this if you wish to apply Track Relinking.

Return values

  • array|object The requested albums. Type is controlled by the return_assoc option.

getAlbumTracks

SpotifyWebAPI::getAlbumTracks($albumId, $options)

Get an album's tracks. https://developer.spotify.com/documentation/web-api/reference/get-an-albums-tracks

Arguments

* `$albumId` **string** - ID or URI of the album.
* `$options` **array\|object** - Optional. Options for the tracks.
  • int limit Optional. Limit the number of tracks.
  • int offset Optional. Number of tracks to skip.
  • string market Optional. ISO 3166-1 alpha-2 country code, provide this if you wish to apply Track Relinking.

Return values

  • array|object The requested album tracks. Type is controlled by the return_assoc option.

getArtist

SpotifyWebAPI::getArtist($artistId)

Get an artist. https://developer.spotify.com/documentation/web-api/reference/get-an-artist

Arguments

* `$artistId` **string** - ID or URI of the artist.

Return values

  • array|object The requested artist. Type is controlled by the return_assoc option.

getArtists

Deprecated. See https://developer.spotify.com/blog/2026-02-06-update-on-developer-access-and-platform-security

SpotifyWebAPI::getArtists($artistIds)

Get multiple artists. https://developer.spotify.com/documentation/web-api/reference/get-multiple-artists

Arguments

* `$artistIds` **array** - IDs or URIs of the artists.

Return values

  • array|object The requested artists. Type is controlled by the return_assoc option.

getArtistRelatedArtists

Deprecated. See https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api

SpotifyWebAPI::getArtistRelatedArtists($artistId)

Get an artist's related artists. https://developer.spotify.com/documentation/web-api/reference/get-an-artists-related-artists

Arguments

* `$artistId` **string** - ID or URI of the artist.

Return values

  • array|object The artist's related artists. Type is controlled by the return_assoc option.

getArtistAlbums

SpotifyWebAPI::getArtistAlbums($artistId, $options)

Get an artist's albums. https://developer.spotify.com/documentation/web-api/reference/get-an-artists-albums

Arguments

* `$artistId` **string** - ID or URI of the artist.
* `$options` **array\|object** - Optional. Options for the albums.
  • string market Optional. Limit the results to items that are playable in this country, for example SE.
  • string|array include_groups Optional. Album types to return. If omitted, all album types will be returned.
  • int limit Optional. Limit the number of albums.
  • int offset Optional. Number of albums to skip.

Return values

  • array|object The artist's albums. Type is controlled by the return_assoc option.

getArtistTopTracks

Deprecated. See https://developer.spotify.com/blog/2026-02-06-update-on-developer-access-and-platform-security

SpotifyWebAPI::getArtistTopTracks($artistId, $options)

Get an artist's top tracks in a country. https://developer.spotify.com/documentation/web-api/reference/get-an-artists-top-tracks

Arguments

* `$artistId` **string** - ID or URI of the artist.
* `$options` **array\|object** - Options for the tracks.
  • string market Required. An ISO 3166-1 alpha-2 country code specifying the country to get the top tracks for.

Return values

  • array|object The artist's top tracks. Type is controlled by the return_assoc option.

getAudioAnalysis

Deprecated. See https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api

SpotifyWebAPI::getAudioAnalysis($trackId)

Get audio analysis for track. https://developer.spotify.com/documentation/web-api/reference/get-audio-analysis

Arguments

* `$trackId` **string** - ID or URI of the track.

Return values

  • array|object The track's audio analysis. Type is controlled by the return_assoc option.

getAudiobook

SpotifyWebAPI::getAudiobook($audiobookId, $options)

Get an audiobook. https://developer.spotify.com/documentation/web-api/reference/get-an-audiobook

Arguments

* `$audiobookId` **string** - ID or URI of the audiobook.
* `$options` **array\|object** - Optional. Options for the audiobook.
  • string market Optional. ISO 3166-1...
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views