Download the PHP package ngiraud/spotify-sdk-php without Composer

On this page you can find all versions of the php package ngiraud/spotify-sdk-php. 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-sdk-php

SDK for using Spotify in PHP

Latest Version on Packagist Tests Total Downloads

This package contains the PHP SDK to work with the Spotify Web API.

Table of Contents

Get Started

Requires PHP 8.1+

First, install the client via the Composer package manager:

You must also install Guzzle if your project does not already have a it integrated:

In order to use the SDK, you need to request an access_token. You can get an example from the Spotify Web API docs.

If you use Laravel, you can use Socialite and the adapter provided by the community on their website.

Below is an example on how to authenticate with Laravel Socialite.

You can now interact with Spotify's API:

You can also use the Client Credentials flow to authenticate:

Please keep in mind that only endpoints that do not access user information can be accessed using this particular authentication flow.

Usage

Handling Pagination

On some resources, some methods such as findMultiple will return an instance of Spotify\Support\PaginatedResults. This instance returns a list of records, and can handle other things like fetch the next or previous page of results.

Available methods

Albums Resource

You can access the Albums resource via the albums method from the client.

Available methods:

Example

Artists Resource

You can access the Artists resource via the artists method from the client.

Available methods:

Example

Audiobooks Resource

Note: Audiobooks are only available for the US, UK, Ireland, New Zealand and Australia markets.

You can access the Audiobooks resource via the audiobooks method from the client.

Available methods:

Example

Categories Resource

You can access the Categories resource via the categories method from the client.

Available methods:

Example

Chapters Resource

You can access the Chapters resource via the chapters method from the client.

Available methods:

Example

Episodes Resource

You can access the Episodes resource via the episodes method from the client.

Available methods:

Example

Genres Resource

You can access the Genres resource via the genres method from the client.

Available methods:

Example

Markets Resource

You can access the Markets resource via the markets method from the client.

Available methods:

Example

Player Resource

You can access the Player resource via the player method from the client.

Available methods:

Example

Playlists Resource

You can access the Playlists resource via the playlists method from the client.

Available methods:

Example

Search Resource

You can access the Search resource via the search method from the client. The search method will return an instance of Spotify\SingleObjects\Search, and every type of results is accessible via its own method. This end method will return an instance of Spotify\Support\PaginatedResults.

Available methods after the search

Example

Shows Resource

You can access the Shows resource via the shows method from the client.

Available methods:

Example

Tracks Resource

You can access the Tracks resource via the tracks method from the client.

Available methods:

Example

Users Resource

You can access the Users resource via the users method from the client.

Available methods:

Example

Testing

Linting

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

This package is inspired by the OpenAI PHP client package made by Nuno Maduro and Sandro Gehri and the Mailcoach API SDK from Spatie.

License

The MIT License (MIT). Please see License File for more information.


All versions of spotify-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
guzzlehttp/guzzle Version ^7.7
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 ngiraud/spotify-sdk-php contains the following files

Loading the files please wait ....