UDP API Definition: Difference between revisions

Jump to navigation Jump to search
m
Fix typo in return code 282 name (NOTIFYACK_SUCCESSFUL_NOTIFICATION -- was [...]_NOTIFIATION)
m (Fix typo in return code 282 name (NOTIFYACK_SUCCESSFUL_NOTIFICATION -- was [...]_NOTIFIATION))
 
(28 intermediate revisions by 7 users not shown)
Line 3: Line 3:
== General Information ==
== General Information ==
'''Author:''' [[User:Exp|Exp]] & [[User:Epoximator|Epoximator]] & [[User:Ommina|Ommina]]<br>
'''Author:''' [[User:Exp|Exp]] & [[User:Epoximator|Epoximator]] & [[User:Ommina|Ommina]]<br>
'''Version:''' 0.03.610 (2010-05-01)<br>
'''Version:''' 0.03.730 (2015-03-25)<br>
'''Version number used for protover parameter:''' "3"
'''Version number used for protover parameter:''' "3"


Line 31: Line 31:
** All newlines should be replaced by &lt;br /&gt;
** All newlines should be replaced by &lt;br /&gt;
* Escape scheme for returned data fields (from server): ', | and newline
* Escape scheme for returned data fields (from server): ', | and newline
** Content newlines are encoded as &lt;br /&gt;, ' is encoded as ` and | is not allowed in data fields.
** Content newlines are encoded as &lt;br /&gt;, ' is encoded as ` and | is encoded as /.
** Dates are returned in unix time (number of seconds elapsed since January 1, 1970 00:00:00 UTC)
** Dates are returned in unix time (number of seconds elapsed since January 1, 1970 00:00:00 UTC)


== Basics ==
== Basics ==
=== General ===
=== General ===
The network communication is ''packet'' and ''line'' based. Each AniDB API command is exactly one UDP packet containing one line. Results are sent as one packet but may consist out of multiple lines. A return value always starts with a 3 byte result code followed by a human readable version of the result code. Be aware that important data fields may be returned directly after the return code (see: 200,201,271,272,504).
The network communication is ''packet'' and ''line'' based. Each AniDB API command is exactly one UDP packet containing one line. Results are sent as one packet but may consist out of multiple lines. A return value always starts with a 3 byte result code followed by a human readable version of the result code. Be aware that important data fields may be returned directly after the return code (see: 200,201,209,271,272,504).
The meaning for all result codes can be found in this document. If there is more than one entry returned, it's one entry per line. Lines are terminated by a <tt>\n</tt> (no dos linefeed <tt>\r</tt>). The elements of a format string are separated by a "|" character.
The meaning for all result codes can be found in this document. If there is more than one entry returned, it's one entry per line. Lines are terminated by a <tt>\n</tt> (no dos linefeed <tt>\r</tt>). The elements of a format string are separated by a "|" character.


Line 157: Line 157:
=== AUTH: Authing to the AnimeDB ===
=== AUTH: Authing to the AnimeDB ===
'''Command String:'''
'''Command String:'''
* AUTH user={str username}&pass={str password}&protover={int4 apiversion}&client={str clientname}&clientver={int4 clientversion}[&nat=1&comp=1&enc={str encoding}&mtu{int4 mtu value}&imgserver=1]
* AUTH user={str username}&pass={str password}&protover={int4 apiversion}&client={str clientname}&clientver={int4 clientversion}[&nat=1&comp=1&enc={str encoding}&mtu={int4 mtu value}&imgserver=1]


