Skip to content

Service Search

Kiril Kirkov edited this page Apr 30, 2020 · 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.

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