audeio / spotify-web-api
PHP library for the Spotify Web API
Installs: 1 092
Dependents: 0
Suggesters: 0
Security: 0
Stars: 67
Watchers: 8
Forks: 16
Open Issues: 3
Requires
- php: >=5.4
- doctrine/collections: 1.*
- guzzle/guzzle: 3.*
- league/oauth2-client: ~0.6
- zendframework/zend-eventmanager: 2.*
- zendframework/zend-filter: 2.*
- zendframework/zend-servicemanager: 2.*
- zendframework/zend-stdlib: 2.*
Requires (Dev)
- phpunit/phpunit: 4.*
- vlucas/phpdotenv: 1.*
This package is auto-updated.
Last update: 2024-11-07 16:06:38 UTC
README
Requirements
- PHP 5.4+
- An OAuth 2 client (league/oauth2-client works well)
Installation
- Add
"audeio/spotify-web-api": "0.*"
to yourcomposer.json
- Run
composer update
to update your application with the new dependency - That's all!
Usage
-
Instantiate a new instance of
Audeio\Spotify\API
and set the access token retrieved by your OAuth 2 client (a provider forleague/oauth2-client
is included underAudeio\Spotify\ Oauth2\Client\Provider\Spotify
):$api = new \Audeio\Spotify\API(); $api->setAccessToken('BAWSDOJWEO984yt34y35YgdsnhlreGERH56u45htrH54y');
-
Call all the methods you need!
$api->getAlbum('id'); $api->getAlbums(array('id-1', 'id-2', 'id-3')); $api->getAlbumTracks('id'); $api->getArtist('id'); $api->getArtists(array('id-1', 'id-2', 'id-3')); $api->getArtistAlbums('id', 'country'); $api->getArtistRelatedArtists('id'); $api->getTrack('id'); $api->getTracks(array('id-1', 'id-2', 'id-3')); $api->getUserProfile('id'); $api->getCurrentUser(); $api->getUserPlaylist('userId', 'id'); $api->getUserPlaylistTracks('userId', 'id'); $api->getUserPlaylists('id');
License
The MIT License; please see LICENSE for more information.