'''Possible Replies:'''
'''Possible Replies:'''
Line 474: Line 474:
'''Info:'''
'''Info:'''
* See: '''PUSH'''
* See: '''PUSH'''
== Notification Commands ==
=== NOTIFICATIONADD: Add Anime or Group to Notify List ===
'''Command String:'''<br>
by anime id:
* NOTIFICATIONADD aid={int4 aid}&type={int2 type}&priority={int2 priority}
by group id:
* NOTIFICATIONADD gid={int4 gid}&type={int2 type}&priority={int2 priority}
<br>
'''Possible Replies:'''
* 246 NOTIFICATION ITEM ADDED
: {int4 notification id}
* 248 NOTIFICATION ITEM UPDATED
: {int4 notification id}
* 399 NO CHANGES
<br>
'''Info:'''
* ''Priority'' values are 0: low, 1: medium, 2: high
* ''Type'' values are 0: all, 1: new, 2: group, 3: complete
=== NOTIFICATIONDEL: Remove Anime or Group from Notify List ===
'''Command String:'''<br>
by anime id:
* NOTIFICATIONDEL aid={int4 aid}
by group id:
* NOTIFICATIONDEL gid={int4 gid}
<br>
'''Possible Replies:'''
* 247 NOTIFICATION ITEM DELETED
: {int4 notification_table}|{int4 relid}
* 324 NO SUCH NOTIFICATION ITEM
<br>
'''Info:'''
* ''notification_table'' values are 1: anime, 2: group
* ''relid'' value matches the aid/gid supplied


== Buddy Commands ==
== Buddy Commands ==
Line 560: Line 603:
* Fields are returned in the same order they appear in the ''amask'' field list: byte 1, bit 7 first
* Fields are returned in the same order they appear in the ''amask'' field list: byte 1, bit 7 first
* Synonyms and short names are separated with '
* Synonyms and short names are separated with '
* Category fields are separated with ',' and ordered by weight (desc).
* Category fields are separated with ',' and ordered by weight (desc). ''However'', be aware that categories are no longer used nor updated internally, and category responses are only returned to avoid breaking older clients.  Use tags as a replacement. 
* By name: must be perfect match of romaji/kanji/english/other/synonym/short name.
* By name: must be perfect match of romaji/kanji/english/other/synonym/short name.
* 'Producer id list' and 'producer name list' match the data returned by the former producer bits (but using the revised creator ids)
* 'Producer id list' and 'producer name list' match the data returned by the former producer bits (but using the revised creator ids)
Line 573: Line 616:
** bit6 set == Enddate, Unknown Year
** bit6 set == Enddate, Unknown Year


* '''Note:''' The character id list is the first data to be truncated if needed. And then: category list, synonym list, short name list. This applies to the FILE command too.
* '''Note:''' The character id list is the first data to be truncated if needed. And then: tag list, synonym list, short name list. This applies to the FILE command too.
* Selecting an 'unused' or 'reserved' bit will return an "illegal input" (505) response.
* Selecting an 'unused' or 'reserved' bit will return an "illegal input" (505) response.


Line 628: Line 671:
     <td>1</td>
     <td>1</td>
     <td align="right">2</td>
     <td align="right">2</td>
     <td>str category list</td>
     <td><i>retired</i></td>
     </tr>
     </tr>
     <tr>
     <tr>
     <td>0</td>
     <td>0</td>
     <td align="right">1</td>
     <td align="right">1</td>
     <td>str category weight list</td>
     <td><i>retired</i></td>
     </tr>
     </tr>
   </table>
   </table>
Line 731: Line 774:
     <td>0</td>
     <td>0</td>
     <td align="right">1</td>
     <td align="right">1</td>
     <td>str category id list</td>
     <td><i>retired</i></td>
     </tr>
     </tr>
   </table>
   </table>
Line 794: Line 837:
     <td>7</td>
     <td>7</td>
     <td align="right">128</td>
     <td align="right">128</td>
     <td>int anime planet id</td>
     <td><i>retired</i></td>
     </tr>
     </tr>
     <tr>
     <tr>
Line 814: Line 857:
     <td>3</td>
     <td>3</td>
     <td align="right">8</td>
     <td align="right">8</td>
     <td>unused</td>
     <td>str tag name list</td>
     </tr>
     </tr>
     <tr>
     <tr>
     <td>2</td>
     <td>2</td>
     <td align="right">4</td>
     <td align="right">4</td>
     <td>unused</td>
     <td>int tag id list</td>
     </tr>
     </tr>
     <tr bgcolor="#eeeeee">
     <tr bgcolor="#eeeeee">
     <td>1</td>
     <td>1</td>
     <td align="right">2</td>
     <td align="right">2</td>
     <td>unused</td>
     <td>int tag weight list</td>
     </tr>
     </tr>
     <tr>
     <tr>
