-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.php
More file actions
436 lines (391 loc) · 12.7 KB
/
Copy pathexample.php
File metadata and controls
436 lines (391 loc) · 12.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
<?php
/**
* Ezkify Global SMM Panel API Integration Class
*
* Official PHP wrapper for Ezkify Global API - Premium AI-Safe SMM Panel
*
* @version 2.0
* @author Ezkify Global
* @link https://ezkify.com
* @license MIT
*
* Features:
* - Place orders for 1000+ social media services
* - Check order status (single & batch)
* - Auto-refill system integration
* - Cancel orders
* - Fetch real-time service catalog
* - Check account balance
*
* Retention Rate: 98.7% | Trusted by 50,000+ Agencies
*/
class EzkifyApi
{
/** API URL */
public $api_url = 'https://ezkify.com/api/v2';
/** Your API key */
public $api_key = '';
/**
* Constructor
*
* @param string $api_key Your Ezkify API key
* @param string $api_url API endpoint (default: https://ezkify.com/api/v2)
*/
public function __construct($api_key = '', $api_url = 'https://ezkify.com/api/v2')
{
$this->api_key = $api_key;
$this->api_url = $api_url;
}
/**
* Place a new order
*
* @param array $data Order parameters (service, link, quantity, etc.)
* @return object Order response with order ID
*/
public function order($data)
{
$post = array_merge(['key' => $this->api_key, 'action' => 'add'], $data);
return json_decode((string)$this->connect($post));
}
/**
* Get single order status
*
* @param int $order_id Order ID
* @return object Order status, remains, start count, charge
*/
public function status($order_id)
{
return json_decode(
$this->connect([
'key' => $this->api_key,
'action' => 'status',
'order' => $order_id
])
);
}
/**
* Get multiple orders status (batch up to 100)
*
* @param array $order_ids Array of order IDs
* @return object Orders status array
*/
public function multiStatus($order_ids)
{
return json_decode(
$this->connect([
'key' => $this->api_key,
'action' => 'status',
'orders' => implode(",", (array)$order_ids)
])
);
}
/**
* Get all available services with pricing
*
* @return array Array of service objects
*/
public function services()
{
return json_decode(
$this->connect([
'key' => $this->api_key,
'action' => 'services',
])
);
}
/**
* Request refill for a single order
*
* @param int $orderId Order ID to refill
* @return object Refill response with refill ID
*/
public function refill(int $orderId)
{
return json_decode(
$this->connect([
'key' => $this->api_key,
'action' => 'refill',
'order' => $orderId,
])
);
}
/**
* Request refill for multiple orders
*
* @param array $orderIds Array of order IDs
* @return array Refill responses
*/
public function multiRefill(array $orderIds)
{
return json_decode(
$this->connect([
'key' => $this->api_key,
'action' => 'refill',
'orders' => implode(',', $orderIds),
]),
true,
);
}
/**
* Get refill status for single refill
*
* @param int $refillId Refill ID
* @return object Refill status
*/
public function refillStatus(int $refillId)
{
return json_decode(
$this->connect([
'key' => $this->api_key,
'action' => 'refill_status',
'refill' => $refillId,
])
);
}
/**
* Get refill statuses for multiple refills
*
* @param array $refillIds Array of refill IDs
* @return array Refill statuses
*/
public function multiRefillStatus(array $refillIds)
{
return json_decode(
$this->connect([
'key' => $this->api_key,
'action' => 'refill_status',
'refills' => implode(',', $refillIds),
]),
true,
);
}
/**
* Cancel multiple orders
*
* @param array $orderIds Array of order IDs to cancel
* @return array Cancellation results
*/
public function cancel(array $orderIds)
{
return json_decode(
$this->connect([
'key' => $this->api_key,
'action' => 'cancel',
'orders' => implode(',', $orderIds),
]),
true,
);
}
/**
* Get account balance
*
* @return object Balance and currency
*/
public function balance()
{
return json_decode(
$this->connect([
'key' => $this->api_key,
'action' => 'balance',
])
);
}
/**
* Internal cURL connection handler
*
* @param array $post POST data
* @return string|false API response or false on error
*/
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;
}
}
// ============================================================================
// USAGE EXAMPLES
// ============================================================================
// Initialize API
$api = new EzkifyApi('YOUR_API_KEY_HERE');
// ============================================================================
// 1. Get Account Balance
// ============================================================================
echo "=== ACCOUNT BALANCE ===\n";
$balance = $api->balance();
if ($balance && isset($balance->balance)) {
echo "Balance: $" . $balance->balance . " " . $balance->currency . "\n\n";
}
// ============================================================================
// 2. Fetch All Services
// ============================================================================
echo "=== AVAILABLE SERVICES ===\n";
$services = $api->services();
if (is_array($services)) {
echo "Total Services: " . count($services) . "\n";
// Show first 5 services
foreach (array_slice($services, 0, 5) as $service) {
echo "- {$service->name} (ID: {$service->service}) - \${$service->rate}/1000\n";
}
echo "...\n\n";
}
// ============================================================================
// 3. Place Orders - Different Types
// ============================================================================
echo "=== PLACING ORDERS ===\n";
// Standard order (followers, likes, views)
$order1 = $api->order([
'service' => 1, // Service ID from services list
'link' => 'https://instagram.com/yourprofile',
'quantity' => 1000
]);
echo "Standard Order ID: " . ($order1->order ?? 'Failed') . "\n";
// Custom comments order
$order2 = $api->order([
'service' => 1,
'link' => 'https://instagram.com/p/POST_ID',
'comments' => "Great post!\nLove this!\nAmazing content\n🔥"
]);
echo "Comments Order ID: " . ($order2->order ?? 'Failed') . "\n";
// Package order (auto-quantity)
$order3 = $api->order([
'service' => 1,
'link' => 'https://instagram.com/yourprofile'
]);
echo "Package Order ID: " . ($order3->order ?? 'Failed') . "\n";
// Subscription order - Old posts only
$order4 = $api->order([
'service' => 1,
'username' => 'yourusername',
'min' => 100,
'max' => 110,
'posts' => 0,
'delay' => 30,
'expiry' => '12/31/2026'
]);
echo "Subscription Order ID: " . ($order4->order ?? 'Failed') . "\n";
// Poll order
$order5 = $api->order([
'service' => 1,
'link' => 'https://instagram.com/p/POLL_POST',
'quantity' => 100,
'answer_number' => '7'
]);
echo "Poll Order ID: " . ($order5->order ?? 'Failed') . "\n\n";
// ============================================================================
// 4. Check Order Status
// ============================================================================
echo "=== CHECKING ORDER STATUS ===\n";
if (isset($order1->order)) {
$status = $api->status($order1->order);
if ($status) {
echo "Order {$order1->order} Status:\n";
echo "- Status: " . ($status->status ?? 'N/A') . "\n";
echo "- Remains: " . ($status->remains ?? 'N/A') . "\n";
echo "- Start Count: " . ($status->start_count ?? 'N/A') . "\n";
echo "- Charge: $" . ($status->charge ?? 'N/A') . "\n\n";
}
}
// ============================================================================
// 5. Batch Check Multiple Orders
// ============================================================================
echo "=== BATCH ORDER STATUS ===\n";
$orderIds = [
$order1->order ?? 1,
$order2->order ?? 2,
$order3->order ?? 3
];
$statuses = $api->multiStatus($orderIds);
if (is_object($statuses)) {
foreach ($statuses as $orderId => $status) {
echo "Order $orderId: " . ($status->status ?? 'N/A') . " (Remains: " . ($status->remains ?? 'N/A') . ")\n";
}
}
echo "\n";
// ============================================================================
// 6. Request Refill for Partial Orders
// ============================================================================
echo "=== REQUESTING REFILLS ===\n";
$refillResponse = (array) $api->multiRefill($orderIds);
$refillIds = array_column($refillResponse, 'refill');
echo "Refill IDs: " . implode(', ', $refillIds) . "\n\n";
// ============================================================================
// 7. Check Refill Status
// ============================================================================
if (!empty($refillIds)) {
echo "=== REFILL STATUSES ===\n";
$refillStatuses = $api->multiRefillStatus($refillIds);
if (is_array($refillStatuses)) {
foreach ($refillStatuses as $refillId => $status) {
echo "Refill $refillId: " . ($status->status ?? 'N/A') . "\n";
}
}
echo "\n";
}
// ============================================================================
// 8. Cancel Orders (if needed)
// ============================================================================
// Uncomment to cancel orders
// $cancelResult = $api->cancel([$order1->order, $order2->order]);
// echo "Cancellation Result: " . print_r($cancelResult, true) . "\n";
// ============================================================================
// TROUBLESHOOTING & ERROR HANDLING
// ============================================================================
/**
* Common Error Responses:
*
* {"error": "Invalid API key"} - Check your API key in dashboard
* {"error": "Invalid service"} - Service ID doesn't exist, fetch services first
* {"error": "Insufficient balance"} - Top up your account
* {"error": "Invalid link"} - URL format is incorrect
* {"error": "Quantity less than minimum"} - Check service min requirements
* {"error": "Quantity more than maximum"} - Check service max limits
*
* Support:
* - Telegram: @Ezkify
* - Email: ezkify@proton.me
* - Dashboard: https://ezkify.com/account
*/
// ============================================================================
// ADVANCED: Loop Through Services to Find Specific Ones
// ============================================================================
function findServiceByName($services, $searchTerm) {
foreach ($services as $service) {
if (stripos($service->name, $searchTerm) !== false) {
return $service;
}
}
return null;
}
// Example: Find Instagram Followers service
$igFollowers = findServiceByName($services, 'followers');
if ($igFollowers) {
echo "Found Instagram Followers:\n";
echo "- Service ID: {$igFollowers->service}\n";
echo "- Rate: \${$igFollowers->rate}/1000\n";
echo "- Min: {$igFollowers->min} | Max: {$igFollowers->max}\n";
}
echo "\n=== END OF EXAMPLES ===\n";
echo "\nFor full documentation, visit: https://ezkify.com\n";
echo "Need help? Contact us: Telegram @Ezkify | ezkify@proton.me\n";
?>