Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Torrent API

Introduction

UNIT3D is offering a new {JSON:API}. If you haven't already head over to your profile. Hover Settings nav and click API Key. From there you can generate or reset your API Key.

Ecosystem

Torrent auto uploaders

API authentication

There are several ways of passing the API token to UNIT3D. We'll discuss each of these approaches while using the Guzzle HTTP library to demonstrate their usage. You may choose any of these approaches based on your needs to communicate with our API.

  • Query string

    UNIT3D's API consumers may specify their token as an api_token query string value:

    $response = $client->request('GET', '/api/torrents?api_token=YOUR_TOKEN_HERE);
  • Request payload

    UNIT3D's API consumers may include their API token in the request's form parameters as an api_token:

    $response = $client->request('POST', '/api/torrents', [ 'headers' => [ 'Accept' => 'application/json', ], 'form_params' => [ 'api_token' => 'YOUR_TOKEN_HERE', ], ]);
  • Bearer token

    UNIT3D's API consumers may provide their API token as a Bearer token in the Authorization header of the request:

    $response = $client->request('POST', '/api/torrents', [ 'headers' => [ 'Authorization' => 'Bearer YOUR_TOKEN_HERE', 'Accept' => 'application/json', ], ]);

API endpoints

Upload a torrent

Endpoint: POST /api/torrents/upload

Parameters:

ParameterTypeDescription
torrentfile.torrent file
nfofile.nfo file
namestringTorrent name
descriptionstringTorrent description
mediainfostringMediaInfo text output
bdinfostringBDInfo quick summary output
category_idintCategory ID
type_idintType ID
resolution_idintResolution ID
region_idintRegion ID
distributor_idintDistributor ID
season_numberintSeason number (TV only)
episode_numberintEpisode number (TV only)
tmdbintTMDB ID
imdbintIMDB ID
tvdbintTVDB ID
malintMAL ID
igdbintIGDB ID (Games only)
anonymousboolShould the uploader's username be hidden?
personal_releaseboolIs the torrent's content created by the uploader?
internal*boolIs the torrent an internal release?
refundable*boolIs the torrent refundable?
featured*boolShould the torrent be featured on the front page?
free*intPercentage (0-100) of the torrent's size that is free to leech
fl_until*intNumber of days the torrent should offer freeleech
doubleup*boolShould the torrent offer double upload?
du_until*intNumber of days the torrent should offer double upload
sticky*boolShould the torrent be stickied on the torrent index?
mod_queue_opt_in*boolShould the torrent be sent to moderation queue?

*Only available to staff and internal users.

Fetch a torrent

Endpoint: GET /api/torrents/:id

Example:

https://unit3d.site/api/torrents/39765?api_token=YOURTOKENHERE

Fetch torrents index (latest 25 torrents)

Endpoint: GET /api/torrents

Example:

https://unit3d.site/api/torrents?api_token=YOURTOKENHERE

Filter torrents

Endpoint: GET /api/torrents/filter

Optional Parameters:

ParameterTypeDescription
perPageintAmount of results to return per page (default: 25)
sortFieldstringField to sort by
sortDirectionstringDirection to sort the results. One of: asc (Ascending), desc (Descending) (default: asc)
namestringFilter by the torrent's name
descriptionstringFilter by the torrent's description
mediainfostringFilter by the torrent's MediaInfo
bdinfostringFilter by the torrent's BDInfo
uploaderstringFilter by the torrent uploader's username
keywordsstringFilter by any of the torrent's keywords (Multiple keywords can be comma-separated)
startYearintReturn only torrents whose content was released after or in the given year
endYearintReturn only torrents whose content was released before or in the given year
categoriesint[]Filter by the torrent's category
typesint[]Filter by the torrent's type
resolutionsint[]Filter by the torrent's resolution
genresint[]Filter by the torrent's genre
tmdbIdintFilter by the torrent's TMDB ID
imdbIdintFilter by the torrent's IMDB ID
tvdbIdintFilter by the torrent's TVDB ID
malIdintFilter by the torrent's MAL ID
playlistIdintReturn only torrents within the playlist of the given ID
collectionIdintReturn only torrents within the collection of the given ID
freeintFilter by the torrent's freeleech discount (0-100)
doubleupboolFilter by if the torrent offers double upload
featuredboolFilter by if the torrent is featured on the front page
refundableboolFilter by if the torrent is refundable
highspeedboolFilter by if the torrent has seeders whose IP address has been registered as a seedbox
internalboolFilter by if the torrent is an internal release
personalReleaseboolFilter by if the torrent's content is created by the uploader
aliveboolFilter by if the torrent has 1 or more seeders
dyingboolFilter by if the torrent has 1 seeder and has been downloaded more than 3 times
deadboolFilter by if the torrent has 0 seeders
file_namestringFilter by the name of a file within a torrent
seasonNumberintFilter by the torrent's season number
episodeNumberintFilter by the torrent's episode number

Example:

https://unit3d.site/api/torrents/filter?tmdbId=475557&categories[]=1&api_token=YOURTOKENHERE

Personal account info

Endpoint: GET /api/user

Response:

{"username":"UNIT3D","group":"Owner","uploaded":"50 GiB","downloaded":"1 GiB","ratio":"50","buffer":"124 GiB","seeding":0,"leeching":0,"seedbonus":"0.00","hit_and_runs":0}

Example:

https://unit3d.site/api/user?api_token=YOURTOKENHERE