TMDbLib 3.0.0

dotnet add package TMDbLib --version 3.0.0
                    
NuGet\Install-Package TMDbLib -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.

                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.

                    
Directory.Packages.props

                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TMDbLib --version 3.0.0
                    
#r "nuget: TMDbLib, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TMDbLib@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TMDbLib&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=TMDbLib&version=3.0.0
                    
Install as a Cake Tool

TMDbLib

Build NuGet GitHub Packages

A near-complete .NET wrapper for v3 of TMDb's API.

Table of Contents

Installation

Install via NuGet:

dotnet add package TMDbLib

Or for alpha packages from GitHub Packages, see the releases page.

Documentation

Most of the library is self-explaining and closely follows the official TMDb API documentation.

Examples

Basic Usage

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}");

Fetching Additional Data

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}");

Searching for Movies

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);

Working with Collections

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);

Tips

  • All methods are async and 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 Movie are null until you request extra data using the method enums
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TMDbLib:

Package Downloads
WyyLib.PublicStandardLib

自己使用的一些公共库

GitHub repositories (10)

Showing the top 10 popular GitHub repositories that depend on TMDbLib:

Repository Stars
jellyfin/jellyfin
The Free Software Media System - Server Backend & API
cxfksword/jellyfin-plugin-metashark
jellyfin电影元数据插件
ShokoAnime/ShokoServer
Shoko is a media metadata aggregator that solves all of the annoying edge cases that face anime's differing structure from western media. It integrates directly with media software rather than working around things like nfo files or naming conventions.
TV-Rename/tvrename
Organise your TV & Movie videos with ease
mregni/EmbyStat
Multiplatform statistics server for Emby server
kaybi-gh/K7
Self-hosted media server for a small circle of family and friends.
crobibero/jellyfin-plugin-tmdb-trailers
vesoapp/veso
Open source media server.
SubtitleEdit/plugins
Plugins for Subtitle Edit
DineshSolanki/FoliCon
Automated Movie, TV Show, Game, Anime & Music Folder Icon Customizer with IMDb/TMDB ratings (WinGet & Chocolatey supported)
Version Downloads Last Updated
3.0.0 158,366 1/25/2026
2.3.0 80,002 9/15/2025
2.2.0 157,036 3/11/2024
2.1.0 31,588 12/3/2023
2.0.0 66,899 1/9/2023
1.9.2 80,550 4/27/2022
1.9.1 26,697 1/19/2022
1.8.1 47,998 4/6/2021
1.8.0 1,288 4/5/2021
1.7.6-alpha 1,156 2/27/2021
1.7.5-alpha 1,848 1/14/2021
1.7.4-alpha 1,069 1/11/2021
1.7.3-alpha 49,710 10/3/2020
1.7.2-alpha 1,244 10/3/2020
1.7.1-alpha 1,555 6/30/2020
1.7.0-alpha 1,183 6/30/2020
1.6.0 20,083 3/12/2020
1.5.0-alpha 1,764 9/12/2019
1.4.0 4,600 9/12/2019
Loading failed