PHPackages                             jordanpartridge/spotify-client - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. jordanpartridge/spotify-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

jordanpartridge/spotify-client
==============================

A modern Laravel package for the Spotify Web API, built with Saloon HTTP client

v1.3.0(10mo ago)09[3 issues](https://github.com/jordanpartridge/spotify-client/issues)MITPHPPHP ^8.2

Since Jun 25Pushed 10mo agoCompare

[ Source](https://github.com/jordanpartridge/spotify-client)[ Packagist](https://packagist.org/packages/jordanpartridge/spotify-client)[ RSS](/packages/jordanpartridge-spotify-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (9)Versions (12)Used By (0)

🎵 Spotify Client for Laravel
============================

[](#-spotify-client-for-laravel)

*Well, I've been writing PHP code all night long*
*Building APIs that just feel so right*
*Got my Saloon connector, Laravel's my home*
*This package's got style, won't leave you alone*

What This Package Does
----------------------

[](#what-this-package-does)

This Laravel package provides a modern, elegant interface to the Spotify Web API. Built with Saloon HTTP client and following Laravel conventions, it's designed to make working with Spotify's API as smooth as a steel guitar solo.

### Features That'll Make You Holler

[](#features-thatll-make-you-holler)

- 🎸 **Clean Architecture** - Organized like a well-tuned band
- 🎤 **Saloon HTTP Client** - Smooth as honey, strong as whiskey
- 🎺 **Laravel Integration** - Fits right into your Laravel app like boots in stirrups
- 🎻 **Type Safety** - Contracts and interfaces tighter than new jeans
- 🪕 **OAuth Support** - Authentication flows that just work
- 🎼 **Resource Organization** - Albums, Artists, Tracks, and more - all organized neat

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

[](#installation)

```
composer require jordanpartridge/spotify-client
```

Then run our fancy install command that'll set you up proper:

```
php artisan spotify:install
# or use the setup alias
php artisan spotify:setup
```

*That command's gonna open your browser, help you register your app*
*Get your tokens sorted, close that authentication gap*
*From Client ID to secrets, we'll handle it all*
*This setup's so easy, you'll have a ball*

Basic Usage
-----------

[](#basic-usage)

```
use Jordanpartridge\SpotifyClient\Contracts\SpotifyClientInterface;

// Inject the client (Laravel's DI is sweeter than tea)
public function __construct(SpotifyClientInterface $spotify)
{
    $this->spotify = $spotify;
}

// Get an album (data comes back clean as mountain air)
$album = $this->spotify->albums()->get('album-id');

// Search for artists (find 'em faster than a hound dog)
$artists = $this->spotify->artists()->getMultiple(['artist1', 'artist2']);

// Get track details (metadata richer than bottom land)
$track = $this->spotify->tracks()->get('track-id');
```

Architecture That Sings
-----------------------

[](#architecture-that-sings)

This package follows a pattern cleaner than Sunday clothes:

### The Main Players

[](#the-main-players)

- **SpotifyConnector** - The bandleader, handles the base URL and keeps everyone in time
- **SpotifyClient** - Your main interface, implements the contract like a handshake deal
- **Resources** - Organized by what they do (Albums, Artists, Tracks, etc.)
- **Requests** - Individual API calls, each one knows its job
- **Contracts** - Interfaces that keep everything honest

### Directory Structure

[](#directory-structure)

```
src/
├── Contracts/           # Promises we keep
├── Resources/           # Organized by purpose
├── Requests/            # Individual API workers
├── SpotifyConnector.php # The main connection
└── SpotifyClient.php    # Your friendly interface

```

*We built this thing with Saloon for the HTTP*
*Laravel Package Tools for the setup flow*
*Every class has its place, every method has its role*
*This architecture's solid, right down to the soul*

Authentication Flows
--------------------

[](#authentication-flows)

### Client Credentials (App-Only)

[](#client-credentials-app-only)

Perfect for when you just need public data:

```
// Configure in your .env
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
SPOTIFY_AUTH_FLOW=client_credentials
```

### Authorization Code (User Context)

[](#authorization-code-user-context)

When you need user permissions:

```
// The install command will help you set this up
SPOTIFY_AUTH_FLOW=authorization_code
SPOTIFY_REDIRECT_URI=http://localhost:8000/callback
```

Configuration
-------------

[](#configuration)

The config file's got everything you need:

```
// config/spotify-client.php
return [
    'client_id' => env('SPOTIFY_CLIENT_ID'),
    'client_secret' => env('SPOTIFY_CLIENT_SECRET'),
    'default_market' => env('SPOTIFY_DEFAULT_MARKET', 'US'),
    // ... and much more
];
```

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

[](#contributing)

Pull requests welcome! This package follows:

- PSR-12 coding standards (Laravel Pint keeps us honest)
- PHPStan static analysis (level 8, strict as a preacher)
- Pest PHP for testing (when we get them tests written)

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

[](#requirements)

- PHP 8.2 or higher (modern as a Tesla truck)
- Laravel 10.0 or higher (staying current, staying strong)

License
-------

[](#license)

MIT License - free as a bird, open as the range.

---

*This package was built with love, Laravel, and a appreciation for good architecture*
*May your API calls be swift and your tokens never expire* 🤠

Credits
-------

[](#credits)

Built by [Jordan Partridge](https://github.com/jordanpartridge) with inspiration from:

- The Spotify Web API team
- The Saloon PHP community
- The Laravel ecosystem
- Good music and clean code

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance55

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

4

Last Release

304d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6bb27de88a541a632427686306c8fc56366d72582f6a3316d20500efe7971f3?d=identicon)[conduit-ui](/maintainers/conduit-ui)

---

Top Contributors

[![jordanpartridge](https://avatars.githubusercontent.com/u/9040417?v=4)](https://github.com/jordanpartridge "jordanpartridge (11 commits)")

---

Tags

apilaravelhttp clientsaloonspotify

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jordanpartridge-spotify-client/health.svg)

```
[![Health](https://phpackages.com/badges/jordanpartridge-spotify-client/health.svg)](https://phpackages.com/packages/jordanpartridge-spotify-client)
```

###  Alternatives

[binaryk/laravel-restify

Laravel REST API helpers

651399.1k](/packages/binaryk-laravel-restify)[sunchayn/nimbus

A Laravel package providing an in-browser API client with automatic schema generation, live validation, and built-in authentication with a touch of Laravel-tailored magic for effortless API testing.

29428.0k](/packages/sunchayn-nimbus)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[butschster/kraken-api-client

The most powerful and extendable REST API / Websocket client for Kraken.com. Built on PHP8.0

4914.3k](/packages/butschster-kraken-api-client)[pdphilip/cf-request

Cloudflare Laravel Request

2725.6k1](/packages/pdphilip-cf-request)

PHPackages © 2026

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