📱 Get API Access

🎯 Professional API Documentation

Secure, authenticated access to Terabox Ultra HD streaming links with enterprise-grade security

🔒

HMAC-SHA256

Military-grade encryption

Ultra HD Quality

Best streaming quality

📊

Usage Analytics

Track your API usage

🚀

Rate Limiting

As per your plan

🔐 Authentication

📌 Required Headers: Every request must include X-API-Key, X-Signature, and X-Timestamp headers

How to Create Signature:

Python
import hmac
import hashlib
import time
import json
import requests

API_KEY = "tbx_your_api_key"
API_SECRET = "your_api_secret"
BASE_URL = "https://mswpresents.koyeb.app"

def create_signature(api_secret, timestamp, body):
    """Create HMAC-SHA256 signature"""
    # IMPORTANT: No spaces after separators!
    body_str = json.dumps(body, separators=(',', ':'), sort_keys=True)
    message = f"{timestamp}:{body_str}"
    signature = hmac.new(
        api_secret.encode(),
        message.encode(),
        hashlib.sha256
    ).hexdigest()
    return signature

def get_link(terabox_url):
    timestamp = int(time.time())
    body = {"url": terabox_url}
    signature = create_signature(API_SECRET, timestamp, body)

    headers = {
        "X-API-Key": API_KEY,
        "X-Signature": signature,
        "X-Timestamp": str(timestamp),
        "Content-Type": "application/json"
    }

    # IMPORTANT: Send raw JSON string to match signature
    body_str = json.dumps(body, separators=(',', ':'), sort_keys=True)

    response = requests.post(
        f"{BASE_URL}/api/v1/terabox/get-link",
        data=body_str,  # Use data= with raw string, not json=
        headers=headers
    )
    return response.json()

# Example usage
result = get_link("https://terabox.com/s/1example")
print(result)
Node.js
const crypto = require('crypto');
const axios = require('axios');

const API_KEY = 'tbx_your_api_key';
const API_SECRET = 'your_api_secret';
const BASE_URL = 'https://mswpresents.koyeb.app';

function createSignature(apiSecret, timestamp, body) {
    const bodyStr = JSON.stringify(body);
    const message = `${timestamp}:${bodyStr}`;
    const signature = crypto
        .createHmac('sha256', apiSecret)
        .update(message)
        .digest('hex');
    return signature;
}

async function getLink(teraboxUrl) {
    const timestamp = Math.floor(Date.now() / 1000);
    const body = { url: teraboxUrl };
    const signature = createSignature(API_SECRET, timestamp, body);

    const headers = {
        'X-API-Key': API_KEY,
        'X-Signature': signature,
        'X-Timestamp': timestamp.toString(),
        'Content-Type': 'application/json'
    };

    try {
        const response = await axios.post(
            `${BASE_URL}/api/v1/terabox/get-link`,
            body,
            { headers }
        );
        return response.data;
    } catch (error) {
        console.error('Error:', error.response?.data || error.message);
        throw error;
    }
}

// Example usage
getLink('https://terabox.com/s/1example')
    .then(result => console.log(result))
    .catch(error => console.error(error));
PHP
 $teraboxUrl];
    $signature = createSignature(API_SECRET, $timestamp, $body);

    $headers = [
        'X-API-Key: ' . API_KEY,
        'X-Signature: ' . $signature,
        'X-Timestamp: ' . $timestamp,
        'Content-Type: application/json'
    ];

    $ch = curl_init(BASE_URL . '/api/v1/terabox/get-link');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $response = curl_exec($ch);
    curl_close($ch);

    return json_decode($response, true);
}

// Example usage
$result = getLink('https://terabox.com/s/1example');
print_r($result);

?>
cURL
#!/bin/bash

API_KEY="tbx_your_api_key"
API_SECRET="your_api_secret"
BASE_URL="https://mswpresents.koyeb.app"
TIMESTAMP=$(date +%s)
TERABOX_URL="https://terabox.com/s/1example"

# Create body
BODY='{"url":"'$TERABOX_URL'"}'

# Create signature
MESSAGE="${TIMESTAMP}:${BODY}"
SIGNATURE=$(echo -n "$MESSAGE" | openssl dgst -sha256 -hmac "$API_SECRET" | cut -d' ' -f2)

