t411 API Documentation

Authorization

Retrieve user id and token (ttl=90days):


        POST:
            /auth/
            username=myname
            password=secret
        RESULT:
        {
            token: 12345:123:ASDZXCQWEPOILKJMNB
        }
        ERROR:
        {
            error: "User not found",
            code: 101
        }
    

All other requests requires the Authorization header:


        Authorization: 12345:123:QWEASDZXCIOPJKLBNM
    

Copy and paste your token from previously request (this needed for all other examples)

Errors

User Errors

  1. User not found
  2. Account is not confirmed
  3. Account is disabled
  4. Account disabled due to hacks and cheats
  5. Account disabled by administrator
  6. Authorization limit reached
  7. Wrong Password

Token Errors

  1. Token has expired. Please login
  2. Invalid token

Torrent Errors

  1. Torrent not found
  2. Torrent file not found
  3. Torrent is banned
  4. Torrent is hidden

Bookmarks

  1. Bookmark not found
  2. Duplicate bookmark record
  3. Can't save bookmark. Internal server error

Categories

  1. Category not found

Users

Retrieve profile


        GET:
            /users/profile/{id}
        RESULT:
        {
            "username":"Username",
            "gender":"Male",
            "age":"0",
            "avatar":"\/\/images\/avatar\/123\/456123_Username.gif?34551",
            "downloaded":"10814091744",
            "uploaded":"75162042368"
        }
    

Torrents

Categories

Get categories tree


        GET:
            /categories/tree/
        RESULT:
        {
            "12":{              // category ID
                "id":"12",      // category ID, again
                "pid":"0",      // parent category ID
                "name":"video", // category name
                "cats": {
                    "13":{"id":"13","pid":"12","name":"films"},    // sub category #13
                    "14":{"id":"14","pid":"12","name":"cartoons"}  // sub category #14
                }
            },
            "15":{...}
        }
    

Terms

Get list of all terms linked to categories


        GET:
            /terms/tree/
        RESULT:
        {
            "12":{              // category ID
                "11":{          // term type ID
                    "type":"Application - Genre", // term type internal name
                    "mode":"single",              // term type mode - single or multi
                    "terms":{
                        "123":"Antivirus",        // term ID and name
                        "345":"Torrent clients"
                    }
                }
            },
            "15":{...}
        }
    

Search

Simple search by all categories


        GET:
            /torrents/search/{query}
        RESULT:
        {
            "query":"avatar"
            "total":2,
            "offset":0,
            "limit":100,
            "torrents":[
                {
                    "id":123123,
                    "name":"Avatar",
                    "category":"321",
                    "seeders":"11",
                    "leechers":"2",
                    "comments":"8",
                    "isVerified":"1",
                    "added":"2013-01-15 16:14:14",
                    "size":"2670809119",
                    "times_completed":"1256",
                    "owner":"7589510",
                    "categoryname":"Animation",
                    "categoryimage":"t411-animation.png",
                    "username":"MegaUsername",
                    "privacy":"normal"
                },
                {...}
            ]
        }


    

Set category ID

Get third page with limit by 5 torrents per page


        GET:
            /torrents/search/{query}?offset=10&limit=5
    

Get search by terms (where 7 is term type ID)


        GET:
            /torrents/search/{query}?cat=631&term[7][]=15&term[7][]=16
    

One term search

Two term search

Details


        GET:
            /torrents/details/{id}
        RESULT:
        {
            "id":123,
            "name":"Very scary movie",
            "rewriteName":"very-scary-movie",
            "category":12,
            "categoryName":"Movie",
            "terms":{
                "video quality":"1080p"
            }
        }
    

Download


        GET:
            /torrents/download/{id}
        RESULT:
            ... file
    

Top 100

Top Today

Top Week

Top Month

Bookmarks

List of bookmarks

Create bookmark

Send torrent's Id for save it as bookmark


        POST:
            /bookmarks/save/{torrentId}
        RESULT:
        {
            "id":123
        }
    

Remove bookmark by torrent Id


        DELETE:
            /bookmarks/delete/{torrentId}
        RESULT:
        {
            1
        }
    

Remove set of bookmarks by one request


        DELETE:
            /bookmarks/delete/{torrentId},{torrentId},{torrentId}
        RESULT:
        {
            3
        }