★ API
Telegram Stars API: Python quickstart
A minimal, production-safe flow in Python with the requests library.
Automatic deliverymost orders in minutes
Username checkbefore you pay
Open pricessame on site, bot, API
Public ledgerevery order gets a TxId
import os, uuid, requests
API = "https://paystars.uz/api/v1"
H = {"X-API-Key": os.environ["PAYSTARS_API_KEY"]}
chk = requests.post(f"{API}/check-username", headers=H,
json={"username": "durov", "kind": "stars"}).json()
order = requests.post(f"{API}/stars/buy",
headers={**H, "Idempotency-Key": str(uuid.uuid4())},
json={"username": "durov", "quantity": 50,
"verification_token": chk["verification_token"]}).json()
print(requests.get(f"{API}/order/{order['order_id']}", headers=H).json())- Store the Idempotency-Key with your own order and reuse it on retries — the API never charges twice.
- Respect the 3 requests/second limit per key; back off on HTTP 429.
Frequently asked questions
Is there a sandbox?
Use small real orders (50 Stars) while integrating; the idempotency key makes retries safe.
Which languages are supported?
Any language with HTTPS. See the Python, Node.js and PHP quickstarts.
Do API keys expire?
No. Keys stay valid until you revoke them in the dashboard.
Can I pay in USD?
Yes — top up the USD balance with USDT (TON or BEP20) and send currency=USD.
Related pages
Telegram Stars APISell Telegram Stars and Premium inside your own bot, shop or app.Telegram Stars API: Node.js quickstartNode 18+ has fetch built in — no extra packages needed.Telegram Stars API: PHP quickstartA compact cURL helper you can drop into any PHP project or bot.A simpler alternative to the Fragment APIFragment has no public API for reselling Stars and Premium.USD pricing for the APIRun your Stars business in dollars: a USD balance funded with USDT, live quotes and a price cap on every order.Buy Telegram StarsSend Stars to yourself or anyone with a public @username.
Ready to order?
Sign in with Telegram — your StarKerak balance works on the site, in the WebApp and through the API.
