🚀 Envato Reseller API

Powered by envato.thepremiumhub.in

📊 Status ⬇️ Download 📋 History 🐛 Debug 💻 PHP Code

💻 PHP Integration Examples

Copy these into your own PHP project.

1. Download a File

<?php
$result = downloadItem("https://elements.envato.com/item-JTM7PFZ");

if ($result["success"]) {
    $url   = $result["download_url"];  // CDN link
    $title = $result["item"]["title"];
    $image = $result["item"]["image"];
    $left  = $result["points_remaining"];
    header("Location: " . $url); // redirect to download
} else {
    echo $result["error"];
    if ($result["debug_code"]) echo " | Debug: " . $result["debug_code"];
}

2. Check Balance

<?php
$status = getStatus();
echo "Balance: " . $status["reseller"]["points"] . " points";

3. Error Handling

<?php
$result = downloadItem($url);
switch ($result["error_code"] ?? "") {
    case "LOW_BALANCE":      echo "Top up your balance."; break;
    case "ITEM_NOT_FOUND":   echo "Invalid URL."; break;
    case "LIMIT_REACHED":    echo "Try again later."; break;
    case "PROXY_ERROR":
    case "COOKIE_EXPIRED":
    case "SERVER_ERROR":     echo "Contact admin. Debug: " . $result["debug_code"]; break;
    default:                 echo $result["error"];
}