# Make request
curl -X POST "${BASE_URL}/api/v1/terabox/get-link" \
  -H "X-API-Key: ${API_KEY}" \
  -H "X-Signature: ${SIGNATURE}" \
  -H "X-Timestamp: ${TIMESTAMP}" \
  -H "Content-Type: application/json" \
  -d "$BODY"
Java
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.net.http.*;
import java.net.URI;
import com.google.gson.Gson;

public class TeraboxAPI {
    private static final String API_KEY = "tbx_your_api_key";
    private static final String API_SECRET = "your_api_secret";
    private static final String BASE_URL = "https://mswpresents.koyeb.app";

    public static String createSignature(String apiSecret, long timestamp, String body)
            throws Exception {
        String message = timestamp + ":" + body;
        Mac hmac = Mac.getInstance("HmacSHA256");
        SecretKeySpec secretKey = new SecretKeySpec(apiSecret.getBytes(), "HmacSHA256");
        hmac.init(secretKey);
        byte[] hash = hmac.doFinal(message.getBytes());

        StringBuilder hexString = new StringBuilder();
        for (byte b : hash) {
            String hex = Integer.toHexString(0xff & b);
            if (hex.length() == 1) hexString.append('0');
            hexString.append(hex);
        }
        return hexString.toString();
    }

    public static String getLink(String teraboxUrl) throws Exception {
        long timestamp = System.currentTimeMillis() / 1000;
        String body = new Gson().toJson(Map.of("url", teraboxUrl));
        String signature = createSignature(API_SECRET, timestamp, body);

        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create(BASE_URL + "/api/v1/terabox/get-link"))
            .header("X-API-Key", API_KEY)
            .header("X-Signature", signature)
            .header("X-Timestamp", String.valueOf(timestamp))
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(body))
            .build();

        HttpResponse response = client.send(
            request,
            HttpResponse.BodyHandlers.ofString()
        );
        return response.body();
    }
}
Go
package main

import (
    "bytes"
    "crypto/hmac"
    "crypto/sha256"
    "encoding/hex"
    "encoding/json"
    "fmt"
    "net/http"
    "strconv"
    "time"
)

const (
    APIKey    = "tbx_your_api_key"
    APISecret = "your_api_secret"
    BaseURL   = "https://mswpresents.koyeb.app"
)

func createSignature(apiSecret string, timestamp int64, body []byte) string {
    message := fmt.Sprintf("%d:%s", timestamp, string(body))
    h := hmac.New(sha256.New, []byte(apiSecret))
    h.Write([]byte(message))
    return hex.EncodeToString(h.Sum(nil))
}

func getLink(teraboxURL string) (string, error) {
    timestamp := time.Now().Unix()
    bodyMap := map[string]string{"url": teraboxURL}
    body, _ := json.Marshal(bodyMap)

    signature := createSignature(APISecret, timestamp, body)

    req, _ := http.NewRequest("POST", BaseURL+"/api/v1/terabox/get-link",
                              bytes.NewBuffer(body))
    req.Header.Set("X-API-Key", APIKey)
    req.Header.Set("X-Signature", signature)
    req.Header.Set("X-Timestamp", strconv.FormatInt(timestamp, 10))
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        return "", err
    }
    defer resp.Body.Close()

    var result map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&result)
    resultJSON, _ := json.MarshalIndent(result, "", "  ")
    return string(resultJSON), nil
}

func main() {
    result, _ := getLink("https://terabox.com/s/1example")
    fmt.Println(result)
}
Ruby
require 'openssl'
require 'json'
require 'net/http'
require 'uri'

API_KEY = 'tbx_your_api_key'
API_SECRET = 'your_api_secret'
BASE_URL = 'https://mswpresents.koyeb.app'

def create_signature(api_secret, timestamp, body)
  body_str = body.to_json
  message = "#{timestamp}:#{body_str}"
  OpenSSL::HMAC.hexdigest('SHA256', api_secret, message)
end

def get_m3u8_link(terabox_url)
  timestamp = Time.now.to_i
  body = { url: terabox_url }
  signature = create_signature(API_SECRET, timestamp, body)

  uri = URI("#{BASE_URL}/api/v1/terabox/get-link")
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(uri.path)
  request['X-API-Key'] = API_KEY
  request['X-Signature'] = signature
  request['X-Timestamp'] = timestamp.to_s
  request['Content-Type'] = 'application/json'
  request.body = body.to_json

  response = http.request(request)
  JSON.parse(response.body)
