An advanced api wrapper for the OMDB API
- Lightweight - Only one dependency
- Object-oriented
- Promise and async/await support
- Easy-to use syntax
- Advanced error handling - Catch errors before you send them to the API
- 100% API support - The whole OMDB API is documented and covered
- High-level api - start hacking in just a few lines!
npm install movie.js
const movieJs = require("movie.js");
const movies = new movieJs(process.env.API_KEY); // API key goes here
Wrap the following code in an await function to use async/await. More info
await movies.search("Star Wars"); // Search for star wars movies
await movies.search("Star Wars", { // Search with options
type: "", // Either movie, series, or episode
year: 1999, // Shows search results of movies released that year
page: 1, // Pagination 1-100
});
await movies.get("tt1285016"); // Get movie by ID
await movies.get("tt1285016", { // Get movie by ID with options
plot : "full", // Whether to return a "short" or "full" plot
});
const movie = await movies.search("Star Wars"); // Search for a movie
await movies.get(movie[0]); // Get more info on the first movie
await movies.getByTitle("Good Burger"); // Get movie by title
await movies.getByTitle("Good Burger", {
plot: "full", // Whether to return a "short" or "full" plot
type: "movie", // Either movie, series, or episode
year: 1997, // What year the returned movie should be
});
await movies.getPoster("tt1285016"); // Get poster image as a buffer