APEX SMM Panel - Best & Cheapest SMM Panel for Social Media Growth
Sign In Sign Up

API Logic & Examples

Complete API integration examples with working code samples in PHP, Python, JavaScript, and more. Start automating your SMM reseller business today.

Your API Credentials

Use these credentials to test the examples below. Replace with your actual API key from dashboard.

Rate Limits

100 requests per minute per API key. Enterprise plans have higher limits.

GET POST X-RateLimit headers included

Authentication

API key must be sent in the Authorization header or as 'api_key' parameter.

Authorization: Bearer YOUR_API_KEY

Response Time

Average response time: 0.05s. 99.9% uptime SLA.

24/7 Monitoring

PHP Integration Examples

Place an Order (cURL)

This example shows how to place an order using PHP cURL.

PHP / cURL
<?php
// APEX SMM API - Place Order Example
$api_key = 'YOUR_API_KEY';
$api_url = 'https://api.apexsmm.online/v4';

$data = [
    'key' => $api_key,
    'action' => 'add',
    'service' => 1234, // Service ID
    'link' => 'https://instagram.com/username',
    'quantity' => 1000
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($http_code == 200) {
    $result = json_decode($response, true);
    echo "Order placed successfully. Order ID: " . $result['order'];
} else {
    echo "Error: " . $response;
}
?>
Response:
{
  "order": 12345678,
  "status": "pending",
  "charge": 0.45,
  "currency": "USD"
}

Check Order Status

Check the status of an existing order.

PHP / cURL
<?php
// Check Order Status
$api_key = 'YOUR_API_KEY';
$order_id = 12345678;

$data = [
    'key' => $api_key,
    'action' => 'status',
    'order' => $order_id
];

$ch = curl_init('https://api.apexsmm.online/v4');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

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

$status = json_decode($response, true);
echo "Order {$order_id} status: " . $status['status']; // Completed, Processing, Partial, Canceled
?>
Response:
{
  "order": 12345678,
  "status": "completed",
  "start_count": 1500,
  "remains": 0
}

Get Services List

Retrieve all available services with prices and minimum orders.

PHP / cURL
<?php
// Get All Services
$api_key = 'YOUR_API_KEY';
$url = 'https://api.apexsmm.online/v4?key=' . $api_key . '&action=services';

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

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

$services = json_decode($response, true);

foreach($services as $service) {
    echo "{$service['name']} - \${$service['rate']} per 1000\n";
}
?>

Python Integration Examples

Place Order (Requests Library)

Using Python's requests library to place an order.

Python 3.x
import requests
import json

# APEX SMM API - Python Example
API_KEY = 'YOUR_API_KEY'
API_URL = 'https://api.apexsmm.online/v4'

# Place order
data = {
    'key': API_KEY,
    'action': 'add',
    'service': 1234,
    'link': 'https://instagram.com/username',
    'quantity': 1000
}

response = requests.post(API_URL, data=data)

if response.status_code == 200:
    result = response.json()
    print(f"Order placed: {result['order']}")
    print(f"Charge: ${result['charge']}")
else:
    print(f"Error: {response.text}")

# Check balance
balance_data = {'key': API_KEY, 'action': 'balance'}
balance_resp = requests.post(API_URL, data=balance_data)
print(f"Balance: ${balance_resp.json()['balance']}")

Async Example with aiohttp

High-performance async requests for bulk operations.

Python Async
import aiohttp
import asyncio

async def place_order(session, api_key, service_id, link, quantity):
    data = {
        'key': api_key,
        'action': 'add',
        'service': service_id,
        'link': link,
        'quantity': quantity
    }
    async with session.post('https://api.apexsmm.online/v4', data=data) as resp:
        return await resp.json()

async def main():
    api_key = 'YOUR_API_KEY'
    orders = [
        (1234, 'https://instagram.com/user1', 1000),
        (1235, 'https://facebook.com/page1', 500),
        (1236, 'https://tiktok.com/@user1', 2000)
    ]
    
    async with aiohttp.ClientSession() as session:
        tasks = []
        for service_id, link, qty in orders:
            tasks.append(place_order(session, api_key, service_id, link, qty))
        
        results = await asyncio.gather(*tasks)
        for result in results:
            print(f"Order: {result['order']}")

asyncio.run(main())

JavaScript / Node.js Examples

Node.js with Axios

Node.js
const axios = require('axios');

const API_KEY = 'YOUR_API_KEY';
const API_URL = 'https://api.apexsmm.online/v4';

// Place order
async function placeOrder() {
    try {
        const response = await axios.post(API_URL, new URLSearchParams({
            key: API_KEY,
            action: 'add',
            service: 1234,
            link: 'https://instagram.com/username',
            quantity: 1000
        }));
        
        console.log('Order placed:', response.data.order);
        console.log('Charge:', response.data.charge);
        
    } catch (error) {
        console.error('Error:', error.response?.data || error.message);
    }
}

// Get balance
async function getBalance() {
    const response = await axios.post(API_URL, new URLSearchParams({
        key: API_KEY,
        action: 'balance'
    }));
    console.log('Balance:', response.data.balance);
}

placeOrder();
getBalance();

Webhook Integration

Webhook Listener (PHP)

Receive real-time order updates via webhook when order status changes.

webhook.php
<?php
// APEX SMM Webhook Handler
// Set this URL in your APEX SMM dashboard

$input = file_get_contents('php://input');
$data = json_decode($input, true);

// Log the webhook for debugging
file_put_contents('webhook.log', date('Y-m-d H:i:s') . " - " . $input . "\n", FILE_APPEND);

if ($data) {
    $order_id = $data['order'];
    $status = $data['status'];
    $charge = $data['charge'];
    $remains = $data['remains'];
    
    // Handle different statuses
    switch($status) {
        case 'completed':
            // Order completed successfully
            // Update your database, notify user, etc.
            break;
        case 'partial':
            // Partially completed
            break;
        case 'processing':
            // Order is being processed
            break;
        case 'canceled':
            // Order was canceled
            break;
    }
    
    // Send acknowledgment
    http_response_code(200);
    echo json_encode(['status' => 'received']);
} else {
    http_response_code(400);
    echo 'Invalid data';
}
?>

Webhook URL: https://yourdomain.com/webhook.php

Sample webhook payload:

{
  "order": 12345678,
  "status": "completed",
  "charge": 0.45,
  "remains": 0,
  "start_count": 1000,
  "timestamp": "2026-03-05T10:30:00Z"
}

Error Handling

Common Error Codes

Error Code Description Solution
400 Bad Request - Missing parameters Check required fields
401 Unauthorized - Invalid API key Verify your API key
403 Forbidden - Insufficient balance Add funds to wallet
404 Service not found Check service ID
429 Too Many Requests - Rate limit exceeded Wait 60 seconds
500 Internal Server Error Contact support
Error Response Example
{
  "error": true,
  "code": 403,
  "message": "Insufficient balance. Required: $0.45, Available: $0.20",
  "balance": 0.20
}

Test API Live

Try the API directly from your browser (demo mode).

Are You Ready?

Join us now, raise up to the stars, let everyone know from you, being part of the elite scene in this SMM world and be famous. Start growing with the best social media marketing strategies at APEX SMM.

Contact us