Introduction
The Seedr REST API v1 will be replaced in coming months with REST API v2 and our oAuth API. All the APIs will be mostly limited to premium users.
The API below is accessible only to relevant premium account types, as mentioned in our upgrade pages.
Code examples are provided in multiple languages.
Where can I use this?
Rest API v1 is only available to use with HTTP basic auth, making it only secure for personal use.
How to use
# 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 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 Transfer Data
curl -X GET -u "email:password" https://www.seedr.cc/rest/transfer/{id}
# Add Transfer
## Magnet
curl -X POST --data "magnet={magnet_link}" -u "email:password" https://www.seedr.cc/rest/transfer/magnet
## URL
curl -X POST --data "url={url}" -u "email:password" https://www.seedr.cc/rest/transfer/url
## Local File
curl -X POST -F "file=@full_path_to_file" -u "email:password" https://www.seedr.cc/rest/transfer/file
<?php
function seedr_curl_request($username,$password,$endpoint,$method='GET',$data=[],$is_download=false) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://www.seedr.cc/rest/' . $endpoint);
$opts_array = [
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'https://www.seedr.cc/rest/' . $endpoint,
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);
# Download first file in subfolder
$file = seedr_curl_request($u,$p,"file/$sub->files[0]->id",'GET',array(),true);
# Get HLS url for first file
$file = seedr_curl_request($u,$p,"file/$sub->files[0]->id/
?>
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 file at 100% is fully downloaded, and 101% means it has been moved to a folder.
Methods
Folders
List Folder Contents
# List contents of folder by ID in JSON
curl -X GET -u "email:password" https://www.seedr.cc/rest/folder/{folder_id}
# List contents of root folder in JSON
curl -X GET -u "email:password" https://www.seedr.cc/rest/folder
# Get contents of the first subfolder
$sub = seedr_curl_request($u,$p,"folder/$root_folder->folders[0]->id");
# Get contents of root folder into array
$root_folder = seedr_curl_request($u,$p,'folder','GET',array());
var_dump($root_folder);
Folder by ID:
GET /rest/folder/{folder_id}
URL Parameters:
Parameter | Description |
---|---|
folder_id | ID of the folder to list |
Root Folder:
GET /rest/folder
Parameters:
No parameters needed.
Download Folder
# 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 first subfolder
$zip = seedr_curl_request($u,$p,"folder/$root_folder->folders[0]->id/download",'GET',array(),true);
GET /rest/folder/{folder_id}/download
URL Parameters:
Parameter | Description |
---|---|
folder_id | ID of the folder to download |
Create Folder
# Create folder
curl -X POST -u "email:password" https://www.seedr.cc/rest/folder
# Create folder
seedr_curl_request($u,$p,"folder",'POST',['path' => 'full/folder/path']);
POST /rest/folder
POST Parameters:
Parameter | Description |
---|---|
path | Full path from root to the created folder. Parent folder must exist |
Rename Folder
# Rename folder
curl -X POST -u "email:password" https://www.seedr.cc/rest/folder/{folder_id}/rename
# Rename folder
seedr_curl_request($u,$p,"folder/{folder_id}/rename",'POST',['name' => 'new_folder_name']);
POST /rest/folder/{folder_id}/rename
URL Parameters:
Parameter | Description |
---|---|
folder_id | ID of the folder to rename |
POST Parameters:
Parameter | Description |
---|---|
rename_to | new folder name, up to 255 characters |
Delete Folder
### Delete folder
curl -X POST -u "email:password" https://www.seedr.cc/rest/folder/{folder_id}/delete
# Delete first folder
seedr_curl_request($u,$p,"folder/$sub->id/delete",'POST');
DELETE /rest/folder/{folder_id}
URL Parameters:
Parameter | Description |
---|---|
folder_id | ID of the folder to delete |
Files
Download File
# Download file
curl -o -L -X GET -u "email:password" https://www.seedr.cc/rest/file/{file_id}
# Download first file in subfolder
$file = seedr_curl_request($u,$p,"file/$sub->files[0]->id",'GET',array(),true);
GET /rest/file/{file_id}
URL Parameters:
Parameter | Description |
---|---|
file_id | ID of the file to download |
Get File HLS URL
# Get HLS converted video
curl -o -L -X GET -u "email:password" https://www.seedr.cc/rest/file/{file_id}/hls
# Get HLS url for first file
$file = seedr_curl_request($u,$p,"file/$sub->files[0]->id/hls");
GET /rest/file/{file_id}/hls
URL Parameters:
Parameter | Description |
---|---|
file_id | ID of the file to retrieve |
Get File Preview Image
# Get File Preview Image
curl -o -L -X GET -u "email:password" https://www.seedr.cc/rest/file/{file_id}/image
# Get File Preview Image
$file = seedr_curl_request($u,$p,"file/$sub->files[0]->id/image");
GET /rest/file/{file_id}/image
URL Parameters:
Parameter | Description |
---|---|
file_id | ID of the file to preview |
Get File Thumbnail
# 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 File Preview Image (if it exists)
$file = seedr_curl_request($u,$p,"file/$sub->files[0]->id/thumbnail");
GET /rest/{file_id}/thumbnail
URL Parameters:
Parameter | Description |
---|---|
file_id | ID of the thumbnail's file |
Rename File
# Rename file
curl -X POST -u "email:password" https://www.seedr.cc/rest/file/{file_id}/rename
# Rename file
seedr_curl_request($u,$p,"file/{file_id}/rename",'POST',['name' => 'new_file_name']);
POST /rest/{file_id}/rename
URL Parameters:
Parameter | Description |
---|---|
file_id | ID of the file to rename |
Query Parameters:
Parameter | Description |
---|---|
rename_to | new file name |
Delete File
# Delet first file
curl -X POST -u "email:password" https://www.seedr.cc/rest/file/{file_id}/delete
# Delete first file
seedr_curl_request($u,$p,"file/$sub->files[0]->id/delete",'POST');
DELETE /rest/file/{file_id}
URL Parameters:
Parameter | Description |
---|---|
file_id | ID of the file to delete |
Transfers
Add Using a Magnet
## Magnet
curl -X POST --data "magnet={magnet_link}" -u "email:password" https://www.seedr.cc/rest/transfer/magnet
#magnet
$magnet_link = "#magnet#";
seedr_curl_request($u,$p,"transfer/magnet",'POST',array('magnet' => $magnet_link));
POST /rest/transfer/magnet
URL Parameters:
Parameter | Description |
---|---|
magnet | magnet link |
Add from a URL
## URL
curl -X POST --data "url={url}" -u "email:password" https://www.seedr.cc/rest/transfer/url
#url
$url = "#url#";
seedr_curl_request($u,$p,"transfer/url",'POST',array('url' => $url));
POST /rest/transfer/url
URL Parameters:
Parameter | Description |
---|---|
url | url to use to transfer the file |
Add from a File
# Local File
curl -X POST -F "file=@full_path_to_file" -u "email:password" https://www.seedr.cc/rest/transfer/file
# Local File
seedr_curl_request($u,$p,"transfer/file",'POST',array('file' => $file));
POST /rest/transfer/file
Query Parameters:
Parameter | Description |
---|---|
file | attachment to upload |
Delete a File
#Delete file
curl -X POST -u "email:password" https://www.seedr.cc/rest/transfer/{id}
# delete first file
seedr_curl_request($u,$p,"file/$sub->files[0]->id/delete",'POST');
DELETE /rest/transfer/{id}
URL Parameters:
Parameter | Description |
---|---|
id | ID of the file to delete |
User Information
Get Account Information
# Get User Data
curl -X GET -u "email:password" https://www.seedr.cc/rest/user
# Get User Data
seedr_curl_request($u,$p,"user","GET")
GET /rest/user
URL Parameters:
Parameter | Description |
---|---|
user | ID of the user |