PHPackages                             mgkprod/ytmusicapi - 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. mgkprod/ytmusicapi

ActiveLibrary[API Development](/categories/api)

mgkprod/ytmusicapi
==================

Unofficial API for YouTube Music

1.0.0(5y ago)131685[1 issues](https://github.com/mgkprod/ytmusicapi/issues)MITPHPPHP ^7.4|^8.0

Since Dec 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/mgkprod/ytmusicapi)[ Packagist](https://packagist.org/packages/mgkprod/ytmusicapi)[ Docs](https://github.com/mgkprod/ytmusicapi)[ RSS](/packages/mgkprod-ytmusicapi/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

YTMusicAPI
==========

[](#ytmusicapi)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f86aaafa304d1a0f53fcf3807917170b6dd7177808f570234316d79b955d9211/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d676b70726f642f79746d757369636170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mgkprod/ytmusicapi)[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![GitHub Tests Action Status](https://camo.githubusercontent.com/f80726fd059a82901d63af42951ceec1a83259a2aa62b184e117d4026d63a1e4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6d676b70726f642f79746d757369636170692f54657374733f6c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/f80726fd059a82901d63af42951ceec1a83259a2aa62b184e117d4026d63a1e4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6d676b70726f642f79746d757369636170692f54657374733f6c6162656c3d7465737473267374796c653d666c61742d737175617265)[![Total Downloads](https://camo.githubusercontent.com/61b4f9b8558b82ba0fe83c3f2969c91ea39194461e0228b5ed100bbec07dafda/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d676b70726f642f79746d757369636170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mgkprod/ytmusicapi)

A work-in-progress API that emulates web requests from the YouTube Music web client.

This is a port of [sigma67/ytmusicapi](https://github.com/sigma67/ytmusicapi), an unofficial API implementation written in Python.

This package being used in production in one of my applications, I will do my best to keep it up to date with the latest evolutions of the YouTube Music client. **I don't plan on porting more features than I need using the YouTube Music API into my app. Contributions are open!**

Features
--------

[](#features)

**Browsing**:

- search (including all filters)
- get artist information and releases (songs, videos, albums, singles)
- get user information (videos, playlists)
- get albums
- get song metadata
- get watch playlists (playlist that appears when you press play in YouTube Music)

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

[](#requirements)

- PHP 7.4+ and Laravel 8 or higher

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

[](#installation)

You can install the package via composer:

```
composer require mgkprod/ytmusicapi
```

The package will automatically register itself.

You can optionally publish the config file with:

```
php artisan vendor:publish --provider="MGKProd\YTMusic\YTMusicServiceProvider" --tag="config"
```

Usage
-----

[](#usage)

```
use MGKProd\YTMusic\Facades\YTMusic;

// search in all
$results = YTMusic::browse()->search('daft punk');

// filtered search (albums, artists, playlists, songs or videos)
$artists = YTMusic::browse()->search('magenta', 'artists');
$songs = YTMusic::browse()->search('blizzard oddscure', 'songs');

// artist
$artist = YTMusic::browse()->artist('MPLAUCmMUZbaYdNH0bEd1PAlAqsA');

// ... and his albums
$albums = YTMusic::browse()->artistAlbums(
    $artist['albums']['browseId'],
    $artist['albums']['params']
);

// ... or his singles
$singles = YTMusic::browse()->artistAlbums(
    $artist['singles']['browseId'],
    $artist['singles']['params']
);

// album
$album = YTMusic::browse()->album('MPREb_BQZvl3BFGay');

// song
$song = YTMusic::browse()->song('ZrOKjDZOtkA');

// user
$user = YTMusic::browse()->user('UCPVhZsC2od1xjGhgEc2NEPQ');

// ... and his playlists
$playlists = YTMusic::browse()->userPlaylists(
    'UCPVhZsC2od1xjGhgEc2NEPQ',
    $user['playlists']['params']
);
```

The [tests](./tests/BrowsingTest.php) are also a great source of usage examples.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Simon Rubuano](https://github.com/mgkprod)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

2017d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/151457591?v=4)[Simon Rubuano](/maintainers/mgkprod)[@mgkprod](https://github.com/mgkprod)

---

Top Contributors

[![rubuano](https://avatars.githubusercontent.com/u/33329579?v=4)](https://github.com/rubuano "rubuano (8 commits)")

---

Tags

laravelphpyoutubeyoutube-apiyoutube-musicyoutube-music-apiphplaravelyoutubeytmusicapiyoutube musicYoutube Apimgkprodyoutube-music-api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mgkprod-ytmusicapi/health.svg)

```
[![Health](https://phpackages.com/badges/mgkprod-ytmusicapi/health.svg)](https://phpackages.com/packages/mgkprod-ytmusicapi)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.0k](/packages/craftcms-cms)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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