Skip to content

Service Search

Kiril Kirkov edited this page Feb 23, 2022 · 3 revisions

Make Instance

$spotifyWebApi = new SpotifyWebApi([
        'clientId' => 'SPOTIFY_CLIENT_ID',
        'clientSecret' => 'SPOTIFY_CLIENT_SECRET',
        'accessToken' => 'ACCESS_TOKEN',
        'refreshToken' => 'SPOTIFY_API_REFRESH_TOKEN',
]);

Do requests

Search for an Item

equal to - https://developer.spotify.com/documentation/web-api/reference/search/search/

A comma-separated list of item types to search across. Valid types are: album , artist, playlist, and track. note that should not have space between commas!

$type = 'album,artist,playlist,track';
$response = $spotifyWebApi->api()->provider(
        \SpotifyWebAPI\SpotifyServices::search()::search('Query String', $type)
)->getResult();