Skip to main content

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

Project description

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 smm-panel-client

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

babismm-1.0.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

babismm-1.0.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file babismm-1.0.0.tar.gz.

File metadata

  • Download URL: babismm-1.0.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for babismm-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c3f27323bfce7fcf5115ec3ad6cf3ceac5f5aab3c13812db3d02f78cde709ea4
MD5 8a457dbaa910fa1e8662f1711b8d43f6
BLAKE2b-256 55a39b91b158dd8df69f65297d3a209ff1395a0c2c2f44e94fe02b3581f3d425

See more details on using hashes here.

File details

Details for the file babismm-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: babismm-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for babismm-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5b3d16aa23e07813512199112b2950f4fb5c024b95740d0d85a2d817849454a
MD5 d9f80997533f953f0eb37adf5bf62152
BLAKE2b-256 2f6cfb4a8dc61fc810fcebccbee01e39435d9b5366b2d34d48444dccbbd5d763

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page