A simple Node.js client library for classic v0 Bangumi REST API.

Installation

npm install bangumi --save

Getting Started

Setup API

const Bangumi = require('bangumi');
const bgm = new Bangumi({
    access_token: "fill in your access token here"
});

How to get and refresh access token

This library currently does not handle token requests or renew. Please follow these steps to get your valid token.

Once you get a new token, it can be replaced live with

bgm.setAccessToken(your_token);

Examples of Usage

Set up custom promise library

bgm.setPromiseProvider(require('bluebird'));

Using promise

bgm.search('天元突破',{
	responseGroup: 'small',
	max_results:2,
	start:1,
	type:2
}).then(data => console.log(JSON.stringify(data))).catch(console.error);

Using callback

bgm.search('天元突破',{
	responseGroup: 'small',
	max_results:2,
	start:1,
	type:2
},function(err, data){
	console.log(JSON.stringify(data));
});

Changelog

See Releases

Documentation

See documentation site and Bangumi API official docs