shikimori-api-node
v1.0.3
Published
Node.js wrapper for http://shikimori.one/api/doc
Downloads
9
Maintainers
Readme
Документация на русском: /README_ru.md
Shikimori Web API wrapper for Node.js
Table of contents
Installation
npm i shikimori-api-node
Usage
Prologue
- Every function is
promise
. - Every 'parameters' variable should be
Object
. - Some parameters for methods are not defined in official API documentation (such as
broadcast
) but I tried to note ones that support them.
Authentication
If you need methods that require scopes
then you will need to login with credentials of your application. Note that logging in is optional. API can work without it.
First of all, complete first two steps at shikimori/oauth.
Note that authentication code can be used only once and should be renewed by the user itself.
Loggin' in
const Shikimori = require('shikimori-api-node');
const shiki = new Shikimori();
shiki.auth.login({
clientid: 'xxxxxxxxxxxxxx',
clientsecret: 'xxxxxxxxxxxxxx',
authcode: 'xxxxxxxxxxxxxx',
useragent: 'xxxxxx', // only name of your app
redirecturi: 'xxxxxxxxx' // optional: 'urn:ietf:wg:oauth:2.0:oob' by default
});
Authenticates you and resolves
as credentials object with all info that you may need.
Refreshing token
shiki.auth.refreshToken();
Refreshes token internally and resolves
as credentials object with updated info.
Requests
Small lib for API HTTP requests. Don't put '/' in start of the method
. Every function resolves as HTTP body.
shiki.api.request.get(method, parameters)
method
: string, parameters
: object
Performs a GET API request.
shiki.api.request.post(method, parameters)
method
: string, parameters
: object
Performs a POST API request.
shiki.api.request.put(method, id, parameters)
method
: string, id
: integer, parameters
: object
Performs a PUT API request.
shiki.api.request.delete(method, id)
method
: string, id
: integer
Performs a DELETE API request.
API v1
Achievements
shiki.api.achievements.get(userid)
Animes
shiki.api.animes.list(parameters)
shiki.api.animes.get(id)
Get the anime with specified id
shiki.api.animes.getRoles(id)
shiki.api.animes.getSimiliar(id)
Get similiar animes to specified
shiki.api.animes.getRelated(id)
Get animes related to specified
shiki.api.animes.getScreenshots(id)
shiki.api.animes.getFranchise(id)
shiki.api.animes.getExternalLinks(id)
Get anime's external links (such as wikipedia or myanimelist ones)
shiki.api.animes.getTopics(id, parameters)
Appear
shiki.api.appear.create(ids)
Mark comments or topics as read
Bans
shiki.api.bans.list()
Calendars
shiki.api.calendars.get(censored)
Characters
shiki.api.characters.get(id)
shiki.api.characters.search(search)
Clubs
shiki.api.clubs.list(parameters)
shiki.api.clubs.update(id, club)
shiki.api.clubs.get(id)
Get the club with specified id
shiki.api.clubs.getAnimes(id)
shiki.api.clubs.getMangas(id)
shiki.api.clubs.getRanobe(id)
shiki.api.clubs.getCharacters(id)
shiki.api.clubs.getMembers(id)
shiki.api.clubs.getImages(id)
shiki.api.clubs.join(id)
shiki.api.clubs.leave(id)
Comments
shiki.api.comments.get(id)
Get the comment by specified id
shiki.api.comments.list(id, parameters)
shiki.api.comments.create(parameters)
Note:
broadcast
param stands for comment-broadcast and can be used only by club administrator;frontend
changes resolve format
shiki.api.comments.update(id, parameters)
shiki.api.comments.delete(id)
Constants
shiki.api.constants.anime()
shiki.api.constants.manga()
shiki.api.constants.userRate()
shiki.api.constants.club()
shiki.api.constants.smileys()
Dialogs
shiki.api.dialogs.list()
shiki.api.dialogs.get(id)
Get the dialog with specified id
shiki.api.delete(id)
Favorites
Alias:
shiki.api.favourites
shiki.api.favorites.create(linked_type, linked_id, kind)
shiki.api.favorites.delete(linked_type, linked_id)
shiki.api.favorites.reorder(id, new_index)
Assign new position to a favourite
Forums
shiki.api.forums.list()
Friends
shiki.api.friends.add(id)
shiki.api.friends.remove(id)
Genres
shiki.api.genres.list()
Mangas
shiki.api.mangas.list(parameters)
shiki.api.mangas.get(id)
Get the manga with specified id
shiki.api.mangas.getRoles(id)
shiki.api.mangas.getSimilar(id)
Get mangas similar to specified
shiki.api.mangas.getRelated(id)
Get mangas related to specified
shiki.api.mangas.getFranchise(id)
shiki.api.mangas.getExternalLinks(id)
shiki.api.mangas.getTopics(id, parameters)
Messages
shiki.api.messages.get(id)
shiki.api.messages.send(message)
shiki.api.messages.update(id, message)
shiki.api.messages.delete(id)
shiki.api.messages.markAsRead(ids, is_read)
Mark messages as read or unread
shiki.api.messages.markAllAsRead(parameters)
Note:
frontend
changes resolve format
shiki.api.messages.deleteAll(parameters)
Note:
frontend
changes resolve format
People
shiki.api.people.get(id)
Get the person by specified id
shiki.api.people.search(parameters)
Publishers
shiki.api.publishers.list()
Ranobe
shiki.api.ranobe.list(parameters)
shiki.api.ranobe.get(id)
Get the ranobe by specified id
shiki.api.ranobe.getRoles(id)
shiki.api.ranobe.getSimilar(id)
Get ranobe similar to specified
shiki.api.ranobe.getRelated(id)
Get ranobe related to specified
shiki.api.ranobe.getFranchise(id)
shiki.api.ranobe.getExternalLinks(id)
shiki.api.ranobe.getTopics(id, parameters)
Stats
shiki.api.stats.listActiveUsers()
List users having at least 1 completed animes and active during last month
Studios
shiki.api.studios.list()
Styles
shiki.api.styles.get(id)
shiki.api.styles.preview(style)
shiki.api.styles.create(style)
shiki.api.styles.update(id, style)
Topics
shiki.api.topics.list(parameters)
shiki.api.topics.getUpdates(parameters)
shiki.api.topics.getHot(limit)
shiki.api.topics.get(id)
Get the topic with specified id
shiki.api.topics.create(parameters)
shiki.api.topics.update(id, parameters)
shiki.api.topics.delete(id)
User images
shiki.api.userImages.create(parameters)
User rates
shiki.api.userRates.delete()
Clean entire user rates and history
shiki.api.userRates.reset()
Users
shiki.api.users.list(parameters)
shiki.api.users.get(id, is_nickname)
Get user with specified id or username
shiki.api.users.getBriefInfo(id)
shiki.api.users.whoami()
shiki.api.users.signOut()
shiki.api.users.getFriends(id)
shiki.api.users.getClubs(id)
shiki.api.users.getAnimeRates(id, parameters)
shiki.api.users.getMangaRates(id, parameters)
shiki.api.users.getFavourites(id)
Alias method: shiki.api.users.getFavourites(id)
shiki.api.users.getMessages(id, parameters)
shiki.api.users.getUnreadMsgCount(id)
Alias method: shiki.api.users.getUnreadMessagesCount(id)
shiki.api.users.getHistory(id, parameters)
shiki.api.users.getBans(id)
Videos
shiki.api.videos.list(id)
shiki.api.videos.create(id, parameters)
shiki.api.videos.delete(anime_id, video_id)
API v2
Topics - Topic ignore
shiki.api.v2.topics.ignore(id, parameters)
shiki.api.v2.topics.unignore(id)
Users - User ignore
shiki.api.v2.users.ignore(id)
shiki.api.v2.users.unignore(id)
Abuse requests
shiki.api.v2.abuseRequests.markCommentAsOfftopic(comment_id)
Alias method: shiki.api.v2.abuseRequests.offtopic(comment_id)
shiki.api.v2.abuseRequests.markCommentAsSummary(comment_id)
Alias method: shiki.api.v2.abuseRequests.summary(comment_id)
shiki.api.v2.abuseRequests.reportRuleViolation(parameters)
Alias method: shiki.api.v2.abuseRequests.summary(parameters)
Create abuse about violation of site rules
shiki.api.v2.abuseRequests.reportSpoiler(parameters)
Alias method: shiki.api.v2.abuseRequests.spoiler(parameters)
Create abuse about spoiler content in comment
Episode notifications
shiki.api.v2.episodeNotifications.create(parameters)
Notify shikimori about anime episode release
User rates - Main methods
shiki.api.v2.userRates.get(id)
shiki.api.v2.userRates.list(parameters)
shiki.api.v2.userRates.create(parameters)
shiki.api.v2.userRates.update(id, parameters)
shiki.api.v2.userRates.increment(id)
Increment episodes/chapters by 1
shiki.api.v2.userRates.delete(id)
Support
QIWI: qiwi.com/n/LENNYLIZOWZSKIY