TMDB (The Movie Database)
api.themoviedb.org · Media
Comprehensive movie and TV data — titles, cast, crew, ratings, posters, trailers, and trending content. 900,000+ movies, 150,000+ TV shows. Free API key, generous rate limits.
Authentication
Sample Requests
Search for movies by title.
Hover any highlighted part to learn what it does
| Authorization | Bearer YOUR_TOKEN |
curl -X GET "https://api.themoviedb.org/3/search/movie?query=Inception" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
params = {
"query": "Inception"
}
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
response = requests.get(
"https://api.themoviedb.org/3/search/movie",
params=params,
headers=headers,
)
print(response.json())const url = new URL('https://api.themoviedb.org/3/search/movie');
url.searchParams.set('query', 'Inception');
const response = await fetch(url, {
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
},
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.themoviedb.org/3/search/movie")
q := baseURL.Query()
q.Set("query", "Inception")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.themoviedb.org/3/search/movie")
uri.query = URI.encode_www_form({
"query" => "Inception"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer YOUR_ACCESS_TOKEN"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.themoviedb.org/3/search/movie?" . http_build_query([
"query" => "Inception"
]);
$opts = ["http" => [
"method" => "GET",
"header" => implode("\r\n", [
"Authorization: Bearer YOUR_ACCESS_TOKEN"
]),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Get this week's trending movies.
Hover any highlighted part to learn what it does
| Authorization | Bearer YOUR_TOKEN |
curl -X GET "https://api.themoviedb.org/3/trending/movie/week" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
response = requests.get(
"https://api.themoviedb.org/3/trending/movie/week",
headers=headers,
)
print(response.json())const url = 'https://api.themoviedb.org/3/trending/movie/week';
const response = await fetch(url, {
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
},
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://api.themoviedb.org/3/trending/movie/week"
req, _ := http.NewRequest("GET", targetURL, nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.themoviedb.org/3/trending/movie/week")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer YOUR_ACCESS_TOKEN"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.themoviedb.org/3/trending/movie/week";
$opts = ["http" => [
"method" => "GET",
"header" => implode("\r\n", [
"Authorization: Bearer YOUR_ACCESS_TOKEN"
]),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Get full details for Fight Club (id=550) including cast and trailers.
Hover any highlighted part to learn what it does
| Authorization | Bearer YOUR_TOKEN |
curl -X GET "https://api.themoviedb.org/3/movie/550?append_to_response=credits%2Cvideos" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
params = {
"append_to_response": "credits,videos"
}
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
response = requests.get(
"https://api.themoviedb.org/3/movie/550",
params=params,
headers=headers,
)
print(response.json())const url = new URL('https://api.themoviedb.org/3/movie/550');
url.searchParams.set('append_to_response', 'credits,videos');
const response = await fetch(url, {
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
},
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.themoviedb.org/3/movie/550")
q := baseURL.Query()
q.Set("append_to_response", "credits,videos")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.themoviedb.org/3/movie/550")
uri.query = URI.encode_www_form({
"append_to_response" => "credits,videos"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer YOUR_ACCESS_TOKEN"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.themoviedb.org/3/movie/550?" . http_build_query([
"append_to_response" => "credits,videos"
]);
$opts = ["http" => [
"method" => "GET",
"header" => implode("\r\n", [
"Authorization: Bearer YOUR_ACCESS_TOKEN"
]),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- Create a free account at themoviedb.org
- Go to Settings → API → generate an API Read Access Token
- Set Authorization: Bearer YOUR_TOKEN header
- Try GET https://api.themoviedb.org/3/trending/movie/week
- Images: prefix poster_path with https://image.tmdb.org/t/p/w500
What can you build with TMDB (The Movie Database)?
TMDB (The Movie Database) is a Media API. Developers commonly use media APIs for:
- storing and delivering images, video, and audio
- building digital asset management and media libraries
- transcoding and optimising media for the web
- adding video streaming and playback to your app
- automating content tagging and metadata extraction
Bearer token. Your app exchanges credentials for a short-lived token, then sends it as an Authorization header. Tokens expire, so your code needs to handle renewal. TMDB (The Movie Database) is free to use up to a usage limit, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide