User:Ommina/TcpV2 Beta: Difference between revisions

From AniDB
Jump to navigation Jump to search
(Created page with "{{TOCright}} {{eyecatch|NOTE! NOTE! This is important!| This document, and the associated API, are both in early development. Absolutely no promises are made that command...")
 
(No difference)

Latest revision as of 02:55, 23 July 2017


NOTE! NOTE! This is important! This document, and the associated API, are both in early development. Absolutely no promises are made that commands, replies, formats, availability, colour, spin, charge, font, or anything else will not change. Possibly repeatedly. Not even a whiff of a hint of a promise. If a client starts coding against this, and something changes, it's on their head. Really.

Clients

If you want to create a client you have to register it here and here.

Flooding and Caching

All users of this API should employ heavy local caching. Requesting the same dataset multiple times on a single day can get you banned. The same goes for request flooding. You should not issue more than one request every 0.5(?) seconds (two requests per second).

Anti Leech Protection

The API should not be used to "download" AniDB. If such attempts are detected you will get banned.

Parameters

Requests can be issued to the API in either URLEncoded query string OR JSON format.

If JSON is used, do not use a 'pretty printed' string (that is, JSON with indents and internal line breaks). Instead, send the JSON as a single string, with a newline at the end.

Parameters do not need to appear in any particular order.

All users of the TCP API need to be registered and have to provide their registered client identifier and version number on each request.

All commands require client, clientver, protover, and request parameters.

Authenticated commands will also require user, and pass parameters.


Parameters:

  • request={string} [required]
    • API command requested. See following sections.
  • protover={integer} [required]
    • protocol version in use. Possible values: 1
  • client={string} [required]
    • client identification string, needs to be a registered client identifier, see:
  • clientver={integer} [required]
    • client version number, needs to be valid client version number for the given client identification string.
  • user={string} [authenticated commands]
    • user's AniDB username
  • pass={string} [authenticated commands]
    • user's AniDB password


Example:

query string: request=version&client={str}&clientver={int}&protover=1

or

JSON: {"request":"version","client":"{str}", "clientver":"{str}","protover":1}


User Data Commands

Mylist

Allows retrieval of a user's mylist entry.

request=mylist

Command String:
by (mylist list id) lid:

  • lid={int4 lid}

by fid:

  • fid={int4 fid}

by size+ed2k hash:

  • size={int4 size}&ed2k={str ed2khash}