Skip to content API v2 Client
Branch: develop
Clone or download
Latest commit 8f059fd May 5, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/Adrenth/Thetvdb Optimize imports May 5, 2019
.gitignore Code improvements Oct 29, 2018 Code improvements Oct 29, 2018
LICENSE Update basic package information Feb 25, 2016 Drop PHP 5.6 and add PHP 7.1 support Jun 6, 2017
composer.json Upgrade application dependencies May 5, 2019
phpunit.xml.dist Fix tests May 16, 2016


This is an API client for the website. It's using the RESTful API which you'll need to register for to use this package.

API Key Registration

To use this PHP package, you need to request an API Key from the website:

Please follow these guidelines:

  • If you will be using the API information in a commercial product or website, you must email and wait for authorization before using the API. However, you MAY use the API for development and testing before a public release.
  • If you have a publicly available program, you MUST inform your users of this website and request that they help contribute information and artwork if possible.
  • You MUST familiarize yourself with our data structure, which is detailed in the wiki documentation.
  • You MUST NOT perform more requests than are necessary for each user. This means no downloading all of our content (we'll provide the database if you need it). Play nice with our server.
  • You MUST NOT directly access our data without using the documented API methods.
  • You MUST keep the email address in your account information current and accurate in case we need to contact you regarding your key (we hate spam as much as anyone, so we'll never release your email address to anyone else).
  • Please feel free to contact us and request changes to our site and/or API. We'll happily consider all reasonable suggestions.



Install this package using composer:

$ composer require adrenth/thetvdb2


At least PHP 7.1


The official API documentation can be found here:


$client = new \Adrenth\Thetvdb\Client();

// Obtain a token
$token = $client->authentication()->login($apiKey, $username, $userKey);

// Or refresh token


The Client has a few extensions. A few usage examples are listed below:


$client->authentication()->login($apiKey, $username, $userKey);




// ..


// ..


// ..


Fetch a list of Series that have been recently updated:

$client->updates()->query($fromTime, $toTime);


$client->users()->addRating($type, $itemId, $rating);
$client->users()->updateRating($type, $itemId, $rating);
$client->users()->removeRating($type, $itemId);


Response data

Every response object has a getData() method which may contain a collection of objects.

For example:

// Get all available languages
$languageData = $client->languages()->all(); // Returns a LanguageData instance
$languages = $languageData->getData()->all();

array:23 [▼
  0 => Language {#26 ▼
    -values: array:4 [▼
      "id" => 27
      "abbreviation" => "zh"
      "name" => "中文"
      "englishName" => "Chinese"
  1 => Language {#19 ▶}
  2 => Language {#30 ▶}
  3 => Language {#21 ▶}
  // ..


This is version 2.0 of the API client. Feel free to join us and create a stable version which is compatible with the brand new RESTful API.

You can’t perform that action at this time.