Our API allows you to access and cache your files to our service using time based API key (Key will change every 7 days).
All requests must be done via GET/POST
method.
Status code | Meaning | Additional |
---|---|---|
200 |
Success | |
401 |
Invalid API key or insufficient permissions. | |
403 |
Invalid or missing input data | Specific field is stated in the returned error. |
404 |
Invalid endpoint | |
429 |
Rate limit reached | The API has endpoint specific rate limiting. |
[GET]
/GetApiKeyGet API key
https://hypercache.net/api/GetApiKey
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://hypercache.net/api/GetApiKey",
CURLOPT_HEADER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => false,
CURLOPT_TIMEOUT => 10,
]);
$curl_response = curl_exec($ch);
$curl_error = curl_error($ch);
curl_close($ch);
if ($curl_error)
{
echo "cURL Error #:" . $curl_error;
}
else
{
echo $curl_response;
}
curl -X GET \ https://hypercache.net/api/GetApiKey
const request = require('request'); const options = { method: 'GET', url: 'https://hypercache.net/api/GetApiKey', }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{ "status": (bool) true|false, "message": "string", "response": [ "key": string, "permission": [] ] }
[POST]
/GetTorrentChecks whether torrent with given hash exists
https://hypercache.net/api/GetTorrent
Username | Password |
---|---|
API_KEY | leave empty |
Hypercache uses Basic authentication, which means you must pass the following to the request header:
Authentication: Basic base64(API_KEY:)
The extra :
is required, because it separates the username and the password, but in our case the password is empty.
Request name | Request value | Explanation |
---|---|---|
info_hash | string = "INFO_HASH"
|
It must be a valid info_hash value |
<?php
$auth_key = base64_encode('API_KEY:'); //DO NOT REMOVE ":"!
$request_body = [
'info_hash' => 'REPLACE_INFO_HASH',
];
$request_header = [
"Authorization: Basic {$auth_key}",
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://hypercache.net/api/GetTorrent",
CURLOPT_HEADER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $request_body,
CURLOPT_HTTPHEADER => $request_header,
CURLOPT_TIMEOUT => 10,
]);
$curl_response = curl_exec($ch);
$curl_error = curl_error($ch);
curl_close($ch);
if ($curl_error)
{
echo "cURL Error #:" . $curl_error;
}
else
{
echo $curl_response;
}
curl -X POST \ -H "Authorization: Basic REPLACE_BASIC_AUTH" \ -F "info_hash=REPLACE_INFO_HASH" \ https://hypercache.net/api/GetTorrent
const request = require('request'); const options = { method: 'POST', url: 'https://hypercache.net/api/GetTorrent', headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}, body: { 'info_hash': 'REPLACE_INFO_HASH' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{ "status": (bool) true|false, "message": "string" }
[POST]
/UploadTorrenthttps://hypercache.net/api/UploadTorrent
Username | Password |
---|---|
API_KEY | leave empty |
Hypercache uses Basic authentication, which means you must pass the following to the request header:
Authentication: Basic base64(API_KEY:)
The extra :
is required, because it separates the username and the password, but in our case the password is empty.
Request name | Request value | Explanation |
---|---|---|
torrent | file = "/location/to/your_file.torrent",
mime = "application/x-bittorrent",
name = "torrent_name.torrent",
|
It must be a valid torrent file |
<?php
$auth_key = base64_encode('API_KEY:'); //DO NOT REMOVE ":"!
$request_body = [
'torrent' => new CurlFile('/location/to/your_file.torrent', 'application/x-bittorrent', 'torrent_name.torrent'),
];
$request_header = [
"Authorization: Basic {$auth_key}",
"Content-Type: multipart/form-data",
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://hypercache.net/api/UploadTorrent",
CURLOPT_HEADER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $request_body,
CURLOPT_HTTPHEADER => $request_header,
CURLOPT_TIMEOUT => 10,
]);
$curl_response = curl_exec($ch);
$curl_error = curl_error($ch);
curl_close($ch);
if ($curl_error)
{
echo "cURL Error #:" . $curl_error;
}
else
{
echo $curl_response;
}
curl -X POST \ -H "Authorization: Basic REPLACE_BASIC_AUTH" \ -F "[email protected]/location/to/your_file.torrent" \ https://hypercache.net/api/UploadTorrent
const request = require('request'); const options = { method: 'POST', url: 'https://hypercache.net/api/UploadTorrent', headers: {'Content-Type': 'multipart/form-data', Authorization: 'Basic REPLACE_BASIC_AUTH'}, body: { 'torrent': fs.createReadStream('/location/to/your_file.torrent') } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{ "status": (bool) true|false, "message": "string" }
Remember, Google is your friend.