Open API

The API is in beta stage. Contact admin@ if you have any problems or if you need to extend the API. Also keep in mind that the project was created by people who can easily spend a half of day just renaming wrong named variables.

Introduction

media centers plugins such as XMBC

desktop applications

Limits for non-premium users

Other limits

API methods

Common parameters and response keys parameters api_key - required if no login cookies provided. Your API key is: [login to see it] jsonp - jsonp callback function. If provided then login cookies are ignored (so no XSS). pretty - ex. pretty=1 - turn on json pretty formating. format - format of response; supported formats: json(default), xml, dumper; use json whenever possible. Xml format is not well tested and is provided only to make fun on people who got permanent brain damage back in 199x. Dumper format is just for debug and console testing. response status - 'ok' or 'error', test for status=='ok' to check if a request was successfull error - error text if status=='error', it's safe to display this error to your users



Downloads

/api/dl/add - add a download parameters url OR info_hash OR file url - url to .torrent file. Some urls to torrent description pages may be automatically converted into urls to .torrent files. info_hash - torrent wil be downloaded from a public torrent cache file - 'input type=file', the .torrent metafile response dl - download objects, you need only id for futher queries file - file object if download is/was already processed

/api/dl/get - get linked downloads parameters id - a single id or arrays of ids (array is muplitpy id params), if omited then all your active and failed downloads are returned dl_status - 'active' or 'failed' offset, limit sort order default order is by ctime response dls - download object



Feeds

/api/feed/get - get user's feed list response feeds - list of feed objects

/api/feed/add parameters name - just for user reference url flags - 'notify' or '' pubdate - process only feed items published after this date episode - process only feed items with episode number greater or equal then this number (S01E02 == 102)

/api/feed/update parameters id flags - 'notify' or '' pubdate - process only feed items published after this date episode - process only feed items with episode number greater or equal then this number (S01E02 == 102)

/api/feed/unlink parameters id - if id is omited then all feeds fill be unlinked

/api/feed/reset - reset and restart a failed feed parameters id



Files

/api/file/info - get files basic info get names and video info w/o account specific data (labels, feeds etc) parameters info_hash - array of info_hash'es. response files - arrays of file objects found_files - found_rows()

get names and video info w/o account specific data (labels, feeds etc) /api/file/get - get files parameters id - single id or arrays of ids, if used then all params below are ignored, if not used then all linked files are returned link_dt_gt - select files linked after this date (mysql date format) type - enum('default','audio','video') src - source of file, enum('','upload','torrent','http','ed2k'); upload: http upload using html form, torrent: bittorrent proxy service tag - optional, select by searching a tag in tags offset, limit sort_col - sort by column, valid options are: ctime - time when file was linked to user account size - size name - name sort_type - 'asc' or 'desc' name_like - filter by substring unlinked - if unlinked=1 then only unlinked files will be selected response files - arrays of file objects found_files - found_rows()

/api/file/link - link files parameters id - array of file ids

/api/file/protect - protect/unprotect files parameters id - array of file ids is_protected - 1 or 0

/api/file/unlink - unlink files parameters id - array of file ids, if id is used then all other params are ignored do - unlink_all, unlink_by_feed or unlink_by_label id_feeds - unlink by feed ids id_labels - unlink by label ids

/api/file/clear When /api/file/unlink is called file link object is just moved to another table. To purge file link completely you need to call clear . Unlinked files can be selected by passing unlinked=1 to /api/file/get so a Trash can be implemented. parameters same as for unlink

When /api/file/unlink is called file link object is just moved to another table. To purge file link completely you need to call . Unlinked files can be selected by passing unlinked=1 to /api/file/get so a Trash can be implemented. /api/file/update_link - edit link (file) properties parameters id - file id notes

/api/dl/unlink - unlink download parameters id - array of dl ids

Labels

/api/label/get parameters [no parameters] response an array of labels

/api/label/upsert parameters id, name, id_labels, sorder response label object notes if an id is provided or a name is not unique then a record will be updated, otherwise it will be inserted

/api/label/link - link a label with a file parameters id_files - array of file ids, id_labels - arrays of label ids

/api/label/unlink - unlink a label from a file parameters id_files - array of file ids, id_labels - arrays of label ids

Login and Registration

/api/login/login parameters login, pwd response api_key - you can use it for further request if you client doesn't support cookies

/api/login/reg parameters login, pwd, re_pwd, email code - invite code, currently an invite code is required to register. In general it's a better if user is registered using website. For ex. facebook registrations can be processed only through website. response array of errors if any

/api/login/logout

/api/login/recover - send password recovery link parameters login or email

/api/login/save_pwd - save new password using password recovery link parameters hash, pwd, re_pwd

/api/login/email_ver - email verification parameters hash

User profile and settings

/api/account/info - info about account and premium response user: login, email, ctime, email_is_ver premium: bw_{used,limit}_{month,total,extra} - bandwidth counters and limits duration - duration of premium in seconds time_left bw_month_time_left - how long to wait when bw_used_month will be reset back to bw_limit_month is_not_last_month - in case of multi months premiums name - name of premium from_dt to_dt to_dt_next_max - max(to_dt) of a next premiums if any

/api/account/change_pwd parameters old_pwd, pwd, re_pwd

/api/account/change_email - change email and send email verification link parameters email, re_email

/api/account/resend_email_ver - send email verification link

/api/account/save_prefs - save preferences parameters prefs_flags - array of flags, currently only supported is 'moderated_full', ex. prefs=flags=moderated_full prefs_json - a simple text field dl_uri_scheme - enum('','http','https') dl_uri_host - enum('','gcdn.biz') dl_uri_port - enum('','30084','30082') dl_uri_key - int unsigned not null default 0; used to reset existsing download links notes Ff a param doesn't exists in query then it will not updated. If params value is '' then a default value will be used if any.

/api/account/txns - list of transactions response premiums and addons arrays

/api/account/get_invites - get invites response array of unused invites

Misc.

/api/ping does nothing, usefull for authentication tests

does nothing, usefull for authentication tests /api/bug_report send bug report by email to admin. parameters any parameters

Metasearch engine

/api/plugins/metasearch - search for torrents parameters q - query offset - offset, default: 0 limit - limit, default: 25 and all other parameters supported by the search /search page. response stats - query stats hash files - array of files notes if a torrent was never been downloaded then only this properties will be provided: name, info_hash, size. Use info_hash to add such torrent to downloads



API objects