$this->api_key, 'action' => 'add'], $data); return json_decode((string)$this->connect($post)); } /** Get order status */ public function status($order_id) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'status', 'order' => $order_id ]) ); } /** Get orders status */ public function multiStatus($order_ids) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'status', 'orders' => implode(",", (array)$order_ids) ]) ); } /** Get services */ public function services() { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'services', ]) ); } /** Refill order */ public function refill(int $orderId) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'refill', 'order' => $orderId, ]) ); } /** Refill orders */ public function multiRefill(array $orderIds) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'refill', 'orders' => implode(',', $orderIds), ]), true, ); } /** Get refill status */ public function refillStatus(int $refillId) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'refill_status', 'refill' => $refillId, ]) ); } /** Get refill statuses */ public function multiRefillStatus(array $refillIds) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'refill_status', 'refills' => implode(',', $refillIds), ]), true, ); } /** Cancel orders */ public function cancel(array $orderIds) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'cancel', 'orders' => implode(',', $orderIds), ]), true, ); } /** Get balance */ public function balance() { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'balance', ]) ); } private function connect($post) { $_post = []; if (is_array($post)) { foreach ($post as $name => $value) { $_post[] = $name . '=' . urlencode($value); } } $ch = curl_init($this->api_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); if (is_array($post)) { curl_setopt($ch, CURLOPT_POSTFIELDS, join('&', $_post)); } curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)'); $result = curl_exec($ch); if (curl_errno($ch) != 0 && empty($result)) { $result = false; } curl_close($ch); return $result; } } // ============================================ // EXAMPLES - How to use this API // ============================================ $api = new Api(); $api->api_key = 'YOUR_API_KEY_HERE'; // Get your API key from https://maxgram.vip/api // ============================================ // 1. Get all services // ============================================ $services = $api->services(); // Returns: Array of all available services with pricing // ============================================ // 2. Get your account balance // ============================================ $balance = $api->balance(); // Returns: {"balance": "100.00", "currency": "USD"} // ============================================ // 3. Add orders - Different types // ============================================ // 3.1 - Default order with Dripfeed $order = $api->order([ 'service' => 1, // Service ID 'link' => 'http://example.com/test', // Target URL 'quantity' => 100, // Quantity 'runs' => 2, // Number of runs (optional) 'interval' => 5 // Interval in minutes (optional) ]); // Returns: {"order": 12345} // 3.2 - Custom Comments order $order = $api->order([ 'service' => 1, 'link' => 'http://example.com/test', 'comments' => "good pic\ngreat photo\n:)\n;)" // One comment per line ]); // Returns: {"order": 12346} // 3.3 - Subscriptions (old posts only) $order = $api->order([ 'service' => 1, 'username' => 'username', // Instagram/Social username 'min' => 100, // Minimum likes/followers per post 'max' => 110, // Maximum likes/followers per post 'posts' => 0, // Number of old posts (0 = all) 'delay' => 30, // Delay in minutes 'expiry' => '11/11/2025' // Expiry date ]); // Returns: {"order": 12347} // ============================================ // 4. Check order status // ============================================ // 4.1 - Single order status $status = $api->status(12345); // Returns: {"charge": "1.50", "start_count": "1000", "status": "Completed", "remains": "0", "currency": "USD"} // 4.2 - Multiple orders status $statuses = $api->multiStatus([12345, 12346, 12347]); // Returns: Array with status of all orders // ============================================ // 5. Refill orders // ============================================ // 5.1 - Single refill $refill = $api->refill(12345); // Returns: {"refill": 1} // 5.2 - Multiple refills $refill = (array) $api->multiRefill([12345, 12346]); // Returns: [{"order": 12345, "refill": 1}, {"order": 12346, "refill": 2}] // Get refill IDs $refillIds = array_column($refill, 'refill'); // ============================================ // 6. Check refill status // ============================================ if ($refillIds) { $refillStatuses = $api->multiRefillStatus($refillIds); // Returns: [{"refill": 1, "status": "Completed"}, {"refill": 2, "status": "Pending"}] } // ============================================ // 7. Cancel orders // ============================================ $cancel = $api->cancel([12345, 12346]); // Returns: [{"order": 12345, "status": "canceled"}, {"order": 12346, "status": "canceled"}] // ============================================ // ERROR CODES // ============================================ // 102 - Invalid API key // 103 - Account inactive // 104 - Order/Refill not found // 105 - Service inactive or not found // 107 - Required fields not filled // 108 - Minimum quantity not reached // 109 - Maximum quantity exceeded // 113 - Insufficient balance // 116 - Service does not support refill // 117 - Wait 24 hours for new refill // 118-121 - Cancellation errors // ============================================ // IMPORTANT NOTES // ============================================ // 1. Get your API key from: https://maxgram.vip/api // 2. API Endpoint: https://maxgram.vip/api/v2 // 3. All requests must include 'key' and 'action' parameters // 4. Use POST or GET methods // 5. Response format: JSON // 6. Refills have 24-hour cooldown // 7. Only pending/processing orders can be canceled // 8. Orders older than 7 days cannot be canceled // ============================================ // SUPPORT // ============================================ // For technical support, contact: Support Team // Website: https://maxgram.vip