PHPackages                             madcoda/php-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. [API Development](/categories/api)
4. /
5. madcoda/php-youtube-api

ActiveLibrary[API Development](/categories/api)

madcoda/php-youtube-api
=======================

PHP wrapper for the Youtube Data API v3

v1.2.6(4y ago)4451.2M—5%115[1 issues](https://github.com/madcoda/php-youtube-api/issues)[5 PRs](https://github.com/madcoda/php-youtube-api/pulls)8MITPHPPHP &gt;=7.0CI failing

Since Jul 7Pushed 3y ago26 watchersCompare

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

READMEChangelog (10)Dependencies (1)Versions (11)Used By (8)

php-youtube-api
===============

[](#php-youtube-api)

[![Build Status](https://camo.githubusercontent.com/49a666772ba8d53835b255d9371aaa1150a889df75022721591344bb58d4bda2/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6d6164636f64612f7068702d796f75747562652d6170692e706e67)](https://travis-ci.org/madcoda/php-youtube-api)

A basic PHP wrapper for the Youtube Data API v3 ( Non-OAuth ). Designed to let devs easily fetch public data (Video, Channel, Playlists info) from Youtube. No 3rd party dependancy (except PHPUnit). The reason for returning the decoded JSON response directly, is that you only need to read the Google API doc to use this library, instead of learning my set of API again (Keep it simple).

Well.. actually some parameters are missing in this library, because I don't need them at this point. If you desire a particular feature, please [file an issue here](https://github.com/madcoda/php-youtube-api/issues) :)

Currently I will not consider adding OAuth endpoints. (those required "authorized request" will not be supported)

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

[](#requirements)

- PHP &gt;=5.3
- CURL extension in PHP

Install
-------

[](#install)

Run the following command in your command line shell for your php project

```
$ composer require madcoda/php-youtube-api:^1.2
```

Done.

You may also edit composer.json manually then perform `composer update`

```
"require": {
    "madcoda/php-youtube-api": "^1.2"
}

```

Getting started
---------------

[](#getting-started)

Please read the wiki on how to use this library with [PHP with composer](https://github.com/madcoda/php-youtube-api/wiki/started-with-php-composer), [Laravel 4](https://github.com/madcoda/php-youtube-api/wiki/started-with-laravel-4) and [Laravel 5](https://github.com/madcoda/php-youtube-api/wiki/started-with-laravel-5).

For the functions implemented in this library, please visit [API Reference](https://github.com/madcoda/php-youtube-api/wiki/api-reference)

### Example usage with pure PHP (with composer)

[](#example-usage-with-pure-php-with-composer)

```
require 'vendor/autoload.php';
$youtube = new Madcoda\Youtube\Youtube(array('key' => '* Your API key here *'));
$video = $youtube->getVideoInfo('rie-hPVJ7Sw');
```

### Example usage with Laravel 4/5

[](#example-usage-with-laravel-45)

```
$video = Youtube::getVideoInfo(Input::get('vid', 'dQw4w9WgXcQ');
```

Format of returned data
-----------------------

[](#format-of-returned-data)

The returned json is decoded as PHP objects (not Array). Please read the ["Reference" section](https://developers.google.com/youtube/v3/docs/) of the official API doc.

YouTube Data API v3
-------------------

[](#youtube-data-api-v3)

- [YouTube Data API v3 Doc](https://developers.google.com/youtube/v3/)
- [Obtain API key from Google API Console](http://code.google.com/apis/console)

Contact
-------

[](#contact)

For bugs, complaints, or suggestions, please [file an Issue here](https://github.com/madcoda/php-youtube-api/issues)or send email to  :)

License
-------

[](#license)

This repo `madcoda/php-youtube-api` is licensed under the [MIT License](http://opensource.org/licenses/MIT).

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity61

Solid adoption and visibility

Community38

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 78.9% 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 ~283 days

Recently: every ~390 days

Total

10

Last Release

1779d ago

PHP version history (3 changes)v1.0PHP &gt;5.3

v1.2.2PHP &gt;=5.3

v1.2.6PHP &gt;=7.0

### Community

Maintainers

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

---

Top Contributors

[![madcoda](https://avatars.githubusercontent.com/u/602185?v=4)](https://github.com/madcoda "madcoda (90 commits)")[![mhor](https://avatars.githubusercontent.com/u/4103719?v=4)](https://github.com/mhor "mhor (3 commits)")[![jbboehr](https://avatars.githubusercontent.com/u/225601?v=4)](https://github.com/jbboehr "jbboehr (3 commits)")[![jamesggordon](https://avatars.githubusercontent.com/u/650785?v=4)](https://github.com/jamesggordon "jamesggordon (2 commits)")[![konybakk](https://avatars.githubusercontent.com/u/2905760?v=4)](https://github.com/konybakk "konybakk (2 commits)")[![saruman](https://avatars.githubusercontent.com/u/813190?v=4)](https://github.com/saruman "saruman (2 commits)")[![sidHitesh7](https://avatars.githubusercontent.com/u/3795597?v=4)](https://github.com/sidHitesh7 "sidHitesh7 (1 commits)")[![Stichoza](https://avatars.githubusercontent.com/u/1139050?v=4)](https://github.com/Stichoza "Stichoza (1 commits)")[![tambait](https://avatars.githubusercontent.com/u/22012185?v=4)](https://github.com/tambait "tambait (1 commits)")[![wlkns](https://avatars.githubusercontent.com/u/1921583?v=4)](https://github.com/wlkns "wlkns (1 commits)")[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (1 commits)")[![Hackwar](https://avatars.githubusercontent.com/u/313866?v=4)](https://github.com/Hackwar "Hackwar (1 commits)")[![z38](https://avatars.githubusercontent.com/u/3948085?v=4)](https://github.com/z38 "z38 (1 commits)")[![jk](https://avatars.githubusercontent.com/u/40043?v=4)](https://github.com/jk "jk (1 commits)")[![LorenzoSapora](https://avatars.githubusercontent.com/u/25519274?v=4)](https://github.com/LorenzoSapora "LorenzoSapora (1 commits)")[![marvin255](https://avatars.githubusercontent.com/u/2802915?v=4)](https://github.com/marvin255 "marvin255 (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![primus852](https://avatars.githubusercontent.com/u/5185509?v=4)](https://github.com/primus852 "primus852 (1 commits)")

---

Tags

phpphp-youtube-apiyoutubeapivideoyoutubemadcoda

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/madcoda-php-youtube-api/health.svg)

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

###  Alternatives

[alaouy/youtube

Laravel PHP Facade/Wrapper for the Youtube Data API v3

8091.3M9](/packages/alaouy-youtube)[socialapis/youtubedownloader

A small project for fetching youtube vidoes with their private api.

241.4k](/packages/socialapis-youtubedownloader)

PHPackages © 2026

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