PHPackages                             michaelbelgium/laravel-youtube-api - 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. michaelbelgium/laravel-youtube-api

ActiveLibrary

michaelbelgium/laravel-youtube-api
==================================

Add a youtube api to your Laravel instance

v3.1.0(2mo ago)30406↓100%10MITPHP

Since May 8Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/MichaelBelgium/Laravel-Youtube-API)[ Packagist](https://packagist.org/packages/michaelbelgium/laravel-youtube-api)[ Docs](https://github.com/michaelbelgium/laravel-youtube-api)[ Fund](https://www.paypal.com/donate/?hosted_button_id=ZJSKX2ASR3ARL)[ GitHub Sponsors](https://github.com/MichaelBelgium)[ RSS](/packages/michaelbelgium-laravel-youtube-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (25)Used By (0)

Laravel Youtube API
===================

[](#laravel-youtube-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c985c131ab768cc8ee92f5436a1bc02b4d66666cd4d8be45668e81c00262e11b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d69636861656c62656c6769756d2f6c61726176656c2d796f75747562652d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/michaelbelgium/laravel-youtube-api)[![Total Downloads](https://camo.githubusercontent.com/ab0f7dfc4431cfe47edd227d4f646776787f1262100506f7898935a6b9adeaf2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d69636861656c62656c6769756d2f6c61726176656c2d796f75747562652d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/michaelbelgium/laravel-youtube-api)

This package provides a simple youtube api for your Laravel application. It is based on my non-laravel package [Youtube API](https://github.com/MichaelBelgium/Youtube-to-mp3-API).

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

[](#installation)

- Install the package via composer:

```
composer require michaelbelgium/laravel-youtube-api
```

- Optional: publish the config file and edit if u like:

```
php artisan vendor:publish --tag=youtube-api-config
```

- This package uses [the public disk](https://laravel.com/docs/8.x/filesystem#the-public-disk) of Laravel. Run this command to create a symbolic link to the public folder so that converted Youtube downloads are accessible:

```
php artisan storage:link
```

- Execute package migrations

```
php artisan migrate

```

Software
========

[](#software)

Depending on what driver you use - on the server where your laravel app is located, you'll need to install some packages.

- Install ffmpeg (+ libmp3lame - see [this wiki](https://github.com/MichaelBelgium/Youtube-to-mp3-API/wiki/Installing-%22ffmpeg%22-and-%22libmp3lame%22-manually) for tutorial)
- [install youtube-dl](http://ytdl-org.github.io/youtube-dl/download.html)

API Usage
=========

[](#api-usage)

This package adds 3 api routes. The route prefix, `/ytconverter/` in this case, is configurable.

- POST|GET /ytconverter/convert
- DELETE /ytconverter/{id}
- GET /ytconverter/search
- GET /ytconverter/info

Check the wiki page of this repository for more information about the routes.

To enable the search endpoint you need to acquire a Google API key on the [Google Developer Console](https://console.developers.google.com) for the API "Youtube Data API v3". Use this key in the environment variable `GOOGLE_API_KEY`

Configuration
=============

[](#configuration)

Driver
------

[](#driver)

Downloading Youtube video's is not simple these days. To cover this, you can choose how you want to download the video's by setting the `driver` in the configuration.

Available drivers:

- local

The default driver. Requires ffmpeg and yt-dlp or youtube-dl to be installed on the server and it'll download files to the server. Metadata comes from yt-dlp.

- cobalt

Requires a self hosted [Cobalt](https://github.com/imputnet/cobalt) (API) instance. It doesn't require any software to be installed on the server and it doesn't download files to the server. If `GOOGLE_API_KEY` is set, it'll use the Youtube Data API to get metadata, otherwise it'll download the video to get the metadata and thus use storage space instead.

API authorization
-----------------

[](#api-authorization)

If needed, you can protect the API routes with an authentication guard by setting `auth` in the configuration.

Example:

```
'auth' => 'sanctum',
```

API rate limiting
-----------------

[](#api-rate-limiting)

If needed, you can limit API calls by editing the config setting `ratelimiter`. See [Laravel docs](https://laravel.com/docs/8.x/routing#rate-limiting) for more information or examples.

Example:

```
'ratelimiter' => function (Request $request) {
    return Limit::perMinute(5);
},
```

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance86

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

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 ~92 days

Recently: every ~100 days

Total

24

Last Release

72d ago

Major Versions

v1.2.0 → v2.0.02021-10-06

v2.4.5 → v3.0.02024-11-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/888b7a13d8ef5d680c9bc4a9baa1db37953015e30643e6320b3533459dd23d7a?d=identicon)[MichaelBelgium](/maintainers/MichaelBelgium)

---

Top Contributors

[![MichaelBelgium](https://avatars.githubusercontent.com/u/8951045?v=4)](https://github.com/MichaelBelgium "MichaelBelgium (106 commits)")

---

Tags

laravellaravel-packagevideo-converteryoutubeyoutube-apiyoutube-dlyoutube-downloaderlaravelyoutubeYoutube Apimichaelbelgiumlaravel-youtube-api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/michaelbelgium-laravel-youtube-api/health.svg)

```
[![Health](https://phpackages.com/badges/michaelbelgium-laravel-youtube-api/health.svg)](https://phpackages.com/packages/michaelbelgium-laravel-youtube-api)
```

###  Alternatives

[sahusoftcom/youtube-livestream-api

PHP (Laravel) Package for Google / YouTube API of Video Live Streaming with Google Auth

451.1k](/packages/sahusoftcom-youtube-livestream-api)

PHPackages © 2026

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