imdb-light
v1.1.5
Published
Get a Movie or Tv Series details directly from IMDb.com by IMDb ID
Downloads
13
Maintainers
Readme
Get a movie or tv series details directly from IMDb.com by IMDb ID - very fast and light !
- Fetch mp4 trailer url
- Weekly boxoffice
- Top 250 movies/series
Details (all responses is string):
Title
Year
Country
Release
Rating
Votes
Director
Actors
Writers
Genres
Poster
Plot
Backdrop
Trailer_id
Type
Status
Installation
$ npm i imdb-light
Usage
const IMDb = require('imdb-light');
or in ES6:
import IMDb from 'imdb-light';
Example
- Fetch a movie/tv details by IMDB id
IMDb.fetch( 'tt7097896', (details) => {
console.log(details.Title) // etc...
})
// or with async method
function fetch(id) {
return new Promise(function (resolve, reject) {
IMDb.fetch(id, (details) => {
resolve(details);
});
});
}
async function test(id) {
var quote = await fetch(id);
console.log(quote.Title);
}
test('tt7097896');
- Fetch a movie/tv trailer by IMDB id
IMDb.trailer( 'tt7097896', (url) => {
console.log(url) // output is direct mp4 url (also have expiration timeout)
})
- Weekly Boxoffice
IMDb.boxoffice((details) => {
details.forEach((media) => {
console.log(media.title)
console.log(media.id)
})
})
- Top 250 Movies
IMDb.topMovies((details) => {
details.forEach((media) => {
console.log(media.rank)
console.log(media.title)
console.log(media.id)
})
})
- Top 250 Series
IMDb.topSeries((details) => {
details.forEach((media) => {
console.log(media.rank)
console.log(media.title)
console.log(media.id)
})
})