PHPackages                             mmg/youtube - 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. mmg/youtube

ActiveLibrary[API Development](/categories/api)

mmg/youtube
===========

Wrapper class for the mmg group to consume Youtube Api.

v1.0.2(3y ago)018MITPHP

Since Mar 12Pushed 3y ago1 watchersCompare

[ Source](https://github.com/shahzaib91/youtube-wrapper)[ Packagist](https://packagist.org/packages/mmg/youtube)[ RSS](/packages/mmg-youtube/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

### Background

[](#background)

This is just a "wrapper class" built on top of the "Google SDK" to minimize the effort of integrating the "Youtube" api into your projects.

### Pre Requisite

[](#pre-requisite)

- Xampp/Wampp or Mamp server must be installed.
- Composer is installed and configured properly.
- Minimum PHP 7.2 (Not tested below or with later versions).
- [Google Developer Console](https://console.cloud.google.com/) account.

### Setup Google Developer Console Project

[](#setup-google-developer-console-project)

- Sign in to [Google Developer Console](https://console.cloud.google.com/).
- Create "New Project" usually option is available between google cloud logo and the search bar.
- Enter "Project Name" and select "Organization" depending upon your account.
- Click blue "Create" button.
- Configure "0Auth consent screen" by filling asked details and click "Save and continue" button.
- Add the required Scopes you will be requesting from the user:

     `            https://www.googleapis.com/auth/youtube.readonly            https://www.googleapis.com/auth/youtube.force-ssl        `

     click "Save and continue" after adding above scopes into consent screen.

     Note: If scopes are not available in your project click "Enable API &amp; Services" button and enable "Youtube Data API" for your project.
- Add "Test users" and click "Save and continue" button.
- Click "Credentials" option provided in left "Navigation Panel".
- Click "+ Create Credentials" button and choose "API Key" &amp; copy it.
- Create "OAuth client ID" while you are on the "Credentials" page and configure "Redirect URIs".
- Click the little "Download Icon" under the heading "OAuth 2.0 Client IDs" and download config file.
- Make sure you have "API Key" and "Config JSON" file on this step.

### Example Code

[](#example-code)

### Setup Library

[](#setup-library)

- Run command `composer require mmg/youtube`.
- Add `require __DIR__.'/vendor/autoload.php';` on top of your php file.

### Functions Description

[](#functions-description)

   Function Name Description      `                    public function prepare($name, $scopes, $configJsonPath, $apiKey)                `   Function to config client via wrapper class     `                    public function getAuthUrl()                `   Function to get auth url for authentication     `                    public function getAccessToken($code)                `   Function to fetch access token and set it to client     `                    public function setAccessToken($accessTokenJson)                `   Function sets access token to google client object     `                    private function parseAccessTokenJson($accessTokenJson)                `   Helper function to abstractedly perform json parsing     `                    public function getChannelsList()                `   Function to retrieve list of available channels owned by authenticated user     `                    public function getVideosList($channelId, $maxItems = 12)                `   Function to retrieve list of videos     `                    public function getVideoDetail($videoId)                `   Function to retrieve video details     `                    public function getVideoComments($videoId, $maxItems = 12)                `   Function to retrieve video comments and replies     `                    public function getVideoComments($videoId, $maxItems = 12)                `   Function is helping in tagging right reply to right comment by id

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

Every ~0 days

Total

2

Last Release

1163d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/23cdc927c8f9d42b391aa86aad3006b9ce62a46fd73d08950633d97e3e26fcb2?d=identicon)[shahzaib.2377](/maintainers/shahzaib.2377)

---

Top Contributors

[![syed-shahzaib-itsmesyed](https://avatars.githubusercontent.com/u/19744886?v=4)](https://github.com/syed-shahzaib-itsmesyed "syed-shahzaib-itsmesyed (6 commits)")

### Embed Badge

![Health badge](/badges/mmg-youtube/health.svg)

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

###  Alternatives

[revolution/laravel-google-sheets

Google Sheets API v4

4483.1M6](/packages/revolution-laravel-google-sheets)[pulkitjalan/google-apiclient

Google api php client wrapper with Cloud Platform and Laravel support

2582.9M5](/packages/pulkitjalan-google-apiclient)[dacastro4/laravel-gmail

Gmail API package for Laravel

312382.9k1](/packages/dacastro4-laravel-gmail)[spotonlive/php-google-my-business

Google MyBusiness

31677.1k](/packages/spotonlive-php-google-my-business)[happyr/google-api-bundle

A Symfony2 Wrapper for the Google APIs Client Library for PHP

48196.1k](/packages/happyr-google-api-bundle)[mediafigaro/google-analytics-api-symfony

Google Analytics API v4 Symfony

46177.7k](/packages/mediafigaro-google-analytics-api-symfony)

PHPackages © 2026

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