PHPTVDB is a PHP library for accessing TV show information such as episodes, actors, showtimes and descriptions.
Latest commit 26f33df Oct 25, 2016 @Moinax Moinax Merge pull request #39 from Xantios/master
Added a Filter function
Failed to load latest commit information.
examples Add support for ZIP download Nov 21, 2014
src/Moinax/TvDb Added a Filter function Oct 24, 2016
.gitignore Adding composer.json Aug 11, 2013 Add Gitter badge Oct 9, 2015
composer.json Adding composer.json Aug 11, 2013


Join the chat at

Based on the well known php library phptvdb (available on, this version has been completely refactored to offer more features from the tvdb api (available on by using PHP 5.3 namespaces, very useful to import in a bigger project like Symfony 2 for example.

What does it do:

The Client implements almost all api functions from thetvdb excepted the download in ZIP format


use Moinax\TvDb\Client;
$apiKey = 'YOURAPIKEY';

$tvdb = new Client("", $apiKey);

Cache usage:

To save bandwidth, reduce latency, or both of two, you can use a Http Client with caching features. The HTTP client use the If-Modified-Since header to fetch full content only if resource was modified. This saves bandwidth. The HTTP client also use a time to live parameter to completly avoid making request if resource was fresh enough. This reduce latency.

use Moinax\TvDb\Http\Cache\FilesystemCache;
use Moinax\TvDb\Http\CacheClient;
use Moinax\TvDb\Client;

$ttl = 600; # how long things should get cached, in seconds.
$apiKey = 'YOURAPIKEY';

$cache = new FilesystemCache(__DIR__ . '/cache');
$httpClient = new CacheClient($cache, $ttl);

$tvdb = new Client("", $apiKey);

$tvdb->getSerie(75710); //This request will fetch the resource online.
$tvdb->getSerie(75710); //Cache content is fresh enough. We don't make any request.
$tvdb->getSerie(75710); //The content is not fresh enough. We make a request with
                        //the If-Modified-Since header. The server respond 304 Not
                        //modified, so we load content from the cache.


Use the index.php to test the Api Rename the settings.php.dist in settings.php if you wan to test and enter your own API key provided by


This version is quite stable and used in production on