PastePanel
All articles
Article 12 min read

SMM Panel API इंटीग्रेशन गाइड (PHP, Python, Node.js) — पूरा डेवलपर ट्यूटोरियल

P

PastePanel Team

Insights for panel operators

अगर आप अपना खुद का SMM panel चला रहे हैं या किसी upstream provider से orders resell कर रहे हैं, तो देर-सवेर आपको SMM panel API integration की ज़रूरत पड़ेगी। मैन्युअल रूप से हर दिन सैकड़ों orders डालना, status चेक करना और balance देखना न सिर्फ़ थका देने वाला है, बल्कि गलतियों से भरा भी है। API इसी समस्या का समाधान है — यह आपके store, आपकी website, आपके बॉट या आपके किसी भी automation script को सीधे panel से जोड़ देता है, ताकि orders अपने-आप place हों, sync हों और deliver हों।

अच्छी बात यह है कि लगभग पूरी SMM इंडस्ट्री एक ही तरह के API ढांचे पर काम करती है। जिसे आमतौर पर "perfect panel" शैली का API कहा जाता है, वह असल में एक de-facto industry standard बन चुका है — एक single POST endpoint, एक key parameter, और action के ज़रिए services, add, status, balance और refill जैसे कमांड। इसका मतलब यह है कि अगर आपने एक panel के लिए integration सीख लिया, तो वही कोड थोड़े-बहुत बदलाव के साथ किसी भी दूसरे perfect panel-compatible provider पर चल जाएगा। PastePanel (pastepanel.com) भी इसी standard-compatible, async Python/FastAPI आधारित API को support करता है, जिससे आपका integration तेज़, सुरक्षित और भविष्य के लिए तैयार रहता है।

इस गाइड में हम शून्य से शुरू करके पूरे SMM panel API integration को समझेंगे — authentication, हर मुख्य endpoint, request/response का format, और फिर PHP, Python और Node.js तीनों में तैयार, कॉपी-पेस्ट करने लायक कोड उदाहरण। साथ ही error handling, rate limits और production best practices भी कवर करेंगे, ताकि आपका integration सिर्फ़ चले नहीं, बल्कि scale पर भरोसेमंद तरीके से चले।

SMM Panel API क्या है और यह कैसे काम करता है

SMM panel API एक HTTP-आधारित interface है जिसके ज़रिए आपका software (न कि कोई इंसान) panel से बात करता है। ज़्यादातर perfect panel-style panels में एक ही endpoint होता है, जैसे https://yourdomain.com/api/v2, और सारे कमांड उसी URL पर POST request के रूप में भेजे जाते हैं। हर request में कम-से-कम दो चीज़ें होती हैं: आपकी key (API key जो आपकी पहचान है) और एक action (जो बताता है कि आप क्या करना चाहते हैं)।

Response आमतौर पर JSON में आता है। उदाहरण के लिए, एक नया order डालने पर आपको एक order ID वापस मिलता है, जिसे आप बाद में status ट्रैक करने के लिए store कर लेते हैं। यही सादगी इस API को इतना लोकप्रिय बनाती है — कोई जटिल OAuth flow नहीं, कोई भारी SDK नहीं; बस एक key और सही parameters।

यह समझ लेना ज़रूरी है कि API के दो पहलू होते हैं। एक तरफ़ आप एक reseller/consumer हो सकते हैं जो किसी upstream provider के API को कॉल करके अपने panel का stock भरता है। दूसरी तरफ़ आपका अपना panel भी अपने ग्राहकों को API देता है, ताकि वे अपने stores को आपसे जोड़ सकें। PastePanel दोनों दिशाओं को संभालता है — यह एक साथ कई upstream providers से जुड़ सकता है (Fernet-encrypted API keys और balance monitoring के साथ) और अपने users को full-featured user panel + API भी देता है।

API authentication और सुरक्षा (आपकी API key)

हर SMM panel API integration की नींव है आपकी API key। यह एक गुप्त token है जो आपके account से जुड़ा होता है — इसे किसी password की तरह ट्रीट करें। इसे कभी client-side JavaScript, public GitHub repo या mobile app में hard-code न करें, क्योंकि जिसके पास key होगी वह आपके balance से orders डाल सकता है।

कुछ ज़रूरी सुरक्षा नियम:

  • Key को server-side रखें: API कॉल हमेशा अपने backend से करें, browser से कभी नहीं। इससे key कभी user को दिखाई नहीं देती।
  • Environment variables का इस्तेमाल करें: key को कोड में लिखने के बजाय .env फ़ाइल या OS environment में रखें।
  • HTTPS अनिवार्य है: हमेशा https:// endpoint पर ही request भेजें ताकि key बीच में intercept न हो।
  • Key rotation: अगर key leak होने का शक हो, तो panel से तुरंत नई key generate करें।

