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 🙏

© 2024 – Pkg Stats / Ryan Hefner

jikan-api

v0.1.6

Published

The unofficial Jikan API (v4) wrapper for the browser and node.js

Downloads

28

Readme

Jikan-api

Npm package version Install size npm downloads Build status GitHub issues Languages CodeQL Coverage Status

Promise based Jikan API (v4) (unofficial MyAnimeList API) wrapper for the browser and node.js.

📋 Table of Contents

✏️ Todo

  • Add data caching
  • Add rate-limit
  • Improve interfaces for Anime
  • Add characters methods
  • Add clubs methods
  • Add genres methods
  • Add magazines methods
  • Add manga methods
  • Add people methods
  • Add producers methods
  • Add random methods
  • Add recommendations methods
  • Add reviews methods
  • Add schedules methods
  • Add users methods
  • Add seasons methods
  • Add top methods

🗓 Features

  • Uses Jikan API (v4)
  • Supports TypeScript and JavaScript
  • Supports Browser and Node.js (uses axios for requests)

🚀 Install

npm i jikan-api

yarn add jikan-api

🪄 Usage

Import

It depends on the type of your project.

ESModule import

import Jikan from 'jikan-api';
// or
import { Jikan } from 'jikan-api';

CommonJS require

const Jikan = require('jikan-api').default;
// or
const { Jikan } = require('jikan-api');

Modify API

It is possible to change API settings. (Documentation)

Jikan.settings.version = 4; // changes the API version
Jikan.settings.baseURL = 'https://api.jikan.moe'; // set the new API Base URL

API Methods

Information of all possible methods and their parameters are located in the package documentation.

All API functions are promised based

import Jikan from '@kny/jikan-api';

// Anime
Jikan.Anime.getAnime(1);
Jikan.Anime.getAnimeFull(1);
Jikan.Anime.getCharacters(1);
Jikan.Anime.getStaff(1);
Jikan.Anime.getEpisode(1);
Jikan.Anime.getEpisodes(1);
Jikan.Anime.getNews(1);
Jikan.Anime.getForum(1);
Jikan.Anime.getVideos(1);
Jikan.Anime.getVideoEpisodes(1);
Jikan.Anime.getPictures(1);
Jikan.Anime.getStatistics(1);
Jikan.Anime.getMoreInfo(1);
Jikan.Anime.getRecommendations(1);
Jikan.Anime.getUserUpdates(1);
Jikan.Anime.getReviews(1);
Jikan.Anime.getRelations(1);
Jikan.Anime.getThemes(1);
Jikan.Anime.getExternals(1);
Jikan.Anime.getStreaming(1);
Jikan.Anime.search('Cowboy Bebop');

More detailed information of all methods are located in the Jikan documentation.

Examples

To print details about "Hunter x Hunter" for example, you can do the following:

Async/Await

import Jikan from 'jikan-api';

const HUNTER_X_HUNTER_ID = 11061;

try {
    const { data } = await Jikan.Anime.getAnime(HUNTER_X_HUNTER_ID);
    console.log(data); // Hunter x Hunter details
} catch (err) {
    console.error(err); // Error
}

Promise

import Jikan from 'jikan-api';

const HUNTER_X_HUNTER_ID = 11061;

Jikan.Anime.getAnime(HUNTER_X_HUNTER_ID)
    .then(function ({ data }) {
        console.log(data); // Hunter x Hunter details
    })
    .catch(function (err) {
        console.error(err); // Error
    });

⭐️ Maintainers

@kuzn5298

🛠 Contributing

Feel free to dive in! Open an issue or submit PRs.

Standard Readme follows the Contributor Covenant Code of Conduct.

📜 License

GitHub license