Guide · updated November 2026

A Telegram bot for SMS verification resellers

By the Noir SMS team3 min read

Quick answer

A Telegram bot is a simple front end for selling verification numbers. The bot takes a command like /code tg us, calls POST /api/v1/numbers, replies with the number and polls GET /api/v1/numbers/{id} until the code arrives. In production, add your own user balances, use the sms.received webhook instead of polling, and keep your customers to the Acceptable Use Policy.

This example uses python-telegram-bot and httpx. It's a starting point, not a finished store.

Minimal bot

python
# Minimal Telegram bot: /code <service> <country>  (python-telegram-bot v21)
import os, asyncio, httpx
from telegram import Update
from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes

API = "https://noirsms.com/api/v1"
H = {"Authorization": f"Bearer {os.environ['NOIRSMS_KEY']}"}

async def code(update: Update, ctx: ContextTypes.DEFAULT_TYPE):
    service, country = ctx.args[0], ctx.args[1]
    async with httpx.AsyncClient(headers=H, timeout=20) as c:
        n = (await c.post(f"{API}/numbers", json={"service": service, "country": country})).json()
        if "error" in n:
            return await update.message.reply_text(n["error"]["message"])
        await update.message.reply_text(f"Your number: +{n['phone']}")
        for _ in range(300):
            s = (await c.get(f"{API}/numbers/{n['id']}")).json()
            if s["status"] == "received":
                return await update.message.reply_text(f"Code: {s['sms'][0]['code']}")
            if s["status"] in ("canceled", "expired"):
                return await update.message.reply_text("No SMS arrived; the charge was refunded.")
            await asyncio.sleep(4)

app = ApplicationBuilder().token(os.environ["BOT_TOKEN"]).build()
app.add_handler(CommandHandler("code", code))
app.run_polling()

Before you launch

  • Charge users from your own balance table before calling the API.
  • Store number ids so users can cancel after 2 minutes.
  • Rate-limit commands per user and log every order.
  • Explain refunds: numbers without an SMS are refunded automatically.

Rules

Use the API only for your own legitimate accounts or apps you're authorized to test, and make sure your customers follow the same Acceptable Use Policy.

Frequently asked questions

Can the bot accept crypto?

That's up to your bot. Your own Noir SMS balance can be topped up with USDC or SOL.

How many users can it handle?

Mind the 120 requests per minute limit per key; webhooks help a lot.

Services in this guide

Keep reading

Ready to receive your code?

Create a free account, add funds from $5 and get your first verification code in under a minute.