PastePanel जैसे आधुनिक panels में upstream provider keys को Fernet encryption से database में encrypt करके रखा जाता है, यानी अगर database भी expose हो जाए, तो keys plain-text में नहीं मिलतीं। यह white-label operators के लिए एक अहम भरोसे का बिंदु है।

मुख्य API actions जो आपको पता होने चाहिए

चाहे कोई भी perfect panel-compatible provider हो, ये कुछ core actions लगभग हर जगह एक जैसे होते हैं:

  • services — provider की पूरी service list (ID, name, category, rate, min, max, dripfeed/refill support आदि) लौटाता है। इसी से आप अपने panel का catalogue sync करते हैं।
  • add — नया order डालता है। इसमें service (ID), link और quantity देना ज़रूरी है। Order type के हिसाब से extra parameters आते हैं — जैसे Custom Comments में comments, Drip-Feed में runs और interval, Poll में answer_number, Subscriptions में username, min, max, delay आदि।
  • status — एक order की स्थिति (Pending, In progress, Completed, Partial, Canceled), start_count, remains और charge लौटाता है। एक साथ कई orders के लिए orders parameter में comma-separated IDs भेजें।
  • balance — आपके account का बचा हुआ balance और currency।
  • refill — जिस service में refill support है, वहाँ drop हुए followers/likes की भरपाई का अनुरोध करता है; refill_status से उसकी स्थिति देखी जाती है।
  • cancel — supported services पर pending order को रद्द करने का अनुरोध।

PastePanel इन सब order types को native रूप से support करता है — Default, Package, Custom Comments, Subscriptions, Drip-Feed, Mentions और Poll — इसलिए आपका एक ही integration Instagram, TikTok, YouTube, Telegram और Facebook की growth services को एक जैसे तरीके से संभाल लेता है।

PHP में SMM panel API integration

PHP अभी भी दुनिया भर के अधिकांश SMM stores की रीढ़ है, इसलिए इससे शुरू करते हैं। नीचे एक साफ़, दोबारा इस्तेमाल होने लायक cURL-आधारित class है जो किसी भी perfect panel-style endpoint पर चलती है:

<?php
class SmmApi {
    private $endpoint = 'https://yourpanel.com/api/v2';
    private $apiKey;

    public function __construct($apiKey) {
        $this->apiKey = $apiKey;
    }

    private function request(array $params) {
        $params['key'] = $this->apiKey;
        $ch = curl_init($this->endpoint);
        curl_setopt_array($ch, [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_POST           => true,
            CURLOPT_POSTFIELDS     => http_build_query($params),
            CURLOPT_TIMEOUT        => 30,
            CURLOPT_SSL_VERIFYPEER => true,
        ]);
        $response = curl_exec($ch);
        if (curl_errno($ch)) {
            throw new Exception('cURL error: ' . curl_error($ch));
        }
        curl_close($ch);
        return json_decode($response, true);
    }

    public function services() {
        return $this->request(['action' => 'services']);
    }

    public function addOrder($service, $link, $quantity, array $extra = []) {
        return $this->request(array_merge([
            'action'   => 'add',
            'service'  => $service,
            'link'     => $link,
            'quantity' => $quantity,
        ], $extra));
    }

    public function status($orderId) {
        return $this->request(['action' => 'status', 'order' => $orderId]);
    }

    public function balance() {
        return $this->request(['action' => 'balance']);
    }
}

// उपयोग:
$api = new SmmApi(getenv('SMM_API_KEY'));
$order = $api->addOrder(1, 'https://instagram.com/username', 1000);
echo "Order ID: " . $order['order'];
?>

ध्यान दें कि हमने key को getenv() से लिया है, hard-code नहीं किया। Drip-Feed order के लिए आप बस addOrder में extra array पास कर देंगे, जैसे ['runs' => 10, 'interval' => 60] — यानी एक ही function सारे order types संभाल लेता है।

Python में SMM panel API integration

Python automation, bots और backend jobs के लिए बेहद लोकप्रिय है — और चूँकि PastePanel खुद async Python/FastAPI पर बना है, यह भाषा इस दुनिया में स्वाभाविक रूप से फ़िट बैठती है। नीचे requests लाइब्रेरी के साथ एक सरल client है:

