Skip to main content

SMM Panel Client

A professional, robust, and highly pythonic API client for SMM (Social Media Marketing) panels.

Developed with performance, reliability, and security in mind, this package acts as a standard client compatible with any SMM panel using the Perfect Panel or similar API v2 format.

Features

  • Connection Pooling: Reuses TCP connections via requests.Session() to make sequential requests blazing fast.
  • Context Manager Support: Easily manage resources using the with statement.
  • Robust Exception Handling: Offers descriptive custom exception classes for different error categories (network, response formatting, and API errors).
  • Flexible Order Management: Supports standard, custom comments, package, drip-feed, and Subscription orders out of the box.
  • Security-First: Excludes the API Key from default object representations (__repr__) to prevent accidental leaks in logs.
  • Modern User-Agent: Configured with a modern browser User-Agent to prevent Cloudflare and WAF blockers from rejecting requests.

Installation

You can install the package directly from PyPI:

pip install babismm

Quick Start

Basic Usage

from smm import SMM, SMMError, SMMAPIError

# Initialize the client
API_URL = "https://your-smm-panel-domain.com/api/v2"
API_KEY = "your_secret_api_key"

with SMM(api_url=API_URL, api_key=API_KEY) as client:
    try:
        # Check balance
        balance_info = client.get_balance()
        print(f"Current Balance: {balance_info['balance']} {balance_info['currency']}")

        # Get list of services
        services = client.get_services()
        print(f"Total services available: {len(services)}")

    except SMMAPIError as e:
        print(f"API Error occurred: {e}")
    except SMMError as e:
        print(f"An SMM client error occurred: {e}")

Creating Orders

1. Standard Order

order = client.add_order(
    service=100,  # Service ID
    link="https://www.instagram.com/p/abcdefg/",
    quantity=1000
)
print(f"Order placed successfully. Order ID: {order['order']}")

2. Subscription Order (No link/quantity required)

subscription = client.add_order(
    service=205,          # Subscription Service ID
    username="john_doe",
    min=100,              # Min likes per post
    max=500,              # Max likes per post
    posts=10,             # Cover next 10 posts
    delay=5               # Delay in minutes
)
print(f"Subscription active. ID: {subscription['order']}")

3. Drip-Feed Order

drip_feed = client.add_order(
    service=120,
    link="https://www.youtube.com/watch?v=xxxx",
    quantity=1000,
    runs=5,
    interval=60          # 60 minutes between runs
)
print(f"Drip-feed order created: {drip_feed['order']}")

Error Handling

This package provides granular exceptions to handle different failure modes:

  • SMMError: Base exception for all errors.
  • SMMNetworkError: Raised during TCP connection failures, timeouts, or when the server responds with a non-2xx HTTP status.
  • SMMResponseError: Raised when the response is not valid JSON (e.g. if the panel returns a Cloudflare block page or maintenance page).
  • SMMAPIError: Raised when the HTTP response is 200 OK but contains a panel-level error message like {"error": "Invalid API key"}.

Example:

from smm import SMM, SMMNetworkError, SMMResponseError, SMMAPIError

try:
    client.get_balance()
except SMMNetworkError as e:
    print("Network issue or SMM server down.")
except SMMResponseError as e:
    print(f"Invalid response from server. Status: {e.status_code}")
except SMMAPIError as e:
    print(f"API rejected the request: {e}")

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for babismm 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for babismm 1.0.1
File Size Uploaded
babismm-1.0.1.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for babismm 1.0.1
File Interpreter ABI Platform
babismm-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 kB

Release files / babismm-1.0.1.tar.gz

Download URL babismm-1.0.1.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
979ae28d978a4cc7231eaf6a45846288c03d9a4446005bbb3acf0a9e8cf8591b
BLAKE2b-256 checksum
How to use checksums
853d54fbf5fc5b7cdfdf0e2f456ae98e2577b65d128677c0189309a745e8b1ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release files / babismm-1.0.1-py3-none-any.whl

Download URL babismm-1.0.1-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
388b81d36a5be78800baed15486d6e2da7a2bb4e9a2addccc87ecf8f6f8740f4
BLAKE2b-256 checksum
How to use checksums
062d212e95966ccea6061877d1bf43c405b73d71e129dbfc731fbffc8ab6b655
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page