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
withstatement. - 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file babismm-1.0.1.tar.gz.
File metadata
- Download URL: babismm-1.0.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
979ae28d978a4cc7231eaf6a45846288c03d9a4446005bbb3acf0a9e8cf8591b
|
|
| MD5 |
d6704fd028b692cdf03c520268d3d4c9
|
|
| BLAKE2b-256 |
853d54fbf5fc5b7cdfdf0e2f456ae98e2577b65d128677c0189309a745e8b1ba
|
File details
Details for the file babismm-1.0.1-py3-none-any.whl.
File metadata
- Download URL: babismm-1.0.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
388b81d36a5be78800baed15486d6e2da7a2bb4e9a2addccc87ecf8f6f8740f4
|
|
| MD5 |
3a033754fb9d24f2ccd78b787def3767
|
|
| BLAKE2b-256 |
062d212e95966ccea6061877d1bf43c405b73d71e129dbfc731fbffc8ab6b655
|