xxgicoxx / themoviedb.js

The Movie Database API wrapper for Node.js.

Home Page:https://www.npmjs.com/package/themoviedb.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

themoviedb.js

The Movie Database API wrapper for Node.js.

Features

  • Trending all
  • Trending movies
  • Trending people
  • Trending tv shows
  • Popular movies
  • Popular people
  • Popular tv shows
  • Movies in theatres
  • Top rated movies
  • Top rated tv shows

Docs

Prerequisites

Installation

npm install themoviedb.js

Credentials

1. TMDB

# Account
Create an The Movie DB account on https://www.themoviedb.org/.

# API Key
Create an API key on https://www.themoviedb.org/settings/api.

Example

const TMDB = require('themoviedb.js');

const tmdb = new TMDB({ 
  api_key: 'TMDB_API_KEY',
});

(async () => {
  try {
    const trending = await tmdb.all().getTrending();
    console.log(trending);

    const nowPlayingMovie = await tmdb.movie().getNowPlaying();
    console.log(nowPlayingMovie);

    const popularMovie = await tmdb.movie().getPopular();
    console.log(popularMovie);

    const trendingMovie = await tmdb.movie().getTrending();
    console.log(trendingMovie);

    const topRatedMovie = await tmdb.movie().getTopRated();
    console.log(topRatedMovie);
  } catch (error) {
    console.error(error);
  }
})();

Built With

Authors

Acknowledgments

Attribution

This product uses the TMDB API but is not endorsed or certified by TMDB.

About

The Movie Database API wrapper for Node.js.

https://www.npmjs.com/package/themoviedb.js

License:MIT License


Languages

Language:JavaScript 100.0%