PHPackages                             utvarp/music-helper - 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. utvarp/music-helper

AbandonedArchivedLibrary[API Development](/categories/api)

utvarp/music-helper
===================

Trying to unify music sources into one handy package 🎶

1.1.2(9y ago)1124MITPHPPHP ^7.0

Since Apr 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/atomescrochus/music-helper)[ Packagist](https://packagist.org/packages/utvarp/music-helper)[ Docs](https://github.com/utvarp/music-helper)[ RSS](/packages/utvarp-music-helper/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (5)Versions (6)Used By (0)

Trying to unify music sources into one handy package 🎶
======================================================

[](#trying-to-unify-music-sources-into-one-handy-package-)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0b3852c297135c701faacf5f22bb0d89a316140f60710a53cf929099d536d35c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7574766172702f6d757369632d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/utvarp/music-helper)[![Total Downloads](https://camo.githubusercontent.com/a8c43db612e94738b3adfd8472355de367e9726a26c7fe59ee39a79dcafe092e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7574766172702f6d757369632d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/utvarp/music-helper)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/4ff089263e3a25454b326655d9345361ccb41c35d5da5de9437eb37340aadd4b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7574766172702f6d757369632d68656c7065722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/utvarp/music-helper)

There is a lot of source for music information around. Maybe you just want to search one of them. Maybe you need to have many of the at the same time. This package is here for you!

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

[](#installation)

You can install the package via composer:

```
composer require utvarp/music-helper
```

Usage
-----

[](#usage)

At the moment, this package will only fetch *basic* informations:

- The track name and id from requested source;
- (If available) The artist name and id from requested source;
- (If available) The album name and id from requested source;

*For now*, you need to make extra call to the source API (with the ID) to fetch more detailed information.

In addition to the information from the source API, the package will also perform a string similarity check between a result's track and artist name against the actual searched for result. That way, you could decide not to trust the source' listing order and sort yourself by one of the smililarity score.

Here's how you could play with the package:

```
$music = new Utvarp\MusicHelper\Music();

// If the source you want to use needs an API key, you would include it like so
// You can see in the available source list in the readme if an API needs a key
$music->setMusixmatchAPiKey($key); // method names are in this fashion: set{Sourcename}APIKey

// You're not forced to chain the methods, but search should go at the end.
// You only need either an artist or a track, and call the search method to go.
// Source takes a string, an array or a collection of the possible sources, default is 'all'.
// The integer passes to search is the maximum result you want returned from an API, default is 25.
$search = $music->source('all')->artist('Lady Gaga')->track('Poker Face')->search(15);

// Now, out of all the source, if you wanted to get the Deezer results (but it could be any available source)
$deezerResults = $search->getResults('deezer');

$count = $deezerResults->count; // fetch the total results count
$results = $deezerResults->results; // get the actual result collection

// You could acccess a specific result
$result = $results->first(); // Since it's a collection, the usual methods are available
//or
$result = $results[0]; // But you can still access a collection like an array, if you prefer

// From the result, you have access to a track, artist and album object.
$trackId = $result->track->id;
$trackName = $result->track->name;
$albumName = $result->album->name;

// In those objects (except album), you also have access to a the similarity score from 3 different algorithms
$similarTextScore = $result->track->similarityScores->similar_text; // maximum score of 100.0
$smgScore = $result->track->similarityScores->smg; // Smith Waterman Gotoh score, maximum of 1.0
$levenshteinScore = $result->track->similarityScores->levenshtein; // Levenshtein score, maximum of 1
```

Wishlist / Roadmap / Help wanted 👷🚧👷‍♀️
---------------------------------------

[](#wishlist--roadmap--help-wanted-‍️)

- Caching search so we don't hit any API rate limit too quickly
- More source
    - Gracenote ( ?)
    - Spotify ( ?)
    - Discogs ( ?)
    - iTunes ( ?)
    - Musicbrainz ( ?)
    - Google Play Music
- Add more information to source (?)
- Add methods to make more precise search in sources' APIs (for ex.: searching by the ID returned by the basic search)?

Sources
-------

[](#sources)

### How to create new source

[](#how-to-create-new-source)

This should be easy. Follow the next steps and check the corresponding files for the `deezer` source and just build from there!

1. Create a new search class in `src\Searches\{SourceName}.php`. This class should be only responsible to make the search to the source's api.
2. Create a new model class in `src\Models\{SourceName}Result.php`. This class should be only responsible to correctly *format* the results received by the API and set the `track`, `artist` and `album` values using the corresponding methods you can find in the base `Result` model.
3. Add `sourceName` to the `possibleSources` collection in the constructor of `src\Music.php`.
4. (If required) Add a method to set the API key of the source and add the source to the `apiKeys` collection in the constructor of `src\Music.php`.
5. Test your things, but it should now be all ok!

### Existing sources

[](#existing-sources)

- Deezer (API key required: *NO*)
- Musixmatch (API key required: *YES*)

Testing
-------

[](#testing)

```
$ composer test
```

Changelog
---------

[](#changelog)

Changes can be found [in the release pages of the repo](https://github.com/Utvarp/music-helper/releases).

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

[](#contributing)

Contributions are welcome, [thanks to everyone who sent something out way](https://github.com/utvarp/music-helper/graphs/contributors) :)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

3347d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1550428?v=4)[Jean-Philippe Murray](/maintainers/jpmurray)[@jpmurray](https://github.com/jpmurray)

---

Top Contributors

[![jpmurray](https://avatars.githubusercontent.com/u/1550428?v=4)](https://github.com/jpmurray "jpmurray (48 commits)")

---

Tags

apimetadatamusicphpapimusicappstractmusic-helperinformations

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/utvarp-music-helper/health.svg)

```
[![Health](https://phpackages.com/badges/utvarp-music-helper/health.svg)](https://phpackages.com/packages/utvarp-music-helper)
```

###  Alternatives

[saloonphp/laravel-plugin

The official Laravel plugin for Saloon

806.6M187](/packages/saloonphp-laravel-plugin)[resend/resend-laravel

Resend for Laravel

1212.2M8](/packages/resend-resend-laravel)[essa/api-tool-kit

set of tools to build an api with laravel

53386.5k](/packages/essa-api-tool-kit)[aerni/laravel-spotify

A Laravel wrapper for the Spotify Web API

208157.8k](/packages/aerni-laravel-spotify)

PHPackages © 2026

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