npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@skymansion/imdb

v1.0.0

Published

This is a simple imdb scraper. If anyone wants to improve it, please join us.

Downloads

6

Readme

IMDB

A simple Node.js wrapper for fetching movie and TV show data from IMDb.

image

npm version

Description

This library provides an easy way to search for movies and TV shows on IMDb and retrieve detailed information about them. It utilizes IMDb's suggestion API for searching and web scraping for detailed data.

Installation

You can install this package using npm:

npm install @skymansion/imdb

Usage

Here's how you can use the IMDb class in your Node.js project:

import IMDb from '@skymansion/imdb';
const imdb = new IMDb();

Get Movie Data

import IMDb from '@skymansion/imdb';

const imdb = new IMDb();

async function moviedata() {
    const movieDetails = await imdb.Getmoviedata('Interstellar', 2014);
    console.log(movieDetails);
}
moviedata();
{
  title: 'Interstellar',
  img: 'https://m.media-amazon.com/images/M/MV5BYzdjMDAxZGItMjI2My00ODA1LTlkNzItOWFjMDU5ZDJlYWY3XkEyXkFqcGc@._V1_.jpg',
  description: 'When Earth becomes uninhabitable in the future, a farmer and ex-NASA pilot, Joseph Cooper, is tasked to pilot a spacecraft, along with a team of researchers',
  language: 'English',
  genre: 'Adventure,Drama,Sci-Fi',
  datePublished: '2014-11-07',
  rating: 8.7,
  duration: '2 hours and 49 minutes',
  actors: 'Matthew McConaughey,Anne Hathaway,Jessica Chastain',
  director: 'Christopher Nolan',
  CorrectConfidence: 92
}

Get TVShow Data

import IMDb from '@skymansion/imdb';

const imdb = new IMDb();
async function tvSeriesdata() {
    const TvShowDetails = await imdb.GetTvShowdata('Game of Thrones', 2011);
    console.log(TvShowDetails);
}
tvSeriesdata();
{
  title: 'Game of Thrones',
  img: 'https://m.media-amazon.com/images/M/MV5BMTNhMDJmNmYtNDQ5OS00ODdlLWE0ZDAtZTgyYTIwNDY3OTU3XkEyXkFqcGc@._V1_.jpg',
  description: 'Nine noble families fight for control over the lands of Westeros, while an ancient enemy returns after being dormant for millennia.',
  language: 'English',
  genre: 'Action,Adventure,Drama',
  datePublished: '2011-04-17',
  rating: 9.2,
  duration: '',
  actors: 'Emilia Clarke,Peter Dinklage,Kit Harington',
  director: undefined,
  CorrectConfidence: 92
}

API

new IMDb()

Creates a new instance of the IMDb class.

imdb.search(name, year, type)

Searches for movies or TV shows on IMDb based on the provided name, year, and type.

Parameters:

  • name (string): The title of the movie or TV show.
  • year (number, optional): The release year of the movie or TV show.
  • type (string): The type of content to search for. Possible values are 'movie' or 'tvSeries'.

Returns:

A Promise that resolves to an object containing the best matching result, or null if no match is found. The result object has the following properties:

  • title (string): The title of the movie or TV show.
  • id (string): The IMDb ID of the movie or TV show (e.g., tt0111161).
  • type (string): The type of content ('movie' or 'tvSeries').
  • year (number | 'Unknown'): The release year, or 'Unknown' if not available.
  • cast (string): A comma-separated string of the main cast members.
  • image (string): The URL of the movie or TV show's poster image, or 'N/A' if not available.
  • matchConfidence (number): A percentage indicating the confidence of the match.

imdb.Getmoviedata(name, year)

Searches for a movie and retrieves detailed information about it.

Parameters:

  • name (string): The title of the movie.
  • year (number, optional): The release year of the movie.

Returns:

A Promise that resolves to an object containing detailed information about the movie, or 'data not found' if no suitable match is found (with a match confidence below 50%). The detailed movie object has the following properties:

  • title (string): The title of the movie.
  • img (string): The URL of the movie's poster image.
  • description (string): A brief description of the movie.
  • language (string, optional): The language of the movie.
  • genre (string): A comma-separated string of the movie's genres.
  • datePublished (string): The publishing date of the movie.
  • rating (string, optional): The IMDb rating of the movie.
  • duration (string): The runtime of the movie in a human-readable format (e.g., "2 hours and 22 minutes").
  • actors (string): A comma-separated string of the main actors in the movie.
  • director (string, optional): The director of the movie.

imdb.GetTvShowdata(name, year)

Searches for a TV show and retrieves detailed information about it.

Parameters:

  • name (string): The title of the TV show.
  • year (number, optional): The release year of the first episode of the TV show.

Returns:

A Promise that resolves to an object containing detailed information about the TV show, or 'data not found' if no suitable match is found (with a match confidence below 50%). The detailed TV show object has the following properties:

  • title (string): The title of the TV show.
  • img (string): The URL of the TV show's poster image.
  • description (string): A brief description of the TV show.
  • language (string, optional): The language of the TV show.
  • genre (string): A comma-separated string of the TV show's genres.
  • datePublished (string): The publishing date of the first episode of the TV show.
  • rating (string, optional): The IMDb rating of the TV show.
  • duration (string): The runtime of an episode in a human-readable format (e.g., "45 minutes").
  • actors (string): A comma-separated string of the main actors in the TV show.
  • director (string, optional): The director of the TV show (may be for the first episode or series).

Dependencies

This library relies on the following packages:

  • node-fetch: For making HTTP requests.
  • string-similarity: For comparing string similarity to find the best match.
  • node-html-parser: For parsing HTML content from IMDb's mobile site.
  • iso8601-duration: For parsing ISO 8601 duration strings into a readable format.

Error Handling

The WorkspaceResults method includes basic error handling for network requests. The getIMDbMovieDetails method uses Promises to handle successful data retrieval and errors during fetching or JSON parsing. The Getmoviedata and GetTvShowdata methods return 'data not found' if the initial search doesn't yield a result with sufficient confidence.

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

MIT

Keywords

imdb, api, wrapper, movie, tv, show, search, details, nodejs

Author

Dilshan - ravindudil5han