RepositoryPHP
alchemyguy

alchemyguy/YoutubeLaravelApi

A Laravel wrapper over Youtube API v3, with customized functionalities

62stars
29forks
2issues
3views

YoutubeLaravelApi

Tests Static analysis Latest version License

Modern Laravel wrapper for the YouTube Data API v3 with OAuth, live broadcast control, channel management, and resumable video uploads.

Documentation: https://alchemyguy.github.io/YoutubeLaravelApi/

Requirements

  • PHP 8.3 or higher
  • Laravel 11.x or 12.x

Install

composer require alchemyguy/youtube-laravel-api
php artisan vendor:publish --tag=youtube-config

Add credentials to your .env:

YOUTUBE_APP_NAME="My App"
YOUTUBE_CLIENT_ID="your-client-id.apps.googleusercontent.com"
YOUTUBE_CLIENT_SECRET="your-client-secret"
YOUTUBE_API_KEY="your-server-api-key"
YOUTUBE_REDIRECT_URL="https://yourapp.test/oauth/youtube/callback"

Quick example

use Alchemyguy\YoutubeLaravelApi\Services\AuthenticateService;
use Alchemyguy\YoutubeLaravelApi\Services\LiveStream\LiveStreamService;
use Alchemyguy\YoutubeLaravelApi\DTOs\BroadcastData;

// 1. OAuth
$auth = app(AuthenticateService::class);
$url = $auth->getLoginUrl('creator@example.com', 'channel-id');
// ... redirect, handle callback ...
$result = $auth->authenticateWithCode($code);

// 2. Schedule a live broadcast
$live = app(LiveStreamService::class);
$broadcast = $live->broadcast($result['token'], new BroadcastData(
    title: 'My Stream',
    description: 'Live coding',
    scheduledStartTime: new DateTimeImmutable('+10 minutes'),
));

Documentation

The full guide, API reference, and examples live at alchemyguy.github.io/YoutubeLaravelApi.

Upgrading from 1.x

If you're on the previous version, see UPGRADE.md — there are several breaking changes.

Contributing

Contributions welcome — see CONTRIBUTING.md. Please run composer lint and composer test:unit before opening a PR.

Security

If you discover a security vulnerability, please email the maintainer directly rather than opening an issue.

License

The MIT License (MIT). See LICENSE for details.

Credits

Similar Projects

Discover other similar projects and AI models.

RepositoryTypeScript
baptisteArno/node-youtube-music

Unofficial YouTube Music API for Node.js

119
Sep 9, 2023
RepositoryPHP
MichaelBelgium/Youtube-API

A way to host your own API that converts youtube video's to mp3/mp4 and returns a download/stream link and information.

179
Jun 11, 2026
RepositoryCrystal
iv-org/invidious

Invidious is an alternative front-end to YouTube

26.2k
Nov 25, 2026
RepositoryPython
jnsougata/opentube

Access YouTube Public Data without YouTubeAPI

95
Oct 16, 2026
RepositoryPython
harry0703/MoneyPrinterTurbo

利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.

147.3k
Dec 1, 2026
RepositoryPython
mvanhorn/last30days-skill

AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary

79.4k
Dec 2, 2026
RepositoryKotlin
team-spotube/spotube

🎧 Open source music streaming app! Available for both desktop & mobile!

51.1k
Dec 1, 2026
RepositoryJava
TeamNewPipe/NewPipe

A libre lightweight streaming front-end for Android.

41.1k
Dec 1, 2026
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026