OMDBAPIClient(apiKey, baseUrl)

Open Movie Database API Client.

new OMDBAPIClient(apiKey, baseUrl)

Parameters:
Name Type Description
apiKey string The omdb api key (Ref)
baseUrl Base url for omdb api

Extends

Methods

static getInstance(apiKey) → {OMDBAPIClient}

Get omdb client instance.
Parameters:
Name Type Description
apiKey string The omdb api key
Returns:
OMDBAPIClient

get(options) → {Promise}

Get a media(movie/series) by looking up using different params (e.g. title, imdb id, year etc.)
Parameters:
Name Type Description
options object The options based on which the movie will be fetched.
Returns:
Promise
Overrides:
Examples
get({title: 'Saw', year: 2004, plot: 'short', format: 'xml', type: 'movie'})
get({imdbID: 'tt12444'})

getByIMDBId(imdbID) → {Promise}

Get a media(movie/series) by IMDB ID
Parameters:
Name Type Description
imdbID string IMDB ID of the media
Returns:
Promise

getByTitleAndYear(title, year, typeopt) → {Promise}

Get a media(movie/series) by title and year
Parameters:
Name Type Attributes Default Description
title string Title of the media (movie/series)
year number The year media type(movie/series) was released (Optional).
type string <optional>
'movie' Type of the media; movie/series (Optional).
Returns:
Promise
Search for a movie/series.
Parameters:
Name Type Description
options object The options based on which the search will be conducted.
Returns:
Promise
Overrides:
Example
search({query: 'Saw', year: 2004, format: 'xml', type: 'movie'})