Webmaster API
Get your API key
You can find it on «Settings» page https://turbobit.net/user/settings
Also if you need links for hitfile.net, enable «Automatically upload files to all active services»
and «Automatically create and display links for hitfile.net» options
HTTP Upload
1. Get upload server details
[POST] https://turbobit.net/v001/upload/http/server
Body
Key |
Value |
Description |
none |
none |
none |
Response
{
"url": "http://s209.turbobit.net/uploadfile",
"params": {
"apptype": "fd1",
"upload_info": "F+ZuaV6EN1a4cdftUSIX4ZwMCswN9jB58d0/"
},
"result": true
}
2. Upload file
[POST] server url (parameter from the previous query result)
Headers
Key |
Value |
Description |
none |
none |
none |
Body
Key |
Value |
Description |
apptype |
fd1 |
Parameter from the previous query result |
upload_info |
F+ZuaV6EN1a4cdftUSIX4ZwMCswN9jB58d0/ |
Parameter from the previous query result |
folder_id |
142 |
(optional) if your want upload file to a specific folder |
Filedata |
file.zip |
Your file |
Response
{
"result":true,
"id":"1i555e01nb3",
"cid":"6dcUDq1",
"message":"Everything is ok"
}
id - turbobit.net file id
cid - hitfile.net file id
Full example using PHP
reporting(E_ALL);
ini_set('display_errors', '1');
function turbobit_upload($apiKey, $file, $folderId = 0)
{
// Get upload server
$ch = curl_init('https://turbobit.net/v001/upload/http/server/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-API-KEY: $apiKey"));
$postResult = curl_exec($ch);
curl_close($ch);
$res = json_decode($postResult);
if (!$res->result) {
print $res->message;
return false;
}
// POST variables
$postParams = array();
foreach ($res->params as $field => $value) {
$postParams[$field] = $value;
}
$postParams['folder_id'] = intval($folderId);
if (function_exists('curl_file_create')) { // php 5.5+
$postParams['Filedata'] = curl_file_create($file);
} else { //
$postParams['Filedata'] = '@' . realpath($file);
}
// Upload file
$ch = curl_init($res->url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postParams);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
print "Unable to upload file.";
return false;
}
curl_close($ch);
$res = json_decode($postResult, true);
if (!($res['result'])) {
print "Upload error:" . $res['message'];
return false;
}
// Make file links from IDs
$links = array();
$links['turbobit'] = "https://turbobit.net/{$res['id']}.html";
if (isset($res['cid'])) {
$links['hitfiles'] = "https://hitfile.net/{$res['cid']}";
}
return $links;
}
$apiKey = 'YOUR_KEY';
// from https://turbobit.net/user/settings
$links = turbobit_upload($apiKey, '/home/user/tmp/file.zip', 0);
print_r($links);
/*
Array
(
[turbobit] => https://turbobit.net/1i555e01nb3.html
[hitfiles] => https://hitfile.net/6dcUDq1
)
*/
Get file info
[GET] https://turbobit.net/v001/files/
*fileId*
Body
Key |
Value |
Description |
none |
none |
none |
Response
{
"id":"nn9ll2t512ot",
"name":"Archive.zip",
"size":"1299992",
"state":"active",
"folder_id":"0",
"created_date":"2018-09-17 23:58:00",
"deleted_date":"2018-10-27 23:58:00"
}
File Search
[GET] https://turbobit.net/v001/files/search?name=name&page=1
Body
Key |
Value |
Description |
name |
search string |
File name or part of file name |
page |
page ID |
Query returns 20 results per page |
Response
{
"results": [
{
"id":"nn9ll2t5j2ot",
"name":"Archive.zip",
"size":"1299992",
"state":"active",
"folder_id":"0",
"created_date":"2018-09-17 23:11:00",
"deleted_date":"2018-10-27 23:11:00"
},
{
"id":"hhfnn222jdls",
"name":"Archive2.zip",
"size":"1291192",
"state":"active",
"folder_id":"0",
"created_date":"2018-09-17 23:58:00",
"deleted_date":"2018-10-27 23:58:00"
},
],
"page": 1,
"totalPages": 10
}
Make file copy
[GET] https://turbobit.net/v001/files/
*fileId*/copy
Body
Key |
Value |
Description |
none |
none |
none |
Response
{
"id": "hh17hhdllajf",
"result": true
}
id - file ID of copied file
Make file copy (extended method)
[POST] https://turbobit.net/v001/files/copy
Body
Key | Value | Description |
file_id | File ID | Source file ID |
folder_id | Folder ID | Move a copy of the file to the selected folder |
Response
{
"id": "hh17hhdllajf",
"name": "File name",
"size": "1024",
"folder_id": "18954",
"created_date": "2021-08-29T16:03:15+03:00",
"result": true
}
id - file ID of copied file
folder_id - destination folder ID of file copy
Get folders list
[GET] https://turbobit.net/v001/folders/index
Body
Key | Value | Description |
none | none | none |
Response
{
"folders": [
{
"id": 1258713,
"name": "Video",
"files_count": "44",
"parent_id": null,
"created_date": "2018-01-01T12:34:42+03:00"
},
{
"id": 1267138,
"name": "Clips",
"files_count": "20",
"parent_id": "1258713",
"created_date": "2018-01-03T11:21:32+05:00"
}
],
"result": true
}
Remote upload
1. Add file to remote upload queue
[POST] https://turbobit.net/v001/remote_upload
Body
Key |
Value |
Description |
url |
http://domain.com/file_1.zip\n
http://domain.com/file_2.zip
|
List of urls to upload (each url must be on new line) |
service |
http
|
Remote service type (http, ftp, 1fichier, depositfiles, fileal, fileboom, filejoker, hitfile, keep2share, nitroflare, rapidgator, turbobit, uploadable, uploaded) |
login |
none
|
Authorization credentials for remote service |
password |
none
|
Authorization credentials for remote service |
Response
{
"message": [
{
"msg": "File has been added to the upload queue.",
"url": "http://domain.com/file_1.zip",
"url_download_id": "458AB57FCA8A26B51CEE3B428527832A",
"success": true
}
],
"result": true
}
2. Check download queue status
[GET] https://turbobit.net/v001/remote_upload/status/
*url_download_id*
*url_download_id* - parameter from the previous query result
Body
Key |
Value |
Description |
none |
none |
none |
Response
{
"result": true,
"state": "created",
"progress": "0",
"state": "queue",
"progress": "0",
"state": "running",
"progress": "50",
"state": "finished",
"progress": "100",
"file_id": "dyeswq5sy7vt",
"state": "error",
"error": "Error message"
}