TMDB API
The Movie Database — free, rich data on movies, TV shows and people.
What it does
The TMDB (The Movie Database) API provides metadata for movies, TV shows and people: search and discovery, full details, credits, images and posters, videos/trailers, watch-provider availability, trending lists and user ratings. It is the most popular free film data source.
Base URL
Authentication
Create a free account and request an API key. Use either the v3 key as ?api_key=YOUR_KEY or the v4 read access token as Authorization: Bearer YOUR_TOKEN. Images load from https://image.tmdb.org/t/p/<size>/<path>.
Code examples
curl -s "https://api.themoviedb.org/3/search/movie?query=dune&api_key=$TMDB_KEY"
import requests
H = {"Authorization": f"Bearer {V4_TOKEN}"}
r = requests.get("https://api.themoviedb.org/3/movie/693134",
headers=H, params={"append_to_response": "credits,videos"}, timeout=10)
m = r.json()
print(m["title"], m["release_date"], m["vote_average"])Rate limits & quotas
TMDB removed its old hard 40-requests/10-seconds cap; in practice it tolerates around 50 requests/second before returning HTTP 429 with Retry-After. Use append_to_response to combine sub-resources into one call. Attribution (“This product uses the TMDB API but is not endorsed or certified by TMDB”) is required.
Key response fields
| results[].id | TMDB ID — use it for the details endpoint |
| title / name | title for movies, name for TV |
| poster_path / backdrop_path | Append to the image base URL with a size |
| vote_average / vote_count | User rating out of 10 |
| genres / credits.cast | With append_to_response |
Common errors
| 401 | Missing or invalid key/token. |
| 404 | Unknown ID — search first to get valid IDs. |
| 429 | Too many requests — honour Retry-After. |
| (broken images) | You used a bare poster_path without the image base URL and a size. |
When to use it (and alternatives)
The default for film and TV apps — broad coverage, images, trailers and watch providers, all free. For episode-level TV schedules TVMaze is handy; for IMDb-style ratings by title OMDb is simpler; for user watch-history Trakt.
FAQ
Is the TMDB API really free?
Yes, for non-commercial and many commercial uses, with attribution. High-volume commercial users are asked to contact TMDB, but there is no paywall for normal apps.
How do I build a poster URL?
https://image.tmdb.org/t/p/w500 + the poster_path (which already starts with /). Sizes include w92, w342, w500, original.
How do I get cast and trailers without extra calls?
Add append_to_response=credits,videos,images to the movie/TV details request and TMDB bundles them into the one response.
New to APIs?
Short guides for working with this API — and any other.