Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default

Represents an IMDb instance from where the data will be scraped.

Hierarchy

  • default

Index

Constructors

constructor

  • new default(language?: string, debug?: boolean): default
  • Initialize the IMDb class with the default parameters to scrap content.

    // Initialize Imdb with default language = English, and debug = false
    const imdb1 = new Imdb()

    // Initialize Imdb to fetch content with Brazilian Portuguese
    const imdb2 = new Imdb('pt-BR')

    Parameters

    • language: string = 'en-US'
    • debug: boolean = false

    Returns default

Methods

getAllShowData

  • getAllShowData(identifier: string, type?: DataType): Promise<Movie | Series>
  • Scrap the main information, credits and episodes (if it's a series) of a show.

    // Get the all information (details, credits and episodes) of the show "Cobra Kai"
    imdb.getAllShowData('tt7221388')
    .then(console.log);
    async

    Parameters

    • identifier: string

      the unique identifier for movies or series.

    • type: DataType = ...

    Returns Promise<Movie | Series>

    Movie or Series - object presenting a movie or series.

getPerson

  • getPerson(identifier: string): Promise<Person>
  • Scrap the main information of a person, like name, job titles, filmography, etc.

    // Get information about the actress "Scarlett Johansson"
    imdb.getShow('nm0424060')
    .then(console.log)
    async

    Parameters

    • identifier: string

      the unique identifier for a person.

    Returns Promise<Person>

    Person - object presenting a person.

getSeriesEpisodes

  • getSeriesEpisodes(identifier: string): Promise<Movie | Series>
  • Scrap the episodes references of a series.

    // Get the references to the episodes of the series "The Mandalorian"
    imdb.getSeriesEpisodes('tt8111088')
    .then(show => console.log(show.episodes))
    async

    Parameters

    • identifier: string

      the unique identifier for movies or series.

    Returns Promise<Movie | Series>

    Series - object presenting a movie or series.

getShow

  • Scrap the main information of a show, like name, description, release year, etc.

    // Get information about the show "The Simpsons"
    imdb.getShow('tt0096697')
    .then(console.log)
    async

    Parameters

    • identifier: string

      the unique identifier for movies or series.

    Returns Promise<Movie | Series>

    Movie or Series - object presenting a movie or series.

getShowCredits

  • getShowCredits(identifier: string): Promise<Movie | Series>
  • Scrap the credits of a show, like the list of directors, writers and cast.

    // Get the credits (directors, writers and actors) of the show "Better Call Saul"
    imdb.getShowCredits('tt3032476')
    .then(show => console.log(show.credits))
    async

    Parameters

    • identifier: string

      the unique identifier for movies or series.

    Returns Promise<Movie | Series>

    Movie or Series - object presenting a movie or series.

search

  • search(query: string, type?: SearchType): Promise<Reference[]>
  • Search for shows or people.

    // Search for shows with the query "Hangover"
    imdb.search('Hangover', SearchType.Title)
    .then(console.log);
    async

    Parameters

    • query: string

      the query parameter.

    • type: SearchType = ...

    Returns Promise<Reference[]>

    Reference - array of references to a shows or people.

Generated using TypeDoc