DEV Community

SEO - NT Tech Innovation
SEO - NT Tech Innovation

Posted on

Converting SMM Panel USD Rates to Taka for a Bangladeshi Reseller Price List (Python)

Many SMM panels list rates in USD per 1,000, while Bangladeshi customers think in Taka and pay with bKash. If you resell, you need a clean BDT price list that updates when your supplier's rates or the exchange rate change. Here's a small Python script for that.

Pull the supplier's service list

Most panels expose a standard /api/v2 endpoint where action=services returns JSON with service, name, category, rate, min and max.

import os, requests

API_URL = os.environ["PANEL_URL"]      # e.g. https://your-supplier/api/v2
API_KEY = os.environ["PANEL_KEY"]

def services():
    r = requests.post(API_URL, data={"key": API_KEY, "action": "services"}, timeout=30)
    r.raise_for_status()
    return r.json()
Enter fullscreen mode Exit fullscreen mode

Convert and add your margin

from decimal import Decimal, ROUND_UP

def bdt_price(usd_rate: str, fx: Decimal, margin: Decimal) -> int:
    """USD per 1k -> rounded-up whole Taka per 1k, with margin."""
    cost = Decimal(usd_rate) * fx
    price = cost * (1 + margin)
    return int(price.quantize(Decimal("1"), rounding=ROUND_UP))

FX = Decimal(os.environ.get("USD_BDT", "122"))   # set from the rate you actually top up at
MARGIN = Decimal("0.35")

rows = []
for s in services():
    if "Bangladesh" not in s["name"] and "🇧🇩" not in s["name"]:
        continue  # keep the list focused on local services
    rows.append((s["service"], s["name"][:60], bdt_price(s["rate"], FX, MARGIN), s["min"], s["max"]))

for r in sorted(rows, key=lambda x: x[2]):
    print(f"{r[0]:>5}  à§³{r[2]:>5}/1k  min {r[3]:>5}  {r[1]}")
Enter fullscreen mode Exit fullscreen mode

Why Decimal and ROUND_UP

Floats give you prices like à§³321.99999. Customers notice. Decimal keeps money exact, and rounding up protects your margin on tiny rates.

Keep FX honest

Don't hardcode an exchange rate from a news site. Use the rate your supplier's add-funds page actually applies when you top up with bKash. That's your real cost.

Next steps

Write the output to a CSV, then paste it into your own panel or a Google Sheet your customers can see.

For a Bangladeshi supplier with an API, Bangladesh-targeted Facebook services and bKash top-ups, see SMM Booster BD's API page. Their services list shows the same fields this script reads.

Top comments (0)