import os
import requests

class SmmApi:
    def __init__(self, api_key, endpoint="https://yourpanel.com/api/v2"):
        self.api_key = api_key
        self.endpoint = endpoint

    def _request(self, params):
        params["key"] = self.api_key
        resp = requests.post(self.endpoint, data=params, timeout=30)
        resp.raise_for_status()
        return resp.json()

    def services(self):
        return self._request({"action": "services"})

    def add_order(self, service, link, quantity, **extra):
        data = {"action": "add", "service": service,
                "link": link, "quantity": quantity}
        data.update(extra)
        return self._request(data)

    def status(self, order_id):
        return self._request({"action": "status", "order": order_id})

    def multi_status(self, order_ids):
        ids = ",".join(str(i) for i in order_ids)
        return self._request({"action": "status", "orders": ids})

    def balance(self):
        return self._request({"action": "balance"})


api = SmmApi(os.environ["SMM_API_KEY"])

# Drip-Feed order उदाहरण:
order = api.add_order(
    service=1,
    link="https://tiktok.com/@username",
    quantity=5000,
    runs=10,
    interval=30,
)
print("Order ID:", order.get("order"))
print("Balance:", api.balance())

बड़े volume वाले integration के लिए आप httpx और asyncio के साथ इसका async संस्करण बना सकते हैं, जिससे सैकड़ों status checks एक साथ, बिना एक-दूसरे का इंतज़ार किए, चल जाएँ। यही async मॉडल वह चीज़ है जो एक आधुनिक SMM panel को हज़ारों समवर्ती orders पर तेज़ बनाए रखती है।

Node.js में SMM panel API integration

अगर आपका stack JavaScript-आधारित है (Express backend, Telegram/Discord bots, या serverless functions), तो Node.js में integration उतना ही आसान है। आधुनिक Node में built-in fetch उपलब्ध है, इसलिए किसी extra dependency की भी ज़रूरत नहीं:

class SmmApi {
  constructor(apiKey, endpoint = "https://yourpanel.com/api/v2") {
    this.apiKey = apiKey;
    this.endpoint = endpoint;
  }

  async request(params) {
    const body = new URLSearchParams({ ...params, key: this.apiKey });
    const res = await fetch(this.endpoint, {
      method: "POST",
      headers: { "Content-Type": "application/x-www-form-urlencoded" },
      body,
    });
    if (!res.ok) throw new Error(`HTTP ${res.status}`);
    return res.json();
  }

  services() {
    return this.request({ action: "services" });
  }

  addOrder(service, link, quantity, extra = {}) {
    return this.request({ action: "add", service, link, quantity, ...extra });
  }

  status(orderId) {
    return this.request({ action: "status", order: orderId });
  }

  balance() {
    return this.request({ action: "balance" });
  }
}

// उपयोग:
const api = new SmmApi(process.env.SMM_API_KEY);

(async () => {
  const order = await api.addOrder(
    1,
    "https://youtube.com/watch?v=xxxx",
    2000
  );
  console.log("Order ID:", order.order);
  console.log(await api.balance());
})();

तीनों उदाहरणों की संरचना जान-बूझकर एक जैसी रखी गई है — एक निजी request method जो key जोड़ती है, और उसके ऊपर पतले wrappers। यह pattern maintainable है और नई actions (refill, cancel, dripfeed) जोड़ना बस एक-दो लाइन का काम बन जाता है।

Error handling, rate limits और production best practices

Demo कोड चला लेना आसान है; असली चुनौती production में विश्वसनीयता है। ये अभ्यास आपके integration को मज़बूत बनाते हैं:

  • हर response की जाँच करें: perfect panel-style APIs गलती पर अक्सर HTTP 200 के साथ ही {"error": "..."} लौटाते हैं। इसलिए सिर्फ़ status code नहीं, response body में error key भी देखें।
  • Order ID हमेशा store करें: add से मिला order ID अपने database में सुरक्षित रखें — यही आपकी status tracking और refill की चाबी है।
  • Status polling समझदारी से करें: हर सेकंड सभी orders को poll न करें। Batch orders parameter (comma-separated) इस्तेमाल करें और अंतराल रखें, ताकि rate limit न लगे।
  • Retry with backoff: network या 5xx errors पर तुरंत हार न मानें; exponential backoff के साथ दोबारा कोशिश करें, पर add पर idempotency का ध्यान रखें ताकि double order न पड़े।
  • Balance monitoring: orders डालने से पहले balance जाँचें; upstream provider का balance खत्म होने पर orders चुपचाप fail हो सकते हैं। PastePanel इसी वजह से connected providers की balance monitoring built-in देता है।
  • Logging: हर request/response लॉग करें (key को छोड़कर) ताकि किसी दिक्कत का पता लगाना आसान हो।

