PHPackages                             corbpie/yt-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. corbpie/yt-api

ActiveLibrary[API Development](/categories/api)

corbpie/yt-api
==============

A PHP YouTube API wrapper

1.0(4y ago)19MITPHPPHP &gt;=8.0

Since Aug 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/cp6/php-youtube-api)[ Packagist](https://packagist.org/packages/corbpie/yt-api)[ RSS](/packages/corbpie-yt-api/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

PHP YouTube API wrapper
=======================

[](#php-youtube-api-wrapper)

Just a PHP YouTube API wrapper for searching videos and getting channel/video/playlist data and information.

Usage
-----

[](#usage)

```
composer require corbpie/yt-api
```

Put your YouTube API key at line 9 of `src/YTAPI.php`

Use the class with:

```
require_once('vendor/autoload.php');

use Corbpie\YouTubeApiClass\YTAPI;

$yt = new YTAPI();
```

Searching videos
----------------

[](#searching-videos)

**Search a channel**

This will gets 25 videos from the NBA channel with the query "Jordan" sorted by view count

```
$yt->setChannelId('UCWJ2lWNubArHWmf3FIHbfcQ');
$yt->getVideoSearch('Jordan', 'viewCount', 25);
```

**Search everywhere**

Just dont set channelId to search all of YouTube (Not a channel specific)

```
$yt->getVideoSearch('Jordan', 'viewCount', 25);
```

**Get latest videos from a channel**

Get 25 videos sorted by date published (recent -&gt; oldest)

```
$yt->setChannelId('UCWJ2lWNubArHWmf3FIHbfcQ');
$yt->getVideoSearch('', 'date', 25);
```

**Order types:**

- date
- rating
- relevance
- title
- videoCount
- viewCount

`results` amount is capped at max 50.

Video information
-----------------

[](#video-information)

```
$yt->setVideoId('1fjhIWJSxfw');
$yt->getVideoData();
```

Channel information
-------------------

[](#channel-information)

```
$yt->setChannelId('UCWJ2lWNubArHWmf3FIHbfcQ');
$yt->getChannelData();
```

Get channel playlists (Requires channelId to have been set):

```
$call->getChannelPlaylistsData(50);
```

Playlist videos
---------------

[](#playlist-videos)

```
$yt->setPlaylistId('UCWJ2lWNubArHWmf3FIHbfcQ');
$yt->getPlaylistsData();
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Unknown

Total

1

Last Release

1737d ago

### Community

Maintainers

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

---

Top Contributors

[![cp6](https://avatars.githubusercontent.com/u/9095402?v=4)](https://github.com/cp6 "cp6 (11 commits)")

---

Tags

youtubeyoutube-api

### Embed Badge

![Health badge](/badges/corbpie-yt-api/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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