PHPackages                             realshadow/redtube-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. realshadow/redtube-api

ActiveLibrary[API Development](/categories/api)

realshadow/redtube-api
======================

PHP based API wrapper for Redtube HTTP API

1.0.2(8y ago)61064[1 issues](https://github.com/realshadow/redtube-api/issues)[1 PRs](https://github.com/realshadow/redtube-api/pulls)MITPHPPHP ^5.6.0 || ^7.0

Since Jul 7Pushed 4y ago2 watchersCompare

[ Source](https://github.com/realshadow/redtube-api)[ Packagist](https://packagist.org/packages/realshadow/redtube-api)[ RSS](/packages/realshadow-redtube-api/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/240a2c5f48bed4dcbea047a7cec032e6c1533b4080bf108bae504baa74bca8bf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7265616c736861646f772f726564747562652d6170692f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/realshadow/redtube-api/?branch=master)[![Build Status](https://camo.githubusercontent.com/132cd83f465f94fa077ff4c8b41e9713012cac5b05f0c1658cd528c4a9062f60/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7265616c736861646f772f726564747562652d6170692f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/realshadow/redtube-api/build-status/master)

Redtube API
===========

[](#redtube-api)

PHP based API wrapper for [Redtube HTTP API](http://api.redtube.com/docs) .

All methods except `getStarDetailedList` are supported. This method at the time of writing always ends with an *There are no stars!* error.

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

[](#installation)

```
composer require realshadow/redtube-api

```

Usage
-----

[](#usage)

Every method returns either a concrete object representing the response or collection of objects. Methods used for filtering videos return a `Paginator` object which contains all videos and basic informating about paging (current page, total count, last page, etc.).

```
// Create new API client (default host points to https://api.redtube.com)
$redtube = new \Realshadow\Redtube\Redtube;

/**
 * Get all categories
 *
 * @return Collection
 */
$redtube->categories->getAll();

/**
 * Get all stars
 *
 * @return Collection
 */
$redtube->stars->getAll();

/**
 * Get all tags
 *
 * @return Collection
 */
$redtube->tags->getAll();

/**
 * Find videos
 *
 * @return Paginator
 */
$redtube->videos->findBy($filter);

/**
 * Find video by its ID
 *
 * @return Video
 */
$redtube->videos->findById($id);

/**
 * Find out if a video is active
 *
 * @return bool
 */
$redtube->videos->isActive($id);

/**
 * Get embed code of a video
 *
 * @return string
 */
$redtube->videos->getEmbedCode($id);

/**
 * Find deleted videos
 *
 * @return Paginator
 */
$redtube->videos->findDeletedBy($filter);

```

### Video filter

[](#video-filter)

Videos can be filtered by using the `VideoFilter` class which provides fluent interface. You can use one of three enumerators to ease filtering - `Period`, `OrderBy`, `Thumbsize`.

**Note:** Redtube does not use traditional *limit/offset* queries but filtering by **page**. Each page contains 20 results.

For example

```
$filter = VideoFilter::create()
    ->page(1)
    ->search('lesbian')
    ->tags(['blonde'])
    ->stars(['Jenna Jameson'])
    ->thumbsize(Thumbsize::BIG)
    ->period(Period::ALL_TIME)
    ->orderBy(OrderBy::RATING);

$videos = $redtube->videos->findBy($filter);

```

### Get all active / deleted videos

[](#get-all-active--deleted-videos)

If you want to retrieve more than one page (more than 20 videos) at once you can use these methods

```
/**
 * Find all videos up to 10th page
 *
 * @return Generator
 */
$redtube->videos->findAllBy($filter, 10);

/**
 * Find deleted videos up to the 10th page
 *
 * @return Generator
 */
$redtube->videos->findAllDeletedBy($filter, 10);

```

Both methods return a [generator](http://php.net/manual/en/language.generators.overview.php) after each page is requested to ease memory allocation. So the full usage example would be

```
foreach ($redtube->videos->findAllBy($filter, 10) as $videos) {
    /** @var Illuminate\Support\Collection $videos */

    $videos->each(function (Video $video) {
        // rest of the code
    });
}

```

### Exceptions

[](#exceptions)

All of the error codes listed in documentation are transformed into PHP exceptions by using this mapping

- error code *1001* =&gt; `NoSuchMethodException`
- error code *1002* =&gt; `NoSuchDataProviderException`
- error code *1003* =&gt; `NoInputParametersSpecifiedException`
- rest of the error codes will use `NotFoundException` with appropiate message

For example

```
try {
    $videos = $redtube->videos->findBy($filter);
} catch (NotFoundException $e) {

}

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~75 days

Total

3

Last Release

3129d ago

### Community

Maintainers

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

---

Top Contributors

[![realshadow](https://avatars.githubusercontent.com/u/6673222?v=4)](https://github.com/realshadow "realshadow (10 commits)")

---

Tags

apiapi-clientapi-wrapperphpredtube

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/realshadow-redtube-api/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[netflie/whatsapp-cloud-api

The first PHP SDK to send and receive messages using a cloud-hosted version of the WhatsApp Business Platform

666500.1k5](/packages/netflie-whatsapp-cloud-api)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.1k1](/packages/jasara-php-amzn-selling-partner-api)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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