Introduction

We at Seedr are strong believers in automation. To allow you to implement more exciting features remotely we will offer numerous APIs now and in the future. Currently being released is the REST API for controlling Seedr through scripts.

Code samples will be released periodically for different uses of the system, so stay up to date with the blog (:

Last updated on Nov 26, 2015

Where can I use this?

Please note! The Seedr REST API is only offered to free users for a limited time! feel free to upgrade to keep using after Dec 14th, 2015

The API is currently only available with basic HTTP auth, making it insecure for anything but personal-use scripts.
Feel free to use the API everywhere for any purpose, but you may not request SEEDR usernames/passwords from users in any form!

We are currently in Alpha testing of the Seedr oAuth endpoint, which is implemented in the chrome plugin and Kodi extension.

Once the public API is ready, code samples will be released as open source for you to use freely.

Last updated on Nov 26, 2015

How to Use

The Seedr REST API can be used with any tool supporting JSON and HTTP requests.
Data is passed into the API using regular HTTP params, with output resulting from the requests returned in JSON.

Note that a torrent at 100% is fully downloaded, and 101% means it has been moved to a folder.

CURL

# List contents of root folder in JSON
curl -X GET -u "email:password" https://www.seedr.cc/rest/folder

# List contents of folder by ID in JSON
curl -X GET -u "email:password" https://www.seedr.cc/rest/folder/{folder_id}

# Download folder as ZIP file (make sure to follow redirects)
curl -o filename.zip -L -X GET -u "email:password" https://www.seedr.cc/rest/folder/{folder_id}/download

# Download file 
curl -o -L -X GET -u "email:password" https://www.seedr.cc/rest/file/{file_id}

# Get MP4 converted video
curl -o -L -X GET -u "email:password" https://www.seedr.cc/rest/file/{file_id}/mp4

# Get HLS converted video
curl -o -L -X GET -u "email:password" https://www.seedr.cc/rest/file/{file_id}/hls

# Get File Image ( if exists )
curl -o -L -X GET -u "email:password" https://www.seedr.cc/rest/file/{file_id}/image

# Get File Thumbnail 32px * relative height ( if exists )
curl -o -L -X GET -u "email:password" https://www.seedr.cc/rest/file/{file_id}/thumbnail

# Get User Data
curl -X GET -u "email:password" https://www.seedr.cc/rest/user

# Get Torrent Data
curl -X GET -u "email:password" https://www.seedr.cc/rest/torrent/{torrent_id}

# Add Torrent

## Magnet
curl -X POST --data "magnet={magnet_link}" -u "email:password" https://www.seedr.cc/rest/torrent/magnet
## URL
curl -X POST --data "torrent_url={torrent_url}" -u "email:password" https://www.seedr.cc/rest/torrent/url
## Local File
curl -X POST -F "torrent_file=@full_path_to_torrent_file" -u "email:password" https://www.seedr.cc/rest/torrent/file

PHP

<?php
function seedr_curl_request($username,$password,$endpoint,$method='GET',$data=array(),$is_download=false) {
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, 'https://www.seedr.cc/rest/' . $endpoint);

    $opts_array = array(
	    CURLOPT_RETURNTRANSFER => 1,
	    CURLOPT_URL => 'https://www.seedr.cc/rest/' . $endpoint,
	    CURLOPT_USERAGENT => 'Codular Sample cURL Request',
	    CURLOPT_POSTFIELDS => $data,
	    CURLOPT_USERPWD => "$username:$password",
	    CURLOPT_CUSTOMREQUEST => $method
	);

	curl_setopt_array($curl, $opts_array);

    $resp = curl_exec($curl);
    // Close request to clear up some resources
    curl_close($curl);

    return $is_download ? $resp : json_decode($resp);
}
$u = "#username#";
$p = "#password";

# Get contents of root folder into array
$root_folder = seedr_curl_request($u,$p,'folder','GET',array());
var_dump($root_folder);

# Get contents of the first subfolder
$sub = seedr_curl_request($u,$p,"folder/$root_folder->folders[0]->id");

