Docs

Below you will find examples for using anime quotes SDK.

Important Notes

  • No rate limit.😋
  • Do not put number greater than 10 it will through an error 💀
  • If you don't find the anime, DM me on Twitter(X).

What all you can get ??

  • Get a random quote: Returns a random anime quote.
  • Get a random quote by anime title: Returns a random quote from a specified anime title.
  • Get upto 10 random quotes: Returns an array of 10 random quotes.
  • Get upto 10 random quotes by anime name: Returns an array of 10 random quotes from a specified anime title.

Get a random quote


  const animeQuotes = require('anime-quotes-sdk');
  const quotes = new animeQuotes();
  quotes
  .fetchQuotes()
  .then(() => {
    quotes
      .getRandomQuote()
      .then((quote) => {
        console.log("Random Quote:", quote);
      })
      .catch((err) => console.error("Failed to get random quote:", err));
  })
  .catch((err) => console.error("Failed to fetch quotes:", err));

Output

{
  "Anime": "Naruto Shippuuden",
  "Character": "Obito Uchiha",
  "Quote": "The moment people come to know love, they run the risk of carrying hate."
}

Get a random quote by anime title


  const animeQuotes = require('anime-quotes-sdk');
  const quotes = new animeQuotes();
  quotes
  .fetchQuotes()
  .then(() => {
    quotes
      .getRandomQuoteByAnime("naruto")
      .then((quote) => {
        console.log("Random Quote from Naruto:", quote);
      })
      .catch((err) =>
        console.error("Failed to get random quote from Naruto:", err)
      );
  })
  .catch((err) => console.error("Failed to fetch quotes:", err));

Output

 {
  Anime: 'Naruto',
  Character: 'Jiraiya',
  Quote: 'When people get hurt, they learn to hate... When people hurt others, they become hated and racked with guilt. But knowing that pain allows people to be kind. Pain allows people to grow... and how you grow is up to you.'
}

Get 10 random quote


  const animeQuotes = require('anime-quotes-sdk');
  const quotes = new animeQuotes();
  quotes
  .fetchQuotes()
  .then(() => {
    quotes
      .getRandomQuotes(10)
      .then((quotes) => {
        console.log("Random 10 Quotes:", quotes);
      })
      .catch((err) => console.error("Failed to get random 10 quotes:", err));
  })
  .catch((err) => console.error("Failed to fetch quotes:", err));

Output

[
      {
        Anime: "...",
        Character: "...",
        Quote: "..."
      },
      "...9 more"
    ]

Get 10 random quote by title


  const animeQuotes = require('anime-quotes-sdk');
  const quotes = new animeQuotes();
  quotes
  .fetchQuotes()
  .then(() => {
    quotes
      .getQuotesByAnime("naruto", 10)
      .then((quotes) => {
        console.log("10 Quotes from Naruto:", quotes);
      })
      .catch((err) =>
        console.error("Failed to get 10 quotes from Naruto:", err)
      );
  })
  .catch((err) => console.error("Failed to fetch quotes:", err));

Output

[
      {
        Anime: "Naruto",
        Character: "...",
        Quote: "..."
      },
      "...9 more"
    ]

Created ❤️ by wolfgunblood © 2024