🍿 @lorenzopant/tmdb

API Reference

This section lists all the available methods in @lorenzopant/tmdb

@lorenzopant/tmdb exposes the full TMDB API surface through a set of focused, typed client classes. You can use them in two ways: through the unified TMDB client, or as standalone classes when you only need a specific subset of functionality.

Using the unified client

The TMDB class bundles all APIs under a single instance. This is the recommended approach for most use cases.

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

const tmdb = new TMDB("your-api-key", {
	language: "en-US",
	region: "US",
});

// Access any API namespace directly
const popular = await tmdb.movies.popular();
const trending = await tmdb.tv_series.trending("day");
const results = await tmdb.search.movie({ query: "Inception" });

Using standalone API classes

Each API is also available as a standalone class — useful when you want to tree-shake or only import what you need.

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

const moviesApi = new MoviesAPI("your-api-key", {
	language: "it-IT",
	region: "IT",
});

const popular = await moviesApi.popular();
const details = await moviesApi.details(550);
import { SearchAPI } from "@lorenzopant/tmdb";

const searchApi = new SearchAPI("your-api-key");
const results = await searchApi.movie({ query: "The Godfather" });
import { TVSeriesAPI } from "@lorenzopant/tmdb";

const tvApi = new TVSeriesAPI("your-api-key", {
	language: "ja-JP",
	timezone: "Asia/Tokyo",
});

const airingToday = await tvApi.airingToday();

Available APIs

APIUnified client accessorStandalone classDescription
Authenticationtmdb.authenticationAuthenticationAPIManage v3 user sessions — create request tokens, exchange them for session IDs, and log users out.
Accounttmdb.accountAccountAPIManage account favorites, watchlists, ratings, and custom lists.
Discovertmdb.discoverDiscoverAPIDiscover movies and TV series with advanced TMDB filters, sorting, and pagination.
Findtmdb.findFindAPIFind movies, TV shows, seasons, episodes, and people by external IDs.
Watch Providerstmdb.watch_providersWatchProvidersAPIRetrieve movie/TV provider catalogs and supported watch-provider regions.
Keywordstmdb.keywordsKeywordsAPIRetrieve keyword details and the associated movie list by TMDB keyword ID.
Companiestmdb.companiesCompaniesAPIGet company details, alternative names, and logos for production companies.
Creditstmdb.creditsCreditsAPIGet credit details for a movie or tv show.
Networkstmdb.networksNetworksAPIGet TV network details, alternative names, and logos by TMDB network ID.
Configurationtmdb.configurationConfigurationAPIRetrieve system-level configuration such as image base URLs and languages.
Genrestmdb.genresGenresAPIFetch the list of official movie and TV series genres.
Movie Liststmdb.movieListsMovieListsAPIAccess curated movie lists: popular, top rated, now playing, and upcoming.
Moviestmdb.moviesMoviesAPIGet movie details, credits, images, videos, recommendations, and more.
Peopletmdb.peoplePeopleAPIGet person details, credits, images, translations, and external IDs.
People Liststmdb.people_listsPeopleListsAPIGet curated lists of people ordered by popularity.
Searchtmdb.searchSearchAPISearch for movies, TV series, people, and keywords across the TMDB catalog.
Trendingtmdb.trendingTrendingAPIGet trending movies, TV series, and people on TMDB.
Reviewstmdb.reviewsReviewsAPIGet the full details of a single TMDB review by its review ID.
TV Seriestmdb.tv_seriesTVSeriesAPIGet TV series details, episodes, seasons, credits, and recommendations.
TV Episode Groupstmdb.tv_episode_groupsTVEpisodeGroupsAPIGet episode group details by group ID.
TV Episodestmdb.tv_episodesTVEpisodesAPIGet TV episode details, credits, images, translations, and videos.
TV Seasonstmdb.tv_seasonsTVSeasonsAPIGet TV season details, credits, images, videos, translations, and watch providers.
TV Series Liststmdb.tv_series_listsTVSeriesListsAPIAccess curated TV series lists: popular, top rated, airing today, and on the air.

API V4

The TMDB v4 API is available under the tmdb.v4 namespace. It provides methods for user authentication and account management.

APIUnified client accessorStandalone classDescription
Authtmdb.v4.authV4AuthAPITMDB v4 OAuth-style authentication — create request tokens, exchange them for access tokens, and log users out.

Constructor signature

All standalone API classes share the same constructor signature:

new SomeAPI(apiKey: string, options?: TMDBOptions)
ParameterTypeDescription
apiKeystringYour TMDB API key.
optionsTMDBOptionsOptional default values for language, region, timezone and images.

See the Options reference for the full list of available configuration options.

On this page