OptionalclientId: string
Optionaloptions: {Optionalcache?: false | AnidbCacheImplTypepass cache implementation:
by default (undefined) it will use internal cache, that saves to {cwd}/.cache
if set to false cache won't be used
if instance of AnidbCacheImplType it will use that instead *
Optionaldebug?: trueenable/disable debug logging
Optionalincomming_port?: numberthe port to listen to for response (leave undefined if you are not sure)
Optionallogger?: false | AnidbLoggerTypeLogger: default is using console.log, if false logging will be disabled, or pass a function
Optionalping_interval?: numberdefine the interval in miliseconds at which anidb is pinged to keep the connection active, defaults to 5minutes
Start the connection to anidb. It will automatically log in if user and password is provided. This client will try to keep the session alive indefenetly, so make sure to call AnidbUDPClient.disconnect when you stop using. For long running services try to be clever and disconnect when there is no activity for a while.
Optionaluser: string
anidb user
Optionalpassword: string
anidb password
Optionaludp_api_key: string
UDP API Key (defined in the users profile), pass to enable encryption, must be set and match the one in the user account
Optionalencoding: set the encoding (only applies if user and password was passed)
Disconnect and logout
Optionalsource: anyOptionalerror: ErrorChange the encoding for future responses (reset on disconnect). Prefrably use the enc param of AnidbUDPClient.login instead.
Optionalencoding: Optionalpriority: numberSpecify encoding with AnidbUDPClient.login or AnidbUDPClient.connect command
log into Anidb
Optionalencoding: Logs the user out. Only very few commands can be used when logged out, and this library will stop tying to keep the session alive when logged out.
Optionalpriority: numberTo manually ping (the lib takes care of pinging every once in a while by it's own)
Return anime by title or aid
Anime title (any synonim) or anime id (aid)
Optionalfields: T[]
List of fields to to return.
get anime description by aid
get calendar list
get character by character id
get creator by creator id
get episode by episode id
get episode by anime and episode number
anime title or anime id (aid)
episode number
Retrieve File Data by file id
list of fields to return
Retrieve File Data by anime, group and episode number
anime name or id
group name or id
episode number
fields to return
AnidbError with code RESPONSE_CODE.MULTIPLE_FILES_FOUND if more than one file is found. List of file ids will be in error.payload
Retrieve File Data by ed2k and size
file ed2k hash
size of file in bytes
list of fields to return
Retrieve Group Data
group id or name
Returns a list of group names and ranges of episodes released by the group for a given anime.
anime id
Optionalstate: "ongoing" | "stalled" | "complete" | "dropped" | "finished" | "specials_only"Returns a list of AniDB anime ids of anime that have been updated in in a given time frame, ordered by descending age (oldest to newest change). Either age is specified or time not both.
age in
unix time
Static ReadonlyEVENTSvalid events to listen to
ReadonlyDISCONNECT: "disconnect"on disconnect from udp connection
Will cancel any pending export request, queued either through UDP or the web server.
Get user id
Get user id
Get a random anime
Queues a MyList Export by the AniDB Servers. As with a manual export request, exports are only done during periods when server load is low. As a result, exports may take up to 24 hours. The client submitting the request will receive an AniDB message when the export is ready to be collected. Only one export can be in the queue at a time.
Send Message
Retrieve Server Uptime
Add MyList entry by anime. Can be used to update and exiting entry by passing options.edit=true
anime name or id
Optionalepno?: numberEpisode number, epno=0 means all episodes (default), negative numbers means upto. (-12 -> upto 12)
Optionalgroup?: string | numbergroup name or id. Optional: if not defined generic file will be added to mylist
Optionaloptions: {My list entry options
Optionaledit?: booleantrue to edit a MyList entry instead of creating a new one. When editing, optional values that are not supplied retain their original value. That is, they are not replaced with default or empty values. Only values supplied are updated.
Optionalother?: stringother remarks/notes (<br/> can be used to split into multiple lines)
Optionalsource?: string(i.e. ed2k, dc, ftp, irc, ...)
Optionalstate?: Optionalstorage?: stringlabel of the storage
Optionalviewdate?: numberOptionalviewed?: booleanAnidbError see codes at Add_file_to_MyList
Add MyList entry by file. Either by file id, ed2k+size, mylist id. Can be used to update and exiting entry by passing options.edit=true
file to add to mylist, pass { fid } (file id) or { ed2k, size } (ed2k hash and size in bytes) or { lid } (mylist id) to edit
Optionaloptions: {My list entry options
Optionaledit?: booleantrue to edit a MyList entry instead of creating a new one. When editing, optional values that are not supplied retain their original value. That is, they are not replaced with default or empty values. Only values supplied are updated. When lid is passed is automattically set to true and option ignored
Optionalother?: stringother remarks/notes (<br/> can be used to split into multiple lines)
Optionalsource?: string(i.e. ed2k, dc, ftp, irc, ...)
Optionalstate?: Optionalstorage?: stringlabel of the storage
Optionalviewdate?: numberOptionalviewed?: booleanAnidbError with code RESPONSE_CODE.FILE_ALREADY_IN_MYLIST if not edit=true. Mylist entry (same result as mylist_by_file_id result) will be in error.payload
Retrieve MyList entry by anime. Can return either a single result { single: ... } or muliple result { multi: ... }. See type definition.
anime name or id
Optionalgroup: string | number
group name or id
Optionalepno: number
episode number
Retrieve MyList entry by file ed2khash and size
hash
in bytes
Retrieve MyList entry by file id
file id
Retrieve MyList Data
Remove MyList entries by anime.
anime name or id
Episode number (negative numbers and 0 do not work), and epno is required
Optionalgroup?: string | numbergroup name or id. Optional
AnidbError see codes at Add_file_to_MyList
Removes MyList entry by file. Either by file id, ed2k+size, mylist id.
file to add to mylist, pass { fid } (file id) or { ed2k, size } (ed2k hash and size in bytes) or { lid } (mylist id) to edit
AnidbError with code RESPONSE_CODE.FILE_ALREADY_IN_MYLIST if not edit=true. Mylist entry (same result as mylist_by_file_id result) will be in error.payload
AnidbError see codes at Add_file_to_MyList
Retrieve MyList stats
Vote for specified anime/episode/group
type of vote: anime vote, anime temporary vote, vote for a group, vote for episode
identifier to vote for, can be a name or the id (of the type provided)
Must be 'get' or 'revoke' or a number between 100 and 1000
AnidbError with code RESPONSE_CODE.NO_SUCH_VOTE, PERMVOTE_NOT_ALLOWED, ALREADY_PERMVOTED with payload same as the normal response
AnidbError see codes at Vote_for_specified_anime/episode/group
client id, add your own here: https://anidb.net/software/add