in ,

Get Movie or Series Information Using IMDB API With discord.js v12

Well everyone likes movies and web series, what if you can make a discord command on it like you can search about any your Favourite movie and series. On that point API comes to use , if you do not know what is API then google it. SO, we will be using IMDB api here and before we go any further make sure you install imdb-api by using npm install imdb-api

i will be using my command handler and if you do not know how to create command handler than you should check this post – COMMAND HANDLER

const discord = require("discord.js");
const imdb = require("imdb-api");

module.exports = {
name: "imdb",
  description: "Get the information about series and movie",
  category: "info",
  usage: "imdb <name>",
  run: async (client, message, args, color) => {


you will be using async function as we will use await, first we will add argument error

 if(!args.length) {
      return"Please give the name of movie or series")

Now we will be getting information about the given name by author by using API

 const imob = new imdb.Client({apiKey: "5e36f0db"}) //You need to paste you imdb api
 let movie = await imob.get({'name': args.join(" ")})

We will be sending embed message with full of information

 let embed = new discord.MessageEmbed()
    .setFooter(`Ratings: ${movie.rating}`)
    .addField("Country",, true)
    .addField("Languages", movie.languages, true)
    .addField("Type", movie.type, true);

here we are done , as you have seen that its very easy to intract with api

Resulting Code

Here is the result code of whole post – here

Related Posts

Written by Senpai

"This may be a virtual world,but I feel more alive here then in the real world"

Leave a Reply

One Comment