An easy-to-use API wrapper/client for the Open Movie Database / OMDB API, which can be used in any .NET project. Available as a DLL library and a NuGet package. This library focuses on being easy to understand, simple to use and offer full coverage of features offered by the OMDB API. Terminology used by this library is strongly associated to the official OMDB API documentation found online at http://www.omdbapi.com/
-
Download the NuGet Package here: https://www.nuget.org/packages/OMDB_API_Wrapper/
-
Download the DLL library here: https://github.com/mrama030/OMDB_API_Wrapper/tree/master/OMDB_API_Wrapper/OMDB_API_Wrapper/bin/Debug/netstandard2.0/OMDB_API_Wrapper.dll
All OMDB_API_Wrapper public classes and public methods available for use by developers have been XML-documented. This means you may access this documentation through your IDE (i.e. hover over method or class) or read it directly within the source code in this GitHub repository. Examples below should also be referenced.
Request Type | Response Type |
---|---|
ByTitleRequest | ByTitleResponse |
ByIDRequest | ByTitleResponse |
BySearchRequest | BySearchResponse |
OmdbClient omdbClient = new OmdbClient("YOUR_API_KEY");
// Asynchronous
bool isKeyValidAsync = await omdbClient.IsAPIKeyValidAsync();
// Synchronous
bool isKeyValidSync = omdbClient.IsAPIKeyValidSync();
// Basic - No optional parameters - Short plot
ByTitleRequest byTitleRequestBasic = new ByTitleRequest("rick and morty");
// Detailed - With optional parameters - Full plot
ByTitleRequest byTitleRequestDetailed = new ByTitleRequest("rick and morty", VideoType.Series, null, PlotSize.Full);
// Asynchronous
ByTitleResponse byTitleResponseAsync = await omdbClient.ByTitleRequestAsync(byTitleRequestBasic);
// Synchronous
ByTitleResponse byTitleResponseSync = omdbClient.ByTitleRequestSync(byTitleRequestBasic);
// Asynchronous
ImageDownload imageDownloadAsync = await omdbClient.GetImageForByTitleResponseAsync(byTitleResponseAsync);
// Synchronous
ImageDownload imageDownloadSync = await omdbClient.GetImageForByTitleResponseAsync(byTitleResponseSync);
// Create image file using ImageDownload object.
if (imageDownload.DownloadSuccessful)
{
File.WriteAllBytes(@"C:\" + imageDownload.FileName, imageDownload.Data);
}
// Short plot
ByIDRequest byIDRequestShortPlot = new ByIDRequest("tt1219827");
// Full plot
ByIDRequest byIDRequestFullPlot = new ByIDRequest("tt1219827", PlotSize.Full);
// Asynchronous
ByTitleResponse byIDResponseAsync = await omdbClient.ByIDRequestAsync(byIDRequestShortPlot);
// Synchronous
ByTitleResponse byIDResponseSync = omdbClient.ByIDRequestSync(byIDRequestShortPlot);
// All Results - No optional parameters
BySearchRequest bySearchRequestAll = new BySearchRequest("ghost in the shell");
// Page 2 Only (Results 11 to 20 only) - No optional parameters
BySearchRequest bySearchRequestPageSpecific = new BySearchRequest("ghost in the shell", null, null, 2);
// All Results - With optional parameters
BySearchRequest bySearchRequestFiltered = new BySearchRequest("ghost in the shell", VideoType.Movie, 2017);
// Asynchronous
BySearchResponse bySearchResponseAsync = await omdbClient.BySearchRequestAsync(bySearchRequestAll);
// Synchronous
BySearchResponse bySearchResponseSync = omdbClient.BySearchRequestSync(bySearchRequestAll);