A simple Node.js client library for legacy Bangumi REST API.
npm install bangumi --save
const Bangumi = require('bangumi');
const bgm = new Bangumi({
access_token: "fill in your access token here"
});
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);
bgm.setPromiseProvider(require('bluebird'));
bgm.search('天元突破',{
responseGroup: 'small',
max_results:2,
start:1,
type:2
}).then(data => console.log(JSON.stringify(data))).catch(console.error);
bgm.search('天元突破',{
responseGroup: 'small',
max_results:2,
start:1,
type:2
},function(err, data){
console.log(JSON.stringify(data));
});
See Releases