Line 848: Line 891:
     <td>6</td>
     <td>6</td>
     <td align="right">64</td>
     <td align="right">64</td>
     <td>int creator id list</td>
     <td><i>retired</i></td>
     </tr>
     </tr>
     <tr bgcolor="#eeeeee">
     <tr bgcolor="#eeeeee">
     <td>5</td>
     <td>5</td>
     <td align="right">32</td>
     <td align="right">32</td>
     <td>int main creator id list</td>
     <td><i>retired</i></td>
     </tr>
     </tr>
     <tr>
     <tr>
     <td>4</td>
     <td>4</td>
     <td align="right">16</td>
     <td align="right">16</td>
     <td>str main creator name list</td>
     <td><i>retired</i></td>
     </tr>
     </tr>
     <tr bgcolor="#eeeeee">
     <tr bgcolor="#eeeeee">
Line 942: Line 985:
     2      prequel
     2      prequel
   11      same setting
   11      same setting
   21     alternative setting
   12     alternative setting
   32      alternative version
   32      alternative version
   41      music video
   41      music video
Line 1,013: Line 1,056:
** bit6 set == Enddate, Unknown Year
** bit6 set == Enddate, Unknown Year


----
=== CHARACTER: Get Character Information ===
=== CHARACTER: Get Character Information ===
Returns character details associated with a given character ID, including associated anime ids, episode ids, and seiyuu.
Returns character details associated with a given character ID, including associated anime ids, episode ids, and seiyuu.
Line 1,080: Line 1,125:
'''Possible Replies:'''
'''Possible Replies:'''
* 240 EPISODE
* 240 EPISODE
: {int eid}|{int aid}|{int4 length}|{int4 rating}|{int votes}|{str epno}|{str eng}|{str romaji}|{str kanji}|{int aired}
: {int eid}|{int aid}|{int4 length}|{int4 rating}|{int votes}|{str epno}|{str eng}|{str romaji}|{str kanji}|{int aired}|{int type}
* 340 NO SUCH EPISODE
* 340 NO SUCH EPISODE


'''Info:'''
'''Info:'''
* length is in minutes
* length is in minutes
* Returned 'epno' includes special character (only if special) and padding (only if normal). Special characters are S(special), C(credits), T(trailer), P(parody), O(other).
* Returned 'epno' includes special character (only if special) and padding (only if normal).
** Special characters are S(special), C(credits), T(trailer), P(parody), O(other).
* The ''type'' is the raw episode type, used to indicate numerically what the special character will be
** 1: regular episode (no prefix), 2: special ("S"), 3: credit ("C"), 4: trailer ("T"), 5: parody ("P"), 6: other ("O")


'''Examples:''' (html escaped code intended)
'''Examples:''' (html escaped code intended)
Line 1,094: Line 1,142:
   > EPISODE aname=Seikai no Monshou&epno=2&s=xxxxx
   > EPISODE aname=Seikai no Monshou&epno=2&s=xxxxx
   < 240 EPISODE
   < 240 EPISODE
   2|1|24|750|2|02|Kin of the Stars|Hoshi-tachi no Kenzoku|??????|1295059229
   2|1|24|750|2|02|Kin of the Stars|Hoshi-tachi no Kenzoku|??????|1295059229|1


----
----
Line 1,248: Line 1,296:
     <td>1</td>
     <td>1</td>
     <td align="right">2</td>
     <td align="right">2</td>
     <td>unused</td>
     <td>video colour depth</td>
     </tr>
     </tr>
     <tr bgcolor="#eeeeee">
     <tr bgcolor="#eeeeee">
