wrapper for api v3
Latest commit 5fe481b Aug 25, 2016 @doganaydin committed on GitHub Merge pull request #30 from rjohnson31/patch-1

Hi, I started to write tmdb from scratch. It's easier that way, and it supports API v3. wrapper for api v3


$ pip install requests fuzzywuzzy
$ sudo python install
# Alternatively, for Python 3:
$ sudo python3 install


First, you need to get an API key from TMDB (you'll need a user account for that). Then, assuming that api_key is a string containing your API key:

import tmdb
# Search for movie titles containing "Alien"
movies = tmdb.Movies("Alien")
for movie in movies.iter_results():
    # Pick the movie whose title is exactly "Alien"
    if movie["title"] == "Alien":
        # Create a Movie object, fetching details about it
        movie = tmdb.Movie(movie["id"])
# Access the fetched information about the movie
movie.get_tagline() # or other methods...

For a complete list of methods currently available in Movie objects, type help(tmdb.Movie) on the Python prompt.

If movie search hangs for too long, use limit=True: movies = tmdb.Movies("matrix", limit=True). Now movie search only returns the first page of results.

User Authentication

In order to modify a movie on TMDB, you'll need to authenticate first:

import tmdb
auth = tmdb.Core()
rt = auth.request_token()
# Now you can for instance rate the movie


Thomas @tloiret

Martin Lenders @authmillenon

lad1337 @lad1337

George Dorn @georgedorn

Farrin Reid @blakmatrix

Benoît Knecht @BenoitKnecht

Alan Justino da Silva @alanjds

Dustin Wyatt @therms