★ API
Telegram Stars API: Node.js quickstart
Node 18+ has fetch built in — no extra packages needed.
Automatic deliverymost orders in minutes
Username checkbefore you pay
Open pricessame on site, bot, API
Public ledgerevery order gets a TxId
const API = "https://paystars.uz/api/v1";
const H = { "X-API-Key": process.env.PAYSTARS_API_KEY, "Content-Type": "application/json" };
const chk = await (await fetch(`${API}/check-username`, { method: "POST", headers: H,
body: JSON.stringify({ username: "durov", kind: "stars" }) })).json();
const order = await (await fetch(`${API}/stars/buy`, { method: "POST",
headers: { ...H, "Idempotency-Key": crypto.randomUUID() },
body: JSON.stringify({ username: "durov", quantity: 50, verification_token: chk.verification_token }) })).json();
console.log(await (await fetch(`${API}/order/${order.order_id}`, { headers: H })).json());- Generate the Idempotency-Key once per business order and persist it.
- Use currency: "USD" and max_usd to pay from the USD balance.
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: Python quickstartA minimal, production-safe flow in Python with the requests library.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.
