Get started with themoviedb-javascript-library CDN

MIT licensed

Lightweight API client: Accesses TMDb via JS for movie/TV details, search, and discovery.

Tags:
  • RESTful
  • MovieDB

Stable version

Copied!

How to start using themoviedb-javascript-library CDN


// Import the library
const Tmdb = require('themoviedb-javascript-library');

// Initialize the library with your API key
const tmdb = new Tmdb('YOUR_API_KEY');

// Fetch movie details by ID
async function getMovieDetails(movieId) {
  try {
    const movie = await tmdb.movie.details(movieId);
    console.log('Movie details:', movie);
  } catch (error) {
    console.error('Error fetching movie details:', error);
  }
}

// Call the function with a movie ID
getMovieDetails(12345678); // Replace with a valid movie ID
Copied!
Copied!
Copied!

All versions