end

# Example usage
result = get_m3u8_link('https://terabox.com/s/1example')
puts JSON.pretty_generate(result)
C#
using System;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;

public class TeraboxAPI
{
    private const string API_KEY = "tbx_your_api_key";
    private const string API_SECRET = "your_api_secret";
    private const string BASE_URL = "https://mswpresents.koyeb.app";

    public static string CreateSignature(string apiSecret, long timestamp, string body)
    {
        string message = $"{timestamp}:{body}";
        using (var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(apiSecret)))
        {
            byte[] hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(message));
            return BitConverter.ToString(hash).Replace("-", "").ToLower();
        }
    }

    public static async Task getLink(string teraboxUrl)
    {
        long timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
        var bodyObj = new { url = teraboxUrl };
        string body = JsonSerializer.Serialize(bodyObj);
        string signature = CreateSignature(API_SECRET, timestamp, body);

        using (var client = new HttpClient())
        {
            var request = new HttpRequestMessage(HttpMethod.Post,
                $"{BASE_URL}/api/v1/terabox/get-link");
            request.Headers.Add("X-API-Key", API_KEY);
            request.Headers.Add("X-Signature", signature);
            request.Headers.Add("X-Timestamp", timestamp.ToString());
            request.Content = new StringContent(body, Encoding.UTF8,
                "application/json");

            var response = await client.SendAsync(request);
            return await response.Content.ReadAsStringAsync();
        }
    }

    public static async Task Main(string[] args)
    {
        string result = await getLink("https://terabox.com/s/1example");
        Console.WriteLine(result);
    }
}

🎬 Generate Ultra HD M3U8

POST

Endpoint: /api/v1/terabox/get-link

Request Body:

{
    "url": "https://terabox.com/s/1example"
}

Success Response:

✅ 200 OK

{
    "success": true,
    "link": "https://your-api.com/file/secure-stream.m3u8",
    "file_name": "SecureAPI: Your Video",
    "bytesize": 1048576000,
    "quality": "ultra_hd",
    "cache_hit": false,
    "message": "M3U8 generated successfully"
}

Error Response:

❌ 429 Too Many Requests

{
    "detail": "Daily rate limit (1000) exceeded"
}

📊 Check Usage Statistics

GET

Endpoint: /api/v1/secure/usage

Response:

{
    "success": true,
    "data": {
        "client_name": "Your Company",
        "daily_limit": 1000,
        "requests_today": 247,
        "total_requests": 15892,
        "remaining_today": 753,
        "created_at": "2026-01-01T00:00:00",
        "expires_at": "2026-02-01T00:00:00",
        "last_used": "2026-01-07T10:30:00",
        "is_active": true
    }
}

⚡ Rate Limits & Error Codes

Code Status Description
200 ✅ Success Request processed successfully
400 ❌ Bad Request Invalid request format or parameters
401 🔒 Unauthorized Invalid API key or signature
403 🚫 Forbidden IP not whitelisted or key expired
408 ⏱️ Timeout Request processing took too long
429 🛑 Rate Limited Daily request limit exceeded
500 ⚠️ Server Error Internal server error occurred
⚡ Rate Limits:
  • Default: 1000 requests per day
  • Limits reset at midnight UTC
  • Custom limits available for enterprise clients
  • Check /api/v1/secure/usage for current usage

💡 Best Practices

🔐 Security:

  • Never commit API secret to version control
  • Store credentials in environment variables
  • Always use HTTPS in production
  • Rotate API keys periodically
  • Implement proper error handling

⚡ Performance:

  • Cache M3U8 links to save API calls
  • Implement request retries with exponential backoff
  • Monitor your usage with /api/v1/secure/usage
  • Use connection pooling for multiple requests

📱 Get API Access

💬 Contact Us:

Ready to integrate our API? Get your API credentials and start building!

  • ✅ Instant API key generation
  • ✅ Custom rate limits for your needs
  • ✅ Technical support and documentation
  • ✅ Enterprise solutions available

📱 Contact on Telegram