# Download first subfolder
$zip = seedr_curl_request($u,$p,"folder/$root_folder->folders[0]->id/download",'GET',array(),true);

# Download first file in subfolder
$file = seedr_curl_request($u,$p,"file/$sub->files[0]->id",'GET',array(),true);

# Get MP4 url for first file
$file = seedr_curl_request($u,$p,"file/$sub->files[0]->id/mp4");

# Get HLS url for first file
$file = seedr_curl_request($u,$p,"file/$sub->files[0]->id/hls");

# delete first file
seedr_curl_request($u,$p,"file/$sub->files[0]->id",'DELETE');

# delete first folder
seedr_curl_request($u,$p,"folder/$sub->id",'DELETE');

# Add Torrent
#magnet
$magnet_link = "#magnet#";
seedr_curl_request($u,$p,"torrent/magnet",'POST',array('magnet' => $magnet_link));

#url
$torrent_url = "#torrent_url#";
seedr_curl_request($u,$p,"torrent/url",'POST',array('torrent_url' => $torrent_url));

?>

Last updated on Jan 11, 2016

Methods

Last updated on Nov 26, 2015

Folders

Folder methods are used for interacting with Seedr folders

Last updated on Nov 26, 2015

List Folder Contents

For folder by id
GET /rest/folder/{folder_id}

For root folder
GET /rest/folder

parameters

No parameters needed
Last updated on Nov 26, 2015

Download Folder

GET /rest/folder/{folder_id}/download

parameters

No parameters needed
Last updated on Nov 26, 2015

Create Folder

POST /rest/folder/{folder_id}/rename

parameters

name: full path to folder from root ( for example some_folder/subfolder/edgy ) -> the parent folder must exist for this to work
Last updated on Nov 26, 2015

Rename Folder

POST /rest/folder/{folder_id}/rename

parameters

rename_to: new folder name, up to 255 characters
Last updated on Nov 26, 2015

Delete Folder

DELETE /rest/folder/{folder_id}

parameters

None Needed
Last updated on Nov 26, 2015

Files

Files methods are used for interacting with Seedr files

Last updated on Nov 26, 2015

Download File

GET /rest/file/{file_id}

parameters

No parameters needed
Last updated on Nov 26, 2015

Get File MP4 URL

GET /rest/file/{file_id}/mp4

parameters

No parameters needed
Last updated on Nov 26, 2015

Get File HLS URL

GET /rest/file/{file_id}/hls

parameters

No parameters needed
Last updated on Nov 26, 2015

Get File Preview Image

GET /rest/file/{file_id}/image

parameters

No parameters needed
Last updated on Nov 26, 2015

Get File Thumbnail(for videos and image files)

GET /rest/{file_id}/thumbnail

parameters

No parameters needed
Last updated on Nov 26, 2015

Rename File

POST /rest/{file_id}/rename

parameters

rename_to : new file name
Last updated on Nov 26, 2015

Delete File

DELETE /rest/file/{file_id}

parameters

None Needed
Last updated on Nov 26, 2015

Torrents

Folder methods are used for interacting with Seedr downloading torrents

Last updated on Nov 26, 2015

Add Torrent Using Magnet

POST /rest/torrent/magnet

parameters

magnet: the magnet link
Last updated on Nov 26, 2015

Add Torrent From A URL

POST /rest/torrent/url

parameters

url: url to download the torrent from
Last updated on Nov 26, 2015

Add Torrent From A File

POST /rest/torrent/url

parameters

torrent_file: .torrent file attachment to upload
Last updated on Nov 26, 2015

Delete a Torrent

DELETE /rest/torrent/{torrent_id}

parameters

None Needed
Last updated on Jan 06, 2017

User Information

User methods are used for fetching information about the mentioned user

Last updated on Nov 26, 2015

Get Account Information

GET /rest/user

parameters

None Needed
Last updated on Nov 26, 2015

Zip

This endpoint is used to create a compounded download of unrelated files/folders.

GET /rest/zip

parameters

archive_arr: an array of objects of files and folders -

{ type:'file' , id:{file_id} },
{ type:'folder' , id:{folder_id} }

Last updated on Nov 26, 2015