Download the PHP package kirilkirkov/spotify-webapi-sdk without Composer

On this page you can find all versions of the php package kirilkirkov/spotify-webapi-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package spotify-webapi-sdk

PHP SDK For Spotify Web Api

Spotify PHP

requires php >= 7.2

Installation

composer require kirilkirkov/spotify-webapi-sdk

Example usage with code:

https://github.com/kirilkirkov/Spotify-WebApi-PHP-SDK/wiki/Example-Usage-with-Code

Doesnt have token?

Option 1 - Get access token with client credentials

Option 2 - Get access token with code authorization (recommended)

Before make requests you must add yours Redirect URIs to https://developer.spotify.com/dashboard

Get redirect url for code:

After signup in spotify you will be redirected back to provided above callback url (http://yoursite.com/callback) with parameter $_GET['code'] with the code that can get token with following command:

And you will receive array with accessToken and refreshToken in the example above $tokens.

Access/Refresh Tokens

Spotify tokens are valid 1 hour. If your token is expired and you make a call, the sdk auto renew access token with provided refresh token in every query (as there is no safe place to automatically save it).

If you set $spotifyWebApi->returnNewTokenIfIsExpired(true); before your request calls, if access token is expired will be returned from the query, object with the new access_token, then you can save it in database and recall request with a fresh Access token. You can also generate access token with refresh token manually with

and save final expire timestamp with time() + $result->expires_in. You can manualy generate new access token every time when saved in your database expired time is end.

Suggestions

It is good practise to add ip of the api that you call in the hosts file in yours server os because Guzzle sometime cannot resolve the dns.

Can increase your execution time of scripts ini_set('max_execution_time', XXX); and set_time_limit(XXX);

Functions

In the wiki of this repository you can find all functions available in this sdk (all the ones supported by Spotify have been integrated so far)

Donate

If this project help you reduce time to develop, you can give me a cup of coffee to continue its development. Thank you! :)

Donate


All versions of spotify-webapi-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
guzzlehttp/guzzle Version ~6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kirilkirkov/spotify-webapi-sdk contains the following files

Loading the files please wait ....