★ 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.

Ready to order?

Sign in with Telegram — your StarKerak balance works on the site, in the WebApp and through the API.