$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 multiple orders status (up to 100 IDs) */ 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($lang = '') { $post = [ 'key' => $this->api_key, 'action' => 'services', ]; if ($lang !== '') { $post['lang'] = $lang; } return json_decode($this->connect($post)); } /** Refill order */ public function refill($orderId) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'refill', 'order' => $orderId, ]) ); } /** Cancel order */ public function cancel($orderId) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'cancel', 'order' => $orderId, ]) ); } /** 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); 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 $api = new Api(); $api->api_key = 'YOUR_API_KEY'; $services = $api->services(); // All services (optional: services('en')) $balance = $api->balance(); // Default order $order = $api->order([ 'service' => 1, 'link' => 'https://example.com/test', 'quantity' => 100, ]); // Drip-feed $order = $api->order([ 'service' => 1, 'link' => 'https://example.com/test', 'quantity' => 100, 'runs' => 10, 'interval' => 60, ]); // Custom Comments $order = $api->order([ 'service' => 1, 'link' => 'https://example.com/test', 'comments' => "good\nnice\n:)", ]); // Package (fixed quantity) $order = $api->order(['service' => 1, 'link' => 'https://example.com/test']); // Subscriptions $order = $api->order([ 'service' => 1, 'username' => 'username', 'min' => 100, 'max' => 110, 'posts' => 0, 'delay' => 30, 'expiry' => '11/11/2026', ]); // Poll $order = $api->order([ 'service' => 1, 'link' => 'https://example.com/test', 'quantity' => 100, 'answer_number' => 3, ]); // Comment Likes $order = $api->order([ 'service' => 1, 'link' => 'https://example.com/test', 'quantity' => 100, 'username' => 'target_user', ]); $status = $api->status($order->order); $statuses = $api->multiStatus([1, 2, 3]); $refill = $api->refill($order->order); $cancel = $api->cancel($order->order);