Skip to content


Subversion checkout URL

You can clone with
Download ZIP
This is a Ruby API for trakt, a TV show and movie recommendation service.
Branch: master
Failed to load latest commit information.
lib add genres file
spec don't need this
.gitignore first checkin
Gemfile first checkin
LICENSE.txt first checkin
README.rdoc update readme to indicate additional doc
Rakefile add genres
trakt.gemspec speed more tests up



This is a Ruby API for the movie, tvshow service.


Add this line to your application's Gemfile:

gem 'trakt'

And then execute:

$ bundle

Or install it yourself as:

$ gem install trakt


All calls return an JSON structure.

This is a typical default setup

require 'trakt'
trakt =
trakt.apikey = 'your_api_key'
trakt.username = 'your_username'
trakt.password = 'your_password'



Searching "the shawshank redemption" "death note"

And wait, there's more!

Check the spec directory for the rest of the functionality and how to use it. I got lazy with documentation it seems.


Adding all your seen movies from a text file.

Adding movies from a text file is a bit hit and miss, so it's best if you create a list to add the movies to. You'll have to make a list manually in advance since creation isn't supported yet. The list takes a rather odd name. The one in the exaple here was created as “From my file”.

list = trakt.list.add('from-my-file');
IO.readlines(ENV['HOME']+"/misc/movies.txt").each do |movie|
  result =
  next unless result
  movie = result.first
  next unless movie
  list.add_item(type: :movie, imdb_id: movie['imdb_id'])

Marking shows unseen

Example making all episodes of season 4 of winnie the pooh unseen. (You can use Trakt::Search.shows(“the new adventures of winnie the pooh”).first to get the imdb_id)

episodes = []
1.upto(11) { |n|
  episodes << { "season" =>  4, "episode" => n }
Trakt::Show.episode_unseen("imdb_id" => "tt0165052", episodes: episodes)


  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 new Pull Request

Something went wrong with that request. Please try again.