TheTvDbParty Gem Version

The thetvdb_party gem accesses the TheTvDB programmers API as it is described on

It uses compression to minimize bandwith when accessing Full Series Records.


Add this line to your application's Gemfile:

gem 'thetvdb_party'

And then execute:

$ bundle

Or install it yourself as:

$ gem install thetvdb_party


Creating a TheTvDb API client

To create a new client without an api key:

client =

Or with an api key:

client = "<your api key>"

It is recommended to use an .env file or environment variable to store the API key. For example like this:

Contents of .env


Performing searches

Once you have a client instance, you can perform searches against the TheTvDb API. The following example searches for The Mentalist on TheTvDb.

results = "The Mentalist"

The #search method of the client returns an array containing the search results. Iterate over this array to get the Base Series Record of the search results.

results.each do |search_result_record|
  base_series_record = search_result_record.get_base_series_record


  1. Fork it ( )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request