अगर आप एक reseller हैं जो कई upstream providers से जुड़ते हैं, तो हर provider के लिए एक ही client class की instance बना लें — चूँकि सब perfect panel-compatible हैं, आपको हर एक के लिए अलग कोड लिखने की ज़रूरत नहीं पड़ती। PastePanel में यह multi-provider routing खुद platform के भीतर हो जाती है, इसलिए आप एक ही जगह से कई sources को orchestrate कर सकते हैं।

API integration के असली उपयोग: automation और resell

जब integration तैयार हो जाता है, तो संभावनाएँ खुल जाती हैं। सबसे आम इस्तेमाल हैं:

  • Auto-fulfilment: जैसे ही आपके store पर payment (USDT, Binance, Cryptomus, Stripe आदि) confirm हो, आपका backend तुरंत add कॉल करके order provider को भेज दे — कोई मैन्युअल कदम नहीं।
  • Catalogue auto-sync: रोज़ services कॉल करके prices और availability sync करें, अपना markup जोड़ें, और अपने panel का price-list हमेशा ताज़ा रखें।
  • Telegram/Discord bots: ग्राहक सीधे chat से order दें, और बॉट API के ज़रिए उसे place व track करे।
  • Mass Orders: एक साथ सैकड़ों links को एक ही format में paste करके bulk में process करना — बड़े रीसेलर्स के लिए game-changer।
  • Custom dashboards: अपने खुद के analytics और reporting बनाएँ जो live order status और balance दिखाएँ।

PastePanel इन सबको सहज बनाता है क्योंकि यह एक पूर्ण white-label SaaS है — आपको अपना API, अपना user panel, 30 admin modules, worldwide payment gateways (USDT, Binance, Payeer, Cryptomus, NOWPayments, CoinPayments, Stripe, bKash, ABA और manual सहित) और multi-tenant infrastructure सब एक जगह मिलते हैं। आपको बस अपना brand, domain और theme लगाना है।

PastePanel API integration के मुख्य फ़ायदे

  • Industry-standard API: perfect panel-compatible endpoints, इसलिए आपके मौजूदा scripts और tools बिना बड़े बदलाव के काम करते हैं।
  • तीनों भाषाओं में आसान: PHP, Python और Node.js में तैयार pattern — कुछ ही मिनटों में live।
  • पूरे order types: Default, Package, Custom Comments, Subscriptions, Drip-Feed, Mentions, Poll और Mass Orders — सब एक ही API से।
  • Refill और Cancel support: अपने ग्राहकों को भरोसेमंद after-sales अनुभव दें।
  • Multi-provider, encrypted keys: कई upstream providers जोड़ें, Fernet-encrypted keys और balance monitoring के साथ।
  • तेज़ और सुरक्षित: async Python/FastAPI core, जो high-volume orders पर भी responsive रहता है।
  • Worldwide payments: crypto से लेकर local gateways तक — वैश्विक ग्राहकों के लिए तैयार।
  • पूर्ण white-label: अपना domain, branding और theme — panel पूरी तरह आपका दिखता है।

निष्कर्ष: अपना SMM panel आज ही शुरू करें

SMM panel API integration कोई मुश्किल काम नहीं है — इसकी बुनियाद एक ही endpoint, एक key और चंद actions पर टिकी है। ऊपर दिए PHP, Python और Node.js उदाहरण आपको तुरंत शुरुआत करने के लिए काफ़ी हैं। असली फ़र्क तब पड़ता है जब आप एक मज़बूत, तेज़ और globally payment-ready platform पर यह सब चलाते हैं, ताकि आपका पूरा ध्यान बिक्री और ग्राहकों पर रहे, न कि infrastructure पर।

अगर आप Instagram, TikTok, YouTube, Telegram और Facebook की growth services बेचने वाला अपना खुद का branded SMM panel चलाना चाहते हैं — full API, white-label branding और worldwide payments के साथ — तो PastePanel पर मुफ़्त में शुरुआत करें। आज ही pastepanel.com पर जाएँ, अपना panel launch करें, और इस गाइड के कोड को अपने live API key के साथ जोड़कर पहला automated order मिनटों में place करें।

Your brand, your revenue

Stop reading, start building.

The best lessons come from doing. Launch your own panel in five minutes.

Launch your panel