Line 1,657: Line 1,705:
   > GROUP gid=7091&s=bunny
   > GROUP gid=7091&s=bunny
   < 250 GROUP
   < 250 GROUP
   7091|832|1445|43|566|Frostii|Frostii|#frostii|irc.rizon.net|http://frostii.com|15844.jpg|1228089600|0|1|1301875200|1304222640|7255,1'3097,4'748,4'8106,1'8159,2'8402,1'8696,1'9022,1
   7091|832|1445|43|566|Frostii|Frostii|#frostii|irc.rizon.net|<nowiki>http://frostii.com</nowiki>|15844.jpg|1228089600|0|1|1301875200|1304222640|7255,1'3097,4'748,4'8106,1'8159,2'8402,1'8696,1'9022,1


----
----
Line 1,673: Line 1,721:
: ... (repeated)
: ... (repeated)


* 325 NO GROUPS FOUND
* 325 NO SUCH GROUPS FOUND
* 330 NO SUCH ANIME
* 330 NO SUCH ANIME


Line 1,689: Line 1,737:
#finished
#finished
#specials only
#specials only
'''Example:'''
  > GROUP GROUPSTATUS aid=8692&s=vLl1N
  < 225 GROUPSTATUS
  7407|Coalgirls|3|25|839|12|1-25
  9863|Hadena Subs|3|25|374|1|1-25
  11951|ChaosBlades|3|25|0|0|1-25
  [truncated]
=== UPDATED: Get List of Updated Anime IDs ===
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).
'''Command String:'''
* UPDATED entity=1&[age={int4 id}|time={int4 date}]
'''Possible Replies:'''
* 243 UPDATED
{int entity}|{int total count}|{int last update date}|{list aid}
* 343 NO UPDATES
'''Info:'''
* ''entity'' is always 1
* Either ''age'' OR ''time'' can be specified, but not both
* ''age'' is specified in days.
** eg: age=30 requests a list of aid values of anime that have changed in the past 30 days
* ''time'' is specified in unix time.
** eg: time=1264982400 requests a list of aid values of anime that have changed since 2010-02-01
* A maximum of 200 values will be returned
* ''count'' specifies the total number of items found for the given time period.  In short, if this value is great than 200, you have not retrieved all applicable ids.
* ''last update date'' will contain the AniDB update time of the ''last'' aid to appear on the list
* A given list value will appear only once.  If there have been multiple changes to an entity, its age will reflect the most recent change.
'''An anime will be considered updated if:'''
* A change is made to the anime record itself
* An ''main'' or ''official'' anime title is added, edited, or deleted (not ''short'' or ''synonym'')
* An episode for the anime is added, or deleted (but NOT edited!)
* An episode title is added, edited, or deleted
* An anime relation is added, or deleted


== MyList Commands ==
== MyList Commands ==
Line 1,719: Line 1,806:
'''States:'''
'''States:'''
   0 - unknown - state is unknown or the user doesn't want to provide this information
   0 - unknown - state is unknown or the user doesn't want to provide this information
   1 - on hdd - the file is stored on hdd (but is not shared)
   1 - internal storage - the file is stored on hdd (but is not shared)
   2 - on cd - the file is stored on cd
   2 - external storage - the file is stored on cd/dvd/...
   3 - deleted - the file has been deleted or is not available for other reasons (i.e. reencoded)
   3 - deleted - the file has been deleted or is not available for other reasons (i.e. reencoded)
  4 - remote storage - the file is stored on NAS/cloud/...


'''Filestates:''' (for normal files, i.e. not generic)
'''Filestates:''' (for normal files, i.e. not generic)
Line 1,741: Line 1,829:


