A near-complete .NET wrapper for v3 of TMDb's API.
Install via NuGet:
dotnet add package TMDbLibOr for alpha packages from GitHub Packages, see the releases page.
Most of the library is self-explaining and closely follows the official TMDb API documentation.
Simple example, getting the basic info for "A Good Day to Die Hard":
using TMDbLib.Client;
var client = new TMDbClient("APIKey");
var movie = await client.GetMovieAsync(47964);
Console.WriteLine($"Movie name: {movie.Title}");Using the extra features of TMDb, you can fetch more info in one request (here we fetch credits and videos):
using TMDbLib.Client;
using TMDbLib.Objects.Movies;
var client = new TMDbClient("APIKey");
var movie = await client.GetMovieAsync(47964, MovieMethods.Credits | MovieMethods.Videos);
Console.WriteLine($"Movie title: {movie.Title}");
foreach (var cast in movie.Credits.Cast)
Console.WriteLine($"{cast.Name} - {cast.Character}");
Console.WriteLine();
foreach (var video in movie.Videos.Results)
Console.WriteLine($"Trailer: {video.Type} ({video.Site}), {video.Name}");Search for people or movies. This example searches for "007", yielding James Bond films:
using TMDbLib.Client;
using TMDbLib.Objects.General;
using TMDbLib.Objects.Search;
var client = new TMDbClient("APIKey");
var results = await client.SearchMovieAsync("007");
Console.WriteLine($"Got {results.Results.Count:N0} of {results.TotalResults:N0} results");
foreach (var result in results.Results)
Console.WriteLine(result.Title);TMDb groups related movies into collections (e.g., James Bond, Die Hard). Here's how to find and list a collection:
using TMDbLib.Client;
using TMDbLib.Objects.Collections;
using TMDbLib.Objects.General;
using TMDbLib.Objects.Search;
var client = new TMDbClient("APIKey");
var collections = await client.SearchCollectionAsync("James Bond");
Console.WriteLine($"Got {collections.Results.Count:N0} collections");
var jamesBond = await client.GetCollectionAsync(collections.Results.First().Id);
Console.WriteLine($"Collection: {jamesBond.Name}");
Console.WriteLine($"Got {jamesBond.Parts.Count:N0} James Bond movies");
foreach (var part in jamesBond.Parts)
Console.WriteLine(part.Title);- All methods are
asyncand awaitable - Most methods are straightforward and named accordingly:
GetMovieAsync,GetPersonAsync, etc. - Almost all method enums use
[Flags], allowing you to combine them:MovieMethods.Credits | MovieMethods.Videos - TMDb returns minimal data by default; most properties on classes like
Movieare null until you request extra data using the method enums