🍿 @lorenzopant/tmdb

Movies

Get trending movies on TMDB for a given time window.

Get the trending movies on TMDB. Each result item includes the media_type: "movie" discriminator.

async movies(params: TrendingParams): Promise<PaginatedResponse<TrendingMovieResult>>

TMDB Reference: Trending Movies

Parameters

NameTypeRequiredDescription
time_windowTrendingTimeWindowTime window for trending data. "day" covers the last 24 hours, "week" covers the last 7 days.
languageLanguageLanguage for localized results. Defaults to en-US.

Returns

A PaginatedResponse<TrendingMovieResult> containing an array of TrendingMovieResult objects.

Example

import { TMDB } from "@lorenzopant/tmdb";

const tmdb = new TMDB("your-api-key");
const { results } = await tmdb.trending.movies({ time_window: "week", language: "en-US" });
console.log(results[0].title); // "The Super Mario Bros. Movie"
console.log(results[0].media_type); // "movie"

On this page