----
----
=== MYLISTADD: Add file to MyList ===
=== MYLISTADD: Add file to MyList ===
The command string for MYLISTADD is made of up two blocks: a 'fileinfo' block, which limits the command to a specific file, or an 'animeinfo'/'groupinfo'/'episodeinfo' block, which can be used to specify a range of files, including generics.  Additionally, a number of optional parameters can be included with either set.
The command string for MYLISTADD is made of up two blocks: a 'fileinfo' block, which limits the command to a specific file, or an 'animeinfo'/'groupinfo'/'episodeinfo' block, which can be used to specify a range of files, including generics.  Additionally, a number of optional parameters can be included with either set.
Line 1,850: Line 1,939:
by id
by id
* VOTE type={int2 type}&id={int4 id}[&value={int4 vote value}&epno={int4 episode number}]
* VOTE type={int2 type}&id={int4 id}[&value={int4 vote value}&epno={int4 episode number}]
* VOTE type={int2 type}&id={int4 id}[&value={int4 vote value}&epno={str episode number}]
by name
by name
* VOTE type={int2 type}&name={string name}[&value={int4 vote value}&epno={int4 episode number}]
* VOTE type={int2 type}&name={string name}[&value={int4 vote value}&epno={int4 episode number}]
* VOTE type={int2 type}&name={string name}[&value={int4 vote value}&epno={str episode number}]


'''Possible Replies:'''
'''Possible Replies:'''
Line 1,870: Line 1,961:
* 364 ALREADY PERMVOTED
* 364 ALREADY PERMVOTED
: {str entity name}|{existing vote value}|{vote type}|{entity id}
: {str entity name}|{existing vote value}|{vote type}|{entity id}
'''Example:'''
  VOTE type=1&id=5101&value=950
  260 VOTED
  Clannad|950|1|5101
  VOTE type=1&id=5101&value=950&epno=S2
  260 VOTED
  Another World: Tomoyo Arc|950|1|91981
  VOTE type=6&id=91981&value=950
  260 VOTED
  Another World: Tomoyo Arc|950|1|91981


'''Info:'''
'''Info:'''
* type: 1=anime, 2=anime tmpvote, 3=group
* Type: 1=anime, 2=anime tmpvote, 3=group, 6=episode
* entity: anime, episode, or group
* Entity: anime, episode, or group
* for episode voting add epno on type=1
* For episode voting add epno on type=1, or specify type=6 if eid is known
* value: negative number means revoke, 0 means retrieve (default), 100-1000 are valid vote values, rest is illegal
* Value: negative number means revoke, 0 means retrieve (default), 100-1000 are valid vote values, rest is illegal
* votes will be updated automatically (no questions asked)
* Votes will be updated automatically (no questions asked)
* tmpvoting when there exist a perm vote is not possible
* Tmpvoting when there exist a perm vote is not possible


----
----
Line 1,901: Line 2,005:


'''Possible Replies:'''
'''Possible Replies:'''
* 217 Export Queued
* 217 EXPORT QUEUED
* 218 Export Cancelled
* 218 EXPORT CANCELLED
* 317 No Such Template
* 317 EXPORT NO SUCH TEMPLATE
* 318 Export Already In Queue
* 318 EXPORT ALREADY IN QUEUE
* 319 No Export In Queue or Export In Progress
* 319 EXPORT NO EXPORT QUEUED OR IS PROCESSING


'''Info:'''
'''Info:'''
Line 2,106: Line 2,210:
NOTIFICATION_ENABLED                    = 270
NOTIFICATION_ENABLED                    = 270
NOTIFYACK_SUCCESSFUL_MESSAGE            = 281
NOTIFYACK_SUCCESSFUL_MESSAGE            = 281
NOTIFYACK_SUCCESSFUL_NOTIFIATION        = 282
NOTIFYACK_SUCCESSFUL_NOTIFICATION        = 282
NOTIFICATION_STATE                      = 290
NOTIFICATION_STATE                      = 290
NOTIFYLIST                              = 291
NOTIFYLIST                              = 291
Line 2,194: Line 2,298:


PUSHACK_CONFIRMED                        = 701
PUSHACK_CONFIRMED                        = 701
NO_SUCH_PACKET_PENDING                  = 702</pre>
NO_SUCH_PACKET_PENDING                  = 702
 
VERSION                                  = 998</pre>


[[Category:Development]]
[[Category:Development]]
[[Category:UDP]]
[[Category:UDP]]
[[Category:API]]
[[Category:API]]

Navigation menu

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.