Skip to main content

A Python wrapper for TMDb API

Project description

logo yelp


pytest Code style: black all-contributors PyPI - License PyPI - Python Version PyPI Downloads

A Python wrapper for TMDb API, supporting version 3 and 4


From PyPi

pip install ezapi-tmdb

From GitHub

pip install git+


  1. All endpoints are mapped to functions in a TMDb object
  2. All query string params are used as keyword arguments

Version 3 Example

See Version 3 documents for detailed API usage.

from tmdb import TMDb3

api_key = "..."

tmdb = TMDb3(api_key)

# query string params are used as keyword arguments

# create session_id with username/password login
username = "..."
password = "..."
request_token = tmdb.create_request_token().get("request_token")
tmdb.create_session_with_login(username, password, request_token)
session_id = tmdb.create_session(request_token).get("session_id")

# some endpoints require session_id

# store global options, language / region for example
tmdb.set_options(language="de", region="de")
tmdb.get_trending("all", "week")

# reset global options

# configure image languages globally
tmdb.set_options(include_image_language=["en", "null"])

# url param per request would overwrite global options
tmdb.get_movie_images(597, include_image_language=["de", "fr"])

Version 4 Example

See Version 4 documents for detailed API usage.

from tmdb import TMDb4

# API Read Access Token from the settings page
access_token = "..."

tmdb = TMDb4(access_token)

# create a user access token
request_token = tmdb.create_request_token().get("request_token")

# click on the link above, sign in, then approve access
resp = tmdb.create_access_token(request_token)

# extract the user access token and account id for v4 api
user_access_token = resp.get("access_token")
account_id = resp.get("account_id")




git clone
export api_key="..."
export username="..."
export password="..."
export access_token="..."
cd ezapi-tmdb
python test

Use $Env:api_key="..." , $Env:username="...", $Env:password="...", and $Env:access_token="..." to set the api key, username, password, and access token environment variables on Windows.


Contributors ✨

Thanks goes to these wonderful people (emoji key):



Rafael Pierre


This project follows the all-contributors specification. Contributions of any kind welcome!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ezapi-tmdb-0.8.2.tar.gz (17.2 kB view hashes)

Uploaded source

Built Distribution

ezapi_tmdb-0.8.2-py3-none-any.whl (20.0 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page