DEV Community

SEO - NT Tech Innovation
SEO - NT Tech Innovation

Posted on Fully Autonomous

Automating SMM Panel Orders with Python: A Tiny Wrapper for the /api/v2 Pattern

If you've ever helped a friend run a social media reseller business, you've probably seen the same mess. Orders copied by hand from WhatsApp into a panel dashboard. Status checked one by one. A spreadsheet that's always two days behind.

Most SMM panels expose the same simple HTTP API, often called the "v2" pattern. Once you see the shape, you can automate the boring parts in about 40 lines of Python.

The pattern in one paragraph

Everything is a POST to a single endpoint. You send your API key plus an action field, and the panel answers in JSON. That's it. No OAuth, no SDK.

Common actions look like this:

  • services returns the service list with IDs, rates, min and max quantities
  • add places an order (needs service, link, quantity)
  • status checks one order by its order ID
  • refill asks the panel to top up a dropped order, if the service supports it

I'll use the SMMYodha API docs as the reference here because they're public and you can read them before registering. The endpoint is https://smmyodha.com/api/v2.

A tiny wrapper

import os
import requests

API_URL = "https://smmyodha.com/api/v2"
API_KEY = os.environ["SMM_API_KEY"]  # never hardcode this

def call(action, **params):
    payload = {"key": API_KEY, "action": action, **params}
    resp = requests.post(API_URL, data=payload, timeout=30)
    resp.raise_for_status()
    data = resp.json()
    if isinstance(data, dict) and "error" in data:
        raise RuntimeError(data["error"])
    return data
Enter fullscreen mode Exit fullscreen mode

Keeping the key in an environment variable matters. Treat it like a bank PIN. Anyone with it can spend your balance.

Listing services

services = call("services")
for s in services[:5]:
    print(s["service"], s["name"], s["rate"], s["min"], s["max"])
Enter fullscreen mode Exit fullscreen mode

Cache this list locally. Service IDs change less often than you'd think, and you don't need to hit the endpoint on every order.

Placing and tracking an order

order = call("add", service=1, link="https://example.com/post", quantity=100)
order_id = order["order"]

status = call("status", order=order_id)
print(status)
Enter fullscreen mode Exit fullscreen mode

Always validate quantity against the service's min and max before sending. It saves you a round trip and an angry error message.

Things that bite people

  • Retries can double-order. If a request times out, check status before you resend add. Otherwise you might pay twice.
  • Rates are per 1,000. A rate of 30 means 30 per thousand units, not per unit.
  • Refill isn't universal. Check the service's refill flag before promising it to a client.
  • Log everything. Order ID, service, link, quantity, timestamp. When a client asks "where's my order?" you want an answer in seconds.

Where this fits

This wrapper is the backbone of a small reseller setup. If you're thinking about the business side, like pricing, margins and finding first clients, this guide on starting an SMM reseller panel in India covers it well.

One honest note: platforms like Instagram and YouTube have rules against artificial engagement. Automating orders doesn't change that. Be upfront with your clients about what these services can and can't do.

Happy automating. If you build something on top of this, drop it in the comments.

Top comments (0)