1.0.0 • Published 7 years ago

api-omdb v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

npm.io npm.io npm.io

api-omdb

A simple API wrapper for the OMDB API.

Installation

To install api-omdb, you need to run the following command:

> npm i --save api-omdb

And from there you can just require it in your Node.js project!

Documentation

.search(), .searchByMovie(), .searchBySeries(), and .searchByEpisode()

Searches a query and return data about the first matched object. .search(), .searchByMovie(), .searchBySeries(), and .searchByEpisode() are all used in the same way.

Example:

const omdb = require('api-omdb');
const api = new omdb('your-super-secret-api-key');

api.search('Guardians of the Galaxy', res => console.log(res));

Example Response:

{
  "Title": "Guardians of the Galaxy",
  "Year": "2014",
  "Rated": "PG-13",
  "Released": "01 Aug 2014",
  "Runtime": "121 min",
  "Genre": "Action, Adventure, Comedy, Sci-Fi",
  "Director": "James Gunn",
  "Writer": "James Gunn, Nicole Perlman, Dan Abnett (based on the Marvel comics by), Andy Lanning (based on the Marvel comics by), Bill Mantlo (character created by: Rocket Raccoon), Keith Giffen (character created by: Rocket Raccoon), Jim Starlin (characters created by: Drax the Destroyer,  Gamora & Thanos), Steve Englehart (character created by: Star-Lord), Steve Gan (character created by: Star-Lord), Steve Gerber (character created by: Howard the Duck), Val Mayerik (character created by: Howard the Duck)",
  "Actors": "Chris Pratt, Zoe Saldana, Dave Bautista, Vin Diesel",
  "Plot": "A group of intergalactic criminals must pull together to stop a fanatical warrior with plans to purge the universe.",
  "Language": "English",
  "Country": "USA",
  "Awards": "Nominated for 2 Oscars. Another 52 wins & 99 nominations.",
  "Poster": "https://m.media-amazon.com/images/M/MV5BMTAwMjU5OTgxNjZeQTJeQWpwZ15BbWU4MDUxNDYxODEx._V1_SX300.jpg",
  "Ratings": [
    { "Source": "Internet Movie Database", "Value": "8.1/10" },
    { "Source": "Rotten Tomatoes", "Value": "91%" },
    { "Source": "Metacritic", "Value": "76/100" }
  ],
  "Metascore": "76",
  "imdbRating": "8.1",
  "imdbVotes": "913,669",
  "imdbID": "tt2015381",
  "Type": "movie",
  "DVD": "09 Dec 2014",
  "BoxOffice": "$270,592,504",
  "Production": "Walt Disney Pictures",
  "Website": "https://www.marvel.com/movies/guardians-of-the-galaxy",
  "Response": "True"
}

.getByID()

Searches a query and return data about the first matched film.

Example:

const omdb = require('api-omdb');
const api = new omdb('your-super-secret-api-key');

api.getByID('tt3896198', res => console.log(res));

Example Response:

{ "Title": "Guardians of the Galaxy Vol. 2",
  "Year": "2017",
  "Rated": "PG-13",
  "Released": "05 May 2017",
  "Runtime": "136 min",
  "Genre": "Action, Adventure, Comedy, Sci-Fi",
  "Director": "James Gunn",
  "Writer":
   "James Gunn, Dan Abnett (based on the Marvel comics by), Andy Lanning (based on the Marvel comics by), Steve Englehart (Star-Lord created by), Steve Gan (Star-Lord created by), Jim Starlin (Gamora and Drax created by), Stan Lee (Groot created by), Larry Lieber (Groot created by), Jack Kirby (Groot created by), Bill Mantlo (Rocket Raccoon created by), Keith Giffen (Rocket Raccoon created by), Steve Gerber (Howard the Duck created
by), Val Mayerik (Howard the Duck created by)",
  "Actors": "Chris Pratt, Zoe Saldana, Dave Bautista, Vin Diesel",
  "Plot":
   "The Guardians struggle to keep together as a team while dealing with their personal family issues, notably Star-Lord\"s encounter with his father the ambitious celestial being Ego.",
  "Language": "English",
  "Country": "USA",
  "Awards": "Nominated for 1 Oscar. Another 12 wins & 42 nominations.",
  "Poster":
   "https://m.media-amazon.com/images/M/MV5BMTg2MzI1MTg3OF5BMl5BanBnXkFtZTgwNTU3NDA2MTI@._V1_SX300.jpg",
  "Ratings":
   [ { "Source": "Internet Movie Database", "Value": "7.7/10" },
     { "Source": "Rotten Tomatoes", "Value": "84%" },
     { "Source": "Metacritic", "Value": "67/100" } ],
  "Metascore": "67",
  "imdbRating": "7.7",
  "imdbVotes": "449,175",
  "imdbID": "tt3896198",
  "Type": "movie",
  "DVD": "22 Aug 2017",
  "BoxOffice": "$389,804,217",
  "Production": "Walt Disney Pictures",
  "Website": "https://marvel.com/guardians",
  "Response": "True" }
1.0.0

7 years ago