🍿 @lorenzopant/tmdb

Multi

Search for movies, TV shows, and people in a single request.

Search for movies, TV shows, and people in a single request. Each result includes a media_type field ("movie", "tv", or "person") so you can distinguish between entity types.

async multi(params: SearchMultiParams): Promise<PaginatedResponse<MultiSearchResultItem>>

TMDB Reference: Search Multi

Parameters

NameTypeRequiredDescription
querystringSearch query text.
include_adultbooleanInclude adult (18+) content in results. Defaults to false.
languageLanguageLanguage for localized results. Defaults to en-US.
pagenumberPage number for paginated results. Defaults to 1.

Returns

A PaginatedResponse<MultiSearchResultItem> containing an array of MultiSearchResultItem objects — a discriminated union on media_type.

Example

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

const tmdb = new TMDB("your-api-key");
const { results } = await tmdb.search.multi({ query: "Nolan" });

for (const item of results) {
	if (item.media_type === "movie") {
		console.log("Movie:", item.title);
	} else if (item.media_type === "tv") {
		console.log("TV Show:", item.name);
	} else if (item.media_type === "person") {
		console.log("Person:", item.name);
	}
}

Types

On this page