Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

An ActiveRecord-style API wrapper for - compatible with API v3.

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 ruby-tmdb.gemspec


ruby-tmdb is an ActiveRecord-style API wrapper for (TMDb). ruby-tmdb is designed to make common tasks like retrieving all movies that have a given actor in them and fetching image data much easier than they would be if dealing directly with the URL based API. ruby-tmdb also provides query caching to minimize duplicate remote API queries.


gem install ruby-tmdb


require 'rubygems'
require 'ruby-tmdb'

# setup your API key
Tmdb.api_key = "t478f8de5776c799de5a"

@movie = TmdbMovie.find(:title => "Iron Man", :limit => 1)
# => <TmdbMovie>
# => "Iron Man"

# => 12
# => [binary blob representing JPEG]
# => [<TmdbMovie>,<TmdbMovie>,<TmdbMovie>,<TmdbMovie>]

@actor = TmdbCast.find(:name => "Brad Pitt", :limit => 1)
# => <TmdbCast>

# => "Shawnee, Oklahoma, United States"

Find all movies whose titles match a given string

@movies = TmdbMovie.find(:title => 'Iron Man')

Find the movie most likely to be associated with a given title

@movie = TmdbMovie.find(:title => 'Sin City', :limit => 1)

Find a single movie by it's TMDb ID

@movie = TmdbMovie.find(:id => 187)

Find a single movie by it's IMDB ID

@movie = TmdbMovie.find(:imdb => 'tt0401792')

Author & Credits


Aaron Gough

Copyright © 2010 Aaron Gough (, released under the MIT license

Something went wrong with that request. Please try again.