PHPackages                             azaw/yt-toolkit - 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. azaw/yt-toolkit

ActiveLibrary

azaw/yt-toolkit
===============

Youtube toolkit

v1.0.4(yesterday)07↑2900%MITPHPPHP &gt;=8.4

Since Apr 4Pushed yesterdayCompare

[ Source](https://github.com/AlbertZawadzki/yt-toolkit)[ Packagist](https://packagist.org/packages/azaw/yt-toolkit)[ RSS](/packages/azaw-yt-toolkit/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (6)Used By (0)

yt-toolkit
==========

[](#yt-toolkit)

A Symfony bundle for interacting with the YouTube Data API v3.

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

[](#installation)

```
composer require azaw/yt-toolkit
```

Register the bundle in `config/bundles.php`:

```
return [
    YtToolkit\YtToolkitPackBundle::class => ['all' => true],
];
```

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

[](#configuration)

Set your YouTube Data API key as an environment variable:

```
YOUTUBE_API_KEY=your_api_key_here
```

The default `YoutubeClientSecretProvider` reads `$_ENV['YOUTUBE_API_KEY']`. To use a custom source, implement `YoutubeClientSecretProviderInterface` and bind it as the alias in your app's service configuration:

```
services:
  YtToolkit\Contracts\YoutubeClientSecretProviderInterface:
    alias: App\YourCustomSecretProvider
```

Services
--------

[](#services)

### `FetchVideosService`

[](#fetchvideosservice)

Fetches videos from a YouTube channel.

```
use YtToolkit\Service\FetchVideosService;

$response = $fetchVideosService->fetchVideos(
    channelId: 'UCxxxxxxxxxxxxxxxxxxxxxx',
    maxResults: 25,        // optional, default 25
    pageToken: null,       // optional, for pagination
);

// $response is VideoSearchListResponse
foreach ($response->items as $result) {
    echo $result->id->videoId;
}

// Paginate
$nextPage = $fetchVideosService->fetchVideos('UCxxx', pageToken: $response->nextPageToken);
```

### `FetchChannelService`

[](#fetchchannelservice)

Fetches a channel by its handle (e.g. `@channelname`).

```
use YtToolkit\Service\FetchChannelService;

$response = $fetchChannelService->fetchChannelByHandle('@channelname');

// $response is ChannelListResponse
foreach ($response->items as $channel) {
    echo $channel->id;
}
```

### `YoutubeParser`

[](#youtubeparser)

Extracts a YouTube video ID from various URL formats (standard, short, embed, live).

```
use YtToolkit\Parser\YoutubeParser;

$parser = new YoutubeParser();

$videoId = $parser->getCodeFromLink('https://www.youtube.com/watch?v=dQw4w9WgXcQ');
// 'dQw4w9WgXcQ'

$videoId = $parser->getCodeFromLink('https://youtu.be/dQw4w9WgXcQ');
// 'dQw4w9WgXcQ'

$videoId = $parser->getCodeFromLink('https://www.youtube.com/embed/dQw4w9WgXcQ');
// 'dQw4w9WgXcQ'

$videoId = $parser->getCodeFromLink('https://www.youtube.com/live/dQw4w9WgXcQ');
// 'dQw4w9WgXcQ'
```

Returns `null` if no video ID is found.

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance100

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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

5

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a786bc5505f824a2f54a9ef9e066c620d2b27a3a45c624a3a827e863348ab8f8?d=identicon)[AlbertZawadzki](/maintainers/AlbertZawadzki)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/azaw-yt-toolkit/health.svg)

```
[![Health](https://phpackages.com/badges/azaw-yt-toolkit/health.svg)](https://phpackages.com/packages/azaw-yt-toolkit)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M136](/packages/sulu-sulu)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M185](/packages/simplesamlphp-simplesamlphp)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M377](/packages/shopware-core)[shopware/administration

Administration frontend for the Shopware Core

413.9M73](/packages/shopware-administration)

PHPackages © 2026

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