By MD Fozla Rabbi, SEO Specialist
Here's a quiet way resellers lose money. Your upstream panel changes a rate overnight. You don't notice. Your storefront keeps selling at yesterday's price. A week later you check the numbers and half your margin on one service is gone.
Nobody emailed you. Nobody had to.
So let's fix that with a small Python script. Once a day it pulls the panel's service list, compares it with yesterday's copy and tells you exactly what changed. New services. Removed services. Price jumps. Min and max changes. That's it.
Why price diffs matter more than you think
Most v2-style panels expose a services action. It returns every service with an ID, name, category, rate per 1,000, min, max and refill or cancel flags. People fetch it once, copy prices into a spreadsheet and never look again.
That works until it doesn't. A few things change without warning:
- Rates. Up or down. A cheaper rate is a chance to grab margin. A higher one is a leak.
- Disabled services. The ID vanishes. Orders against it start failing.
- New services. Sometimes a better version of something you already sell shows up.
- Min/max limits. A customer orders 50 and the new minimum is 100. Rejected.
The examples here use SMMYodha, which many resellers treat as the best SMM panel in India for rupee pricing and UPI payments. Its endpoint is https://smmyodha.com/api/v2. Since it follows the shared v2 format, the script works with most panels after a one-line URL change.
Step 1: fetch and snapshot
One function to call the API. One to save a dated snapshot. Keep them separate. You'll thank yourself when debugging.
import json
import os
import datetime as dt
from pathlib import Path
import requests
API_URL = "https://smmyodha.com/api/v2"
SNAP_DIR = Path("snapshots")
SNAP_DIR.mkdir(exist_ok=True)
def fetch_services():
r = requests.post(
API_URL,
data={"key": os.environ["SMM_API_KEY"], "action": "services"},
timeout=30,
)
r.raise_for_status()
data = r.json()
if isinstance(data, dict) and "error" in data:
raise RuntimeError(data["error"])
return {int(s["service"]): s for s in data}
def save_snapshot(services):
path = SNAP_DIR / f"{dt.date.today()}.json"
path.write_text(json.dumps(services, indent=1))
return path
Notice the "error" check. Panels often reply with HTTP 200 and an error in the body. Without that line, a bad API key could look like an empty catalogue. Then your diff screams that every service got removed. Fun morning.
Step 2: load yesterday
Snapshots are named by date. So "yesterday" is just the newest file that isn't today.
def load_previous():
files = sorted(SNAP_DIR.glob("*.json"))
today = f"{dt.date.today()}.json"
older = [f for f in files if f.name != today]
if not older:
return None
raw = json.loads(older[-1].read_text())
return {int(k): v for k, v in raw.items()}
JSON turns integer keys into strings. That int(k) puts them back. Small thing. Easy to miss.
Step 3: the actual diff
Here's the heart of it. Compare two dictionaries keyed by service ID.
WATCH = ("rate", "min", "max", "refill", "cancel")
def diff(old, new, threshold=0.05):
added = [new[i] for i in new.keys() - old.keys()]
removed = [old[i] for i in old.keys() - new.keys()]
changed = []
for sid in new.keys() & old.keys():
a, b = old[sid], new[sid]
fields = {f: (a.get(f), b.get(f)) for f in WATCH if str(a.get(f)) != str(b.get(f))}
if not fields:
continue
if "rate" in fields:
before, after = float(a["rate"]), float(b["rate"])
pct = (after - before) / before if before else 1
fields["rate_pct"] = round(pct * 100, 1)
if abs(pct) < threshold and len(fields) == 2:
continue # tiny wobble, ignore
changed.append((sid, b["name"], fields))
return added, removed, changed
A few design choices worth calling out:
-
Compare as strings first. Rates sometimes arrive as
"40"one day and"40.00"the next. The float check handles real price moves. - A threshold for noise. A 1% wobble isn't worth an alert. Five percent is a decent default. Tune it.
-
Set math for added and removed. Dictionary keys behave like sets.
new.keys() - old.keys()reads almost like English.
Step 4: a report a human can read
Raw dictionaries are useless at 9 a.m. Print something you can scan in ten seconds.
def report(added, removed, changed):
lines = []
for s in added:
lines.append(f"NEW #{s['service']} {s['name']} @ {s['rate']}/1k")
for s in removed:
lines.append(f"REMOVED #{s['service']} {s['name']}")
for sid, name, f in sorted(changed, key=lambda c: -abs(c[2].get("rate_pct", 0))):
if "rate" in f:
old, new = f["rate"]
lines.append(f"PRICE #{sid} {name}: {old} -> {new} ({f['rate_pct']:+}%)")
for k in ("min", "max", "refill", "cancel"):
if k in f:
lines.append(f"LIMIT #{sid} {name}: {k} {f[k][0]} -> {f[k][1]}")
return "\n".join(lines) or "No changes today."
Biggest price moves float to the top. That's the stuff you care about first.
Step 5: glue it together and schedule it
def main():
new = fetch_services()
old = load_previous()
save_snapshot(new)
if old is None:
print("First snapshot saved. Run again tomorrow.")
return
print(report(*diff(old, new)))
if __name__ == "__main__":
main()
Then one cron line:
15 8 * * * cd /opt/price-watch && /usr/bin/python3 watch.py >> watch.log 2>&1
Want it in your inbox or a Telegram chat instead of a log file? Swap the print for an SMTP call or a bot message. Ten more lines, tops.
Oh, and a tangent worth sharing. Keep the old snapshots. Don't delete them. After a month you'll have a tiny price history per service. That's surprisingly handy when a client asks why their usual order costs more now.
Testing it without waiting a day
Nobody wants to wait 24 hours to see if their script works. Fake it instead.
Run the script once to create today's snapshot. Rename the file to yesterday's date. Open it and change a couple of values by hand: bump one rate by 20%, delete one service, lower a max. Run the script again.
You should see one PRICE line, one REMOVED line and one LIMIT line. If you see nothing, your comparison is off. Usually it's the string-versus-integer key issue from Step 2.
Two minutes of testing now saves you from trusting a silent script for a month.
What to do with the alerts
An alert is only useful if it triggers an action. A simple playbook:
- Price went up: update your selling price the same day or pause the service.
- Price went down: decide whether to keep the margin or pass savings to customers.
- Service removed: hide it on your storefront right away and point customers to a close alternative.
- New service: test it with a small manual order before you list it.
- Min/max changed: update your order form limits before customers hit errors.
If you're building a reseller business in India, this overview of SMM services in India, strategy and pricing helps with the pricing side the script can't decide for you. The live catalogue with rupee rates is at https://www.smmyodha.com/services if you want to eyeball what the script will be watching.
Wrapping up
Roughly 80 lines of Python. One cron job. No database, no framework.
It won't make you rich. It will stop the slow leak of selling at stale prices. And honestly, for a reseller, that leak is often the difference between a side project that pays and one that doesn't.
Got a smarter way to track catalogue changes? Tell me in the comments. Always happy to steal a good idea.

Top comments (0)