PHPackages                             jwilsson/spotify-web-api-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. jwilsson/spotify-web-api-php

ActiveLibrary[API Development](/categories/api)

jwilsson/spotify-web-api-php
============================

A PHP wrapper for Spotify's Web API.

7.1.0(2mo ago)8841.3M↓13.7%151[2 issues](https://github.com/jwilsson/spotify-web-api-php/issues)8MITPHPPHP ^8.3CI passing

Since Jun 28Pushed 2mo ago34 watchersCompare

[ Source](https://github.com/jwilsson/spotify-web-api-php)[ Packagist](https://packagist.org/packages/jwilsson/spotify-web-api-php)[ Docs](https://github.com/jwilsson/spotify-web-api-php)[ RSS](/packages/jwilsson-spotify-web-api-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (97)Used By (8)

Spotify Web API PHP
===================

[](#spotify-web-api-php)

[![Packagist](https://camo.githubusercontent.com/367948044067fc60396131f26ea17a6a287639906ad26adcee8fde5313f8360d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a77696c73736f6e2f73706f746966792d7765622d6170692d7068702e737667)](https://packagist.org/packages/jwilsson/spotify-web-api-php)[![build](https://github.com/jwilsson/spotify-web-api-php/workflows/build/badge.svg)](https://github.com/jwilsson/spotify-web-api-php/workflows/build/badge.svg)[![Coverage Status](https://camo.githubusercontent.com/4a810be77263b9cccf785bf83ea30e80bc57d582cd491e6144edc995b7a764b2/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6a77696c73736f6e2f73706f746966792d7765622d6170692d7068702f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/r/jwilsson/spotify-web-api-php?branch=main)

This is a PHP wrapper for [Spotify's Web API](https://developer.spotify.com/web-api/). It includes the following:

- Helper methods for all API endpoints:
    - Information about artists, albums, tracks, podcasts, audiobooks, and users.
    - List music featured by Spotify.
    - Playlist and user music library management.
    - Spotify catalog search.
    - User playback control.
- Authorization flow helpers.
- Automatic refreshing of access tokens.
- Automatic retry of rate limited requests.
- PSR-4 autoloading support.

Requirements
------------

[](#requirements)

- PHP 8.3 or later.
- PHP [cURL extension](http://php.net/manual/en/book.curl.php) (Usually included with PHP).

Installation
------------

[](#installation)

Install it using [Composer](https://getcomposer.org/):

```
composer require jwilsson/spotify-web-api-php
```

Usage
-----

[](#usage)

Before using the Spotify Web API, you'll need to create an app at [Spotify’s developer site](https://developer.spotify.com/web-api/).

Simple example displaying a user's profile:

```
require 'vendor/autoload.php';

$session = new SpotifyWebAPI\Session(
    'CLIENT_ID',
    'CLIENT_SECRET',
    'REDIRECT_URI'
);

$api = new SpotifyWebAPI\SpotifyWebAPI();

if (isset($_GET['code'])) {
    $session->requestAccessToken($_GET['code']);
    $api->setAccessToken($session->getAccessToken());

    print_r($api->me());
} else {
    $options = [
        'scope' => [
            'user-read-email',
        ],
    ];

    header('Location: ' . $session->getAuthorizeUrl($options));
    die();
}
```

For more instructions and examples, check out the [documentation](/docs/).

The [Spotify Web API Console](https://developer.spotify.com/web-api/console/) can also be of great help when trying out the API.

Contributing
------------

[](#contributing)

Contributions are more than welcome! See [CONTRIBUTING.md](/CONTRIBUTING.md) for more info.

License
-------

[](#license)

MIT license. Please see [LICENSE.md](LICENSE.md) for more info.

###  Health Score

74

—

ExcellentBetter than 100% of packages

Maintenance83

Actively maintained with recent releases

Popularity64

Solid adoption and visibility

Community41

Growing community involvement

Maturity94

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 93.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~45 days

Recently: every ~99 days

Total

95

Last Release

88d ago

Major Versions

3.6.2 → 4.0.02020-11-30

4.3.0 → 5.0.02021-05-14

5.7.0 → 6.0.02023-08-01

5.7.1 → 6.0.12023-08-01

6.3.1 → 7.0.02025-12-14

PHP version history (9 changes)0.1.0PHP &gt;=5.3.3

1.0.0PHP &gt;=5.5

1.3.2PHP ^5.5 || ^7.0

2.0.0PHP ^7.0

2.3.0PHP ^5.6 || ^7.0

4.0.0PHP ^7.2 || ^8.0

5.0.0PHP ^7.3 || ^8.0

6.0.0PHP ^8.1

7.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/9833a6d6357b253e3e034c4cc407b76aa3205447eda63b2a77d398fecfd9b841?d=identicon)[jwilsson](/maintainers/jwilsson)

---

Top Contributors

[![jwilsson](https://avatars.githubusercontent.com/u/567607?v=4)](https://github.com/jwilsson "jwilsson (745 commits)")[![vdesabou](https://avatars.githubusercontent.com/u/4061923?v=4)](https://github.com/vdesabou "vdesabou (9 commits)")[![hvt](https://avatars.githubusercontent.com/u/337754?v=4)](https://github.com/hvt "hvt (8 commits)")[![PouleR](https://avatars.githubusercontent.com/u/6999565?v=4)](https://github.com/PouleR "PouleR (6 commits)")[![hansott](https://avatars.githubusercontent.com/u/3886384?v=4)](https://github.com/hansott "hansott (3 commits)")[![doekenorg](https://avatars.githubusercontent.com/u/529515?v=4)](https://github.com/doekenorg "doekenorg (2 commits)")[![vlakoff](https://avatars.githubusercontent.com/u/544424?v=4)](https://github.com/vlakoff "vlakoff (2 commits)")[![jamesfairhurst](https://avatars.githubusercontent.com/u/230768?v=4)](https://github.com/jamesfairhurst "jamesfairhurst (2 commits)")[![harrynewsome](https://avatars.githubusercontent.com/u/3323924?v=4)](https://github.com/harrynewsome "harrynewsome (1 commits)")[![JasonReading](https://avatars.githubusercontent.com/u/20302?v=4)](https://github.com/JasonReading "JasonReading (1 commits)")[![JMPerez](https://avatars.githubusercontent.com/u/416456?v=4)](https://github.com/JMPerez "JMPerez (1 commits)")[![johnwedgbury](https://avatars.githubusercontent.com/u/7074044?v=4)](https://github.com/johnwedgbury "johnwedgbury (1 commits)")[![JuhG](https://avatars.githubusercontent.com/u/10765158?v=4)](https://github.com/JuhG "JuhG (1 commits)")[![MACnus](https://avatars.githubusercontent.com/u/222047?v=4)](https://github.com/MACnus "MACnus (1 commits)")[![Mark-Howe](https://avatars.githubusercontent.com/u/1932792?v=4)](https://github.com/Mark-Howe "Mark-Howe (1 commits)")[![mengidd](https://avatars.githubusercontent.com/u/5988766?v=4)](https://github.com/mengidd "mengidd (1 commits)")[![mfatica](https://avatars.githubusercontent.com/u/7257334?v=4)](https://github.com/mfatica "mfatica (1 commits)")[![revoltek-daniel](https://avatars.githubusercontent.com/u/5931272?v=4)](https://github.com/revoltek-daniel "revoltek-daniel (1 commits)")[![SecondeJK](https://avatars.githubusercontent.com/u/17067659?v=4)](https://github.com/SecondeJK "SecondeJK (1 commits)")[![shahzeb1](https://avatars.githubusercontent.com/u/1383831?v=4)](https://github.com/shahzeb1 "shahzeb1 (1 commits)")

---

Tags

phpspotifyspotify

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/jwilsson-spotify-web-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/jwilsson-spotify-web-api-php/health.svg)](https://phpackages.com/packages/jwilsson-spotify-web-api-php)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[hubspot/api-client

Hubspot API client

23914.2M16](/packages/hubspot-api-client)[aerni/laravel-spotify

A Laravel wrapper for the Spotify Web API

209145.6k](/packages/aerni-laravel-spotify)[mmoreram/spotify-api-bundle

Easy Spotify Api interface for Symfony2 projects

128.5k](/packages/mmoreram-spotify-api-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
