MovieDB

MovieDB

Media

The Movie Database (TMDb) is a community built movie and TV database. Every piece of data has been added by our amazing community dating back to 2008. The API service is for those of you interested in using our movie, TV show or actor images and/or data in your application. Our API is a system we provide for you and your team to programmatically fetch and use our data and/or images.

Visit API🔁 Alternatives

🔑 How to get a free TMDB API key

The Movie Database (TMDB) issues free API keys through your account settings — approval is essentially instant for developer use.

  1. Create a TMDB account. Sign up free at themoviedb.org/signup.
  2. Open API settings. Go to Settings → API (themoviedb.org/settings/api) and click to request a developer key.
  3. Fill in the application form. Accept the terms and describe your app — personal/developer requests are approved immediately.
  4. Use your key or access token. Use the v3 key as api_key=YOUR_KEY, or the v4 Read Access Token as a Bearer header against https://api.themoviedb.org/3/.
Get your TMDB key →

📚 Documentation & Examples

Everything you need to integrate with MovieDB

🚀 Quick Start Examples

MovieDB Javascript Examplejavascript
// MovieDB API Example
const response = await fetch('https://www.themoviedb.org/documentation/api', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Exploring The Movie Database API

Are you interested in building an application that fetches movie information? Well, The Movie Database API provides a wealth of information on movies, TV series, and more. In this blog, we will explore how to use The Movie Database API with JavaScript.

API Documentation

The Movie Database API documentation can be found at https://www.themoviedb.org/documentation/api. You will first need to create an account to get an API key to use their services. Once you have your API key, you can start accessing the data.

How to Get a TMDB API Key

The Movie Database (TMDB) issues API keys free to registered users.

  1. Create a free account at themoviedb.org/signup and verify your email.
  2. Open Settings → API. Use a desktop browser — the registration flow isn't mobile-optimized.
  3. Click Request an API key, choose Developer, and accept the terms.
  4. Fill in the short application form (app name, URL, summary). The key is issued instantly.

Your API page shows two credentials: the API Key (v3 auth) and the API Read Access Token (v4 auth).

For v3 endpoints, pass the key as the api_key query parameter:

https://api.themoviedb.org/3/search/movie?api_key=YOUR_API_KEY&query=inception

For v4, send the read token as a Bearer header: Authorization: Bearer YOUR_READ_ACCESS_TOKEN.

API Endpoints

The API endpoints we will be covering in this blog include:

  • Search Movies: This endpoint returns a list of movies that match your search query.
  • Movie Details: This endpoint returns the full details of a movie.
  • Movie Credits: This endpoint returns the credits (cast and crew) of a movie.

Example Code

To get started, let's create a JavaScript function that searches for a movie and returns a list of results.

async function searchMovie(query) {
  const api_key = 'YOUR_API_KEY';
  const url = `https://api.themoviedb.org/3/search/movie?api_key=${api_key}&query=${query}`;
  const response = await fetch(url);
  const data = await response.json();
  return data.results;
}

In the above code, we are using the fetch method to make a GET request to The Movie Database API endpoint. We are passing in our api_key and the query parameter that we want to search for. Once we get a response, we are converting it to JSON format and returning the list of results.

Let's say we want to view the details of a movie. We can create another JavaScript function that uses the movie's ID to fetch the details of the movie.

async function getMovieDetails(movieId) {
  const api_key = 'YOUR_API_KEY';
  const url = `https://api.themoviedb.org/3/movie/${movieId}?api_key=${api_key}`;
  const response = await fetch(url);
  const data = await response.json();
  return data;
}

In this code, we are using the movieId parameter to make a GET request to the Movie Details endpoint. Once we get a response, we are returning the data in JSON format.

Lastly, let's create a JavaScript function that fetches the credits of a movie using the movie's ID.

async function getMovieCredits(movieId) {
  const api_key = 'YOUR_API_KEY';
  const url = `https://api.themoviedb.org/3/movie/${movieId}/credits?api_key=${api_key}`;
  const response = await fetch(url);
  const data = await response.json();
  return data.cast;
}

Here, we are using the movieId parameter to make a GET request to the Movie Credits endpoint. Once we get a response, we are returning the cast details in JSON format.

That's it! With these functions, you can get started on building your movie application. You can combine these functions to search for a movie and get its details and credits.

Happy coding!

❓ Frequently Asked Questions

Is the TMDB API free?

Yes — free for non-commercial use with attribution ("This product uses the TMDB API but is not endorsed or certified by TMDB"). Commercial use requires contacting TMDB for a licence.

What are the TMDB API rate limits?

TMDB removed its old hard 40-requests/10-seconds limit; there is generous soft limiting (~50 req/s). Cache responses and you're unlikely to hit it.

Is TMDB a good alternative to the IMDb API?

Yes — IMDb has no free public API, so TMDB (or OMDb) is the standard free choice for movie metadata, posters, ratings, and TV data.

Explore More

Best MovieDB alternatives (2026)Best Media APIsHow to Use MovieDB API with PythonHow to Use MovieDB API with JavaScriptHow to Use MovieDB API with Node.js

Related APIs in Media