Python SDK & REST

Two ways in: the Python SDK — which verifies and signs locally — or direct REST from any backend. Either way, the seed stays on your server.

Install and choose an integration

Python SDK

Current version: 0.1.0 · Uses https://fragment-api.mboxcommunity.org by default.

The SDK is part of the public repository — read it before you run it; it is the component that signs.

pip install fragment-api-sdk
# Requires: Python 3.10+, Node 18+ (TON signing helper)

View on PyPI →

Direct REST

No published TypeScript SDK. Use the standard fetch API against the REST service from Node.js or any server-side language.

https://fragment-api.mboxcommunity.org

If you sign without our SDK, your signer must implement the same verification checklist — pinned addresses, fee cap, spend limits, short expiry.

Code examples

Buy Stars with the Python SDK

from fragment_api_sdk import FragmentAPI

api = FragmentAPI(api_key="mfrag_…",
                  cookies={"stel_ssid": "…", "stel_dt": "…", "stel_token": "…"},
                  seed="<24 words — never leaves this machine>",
                  max_ton_per_order=5_000_000_000)   # mandatory spend limit

order = api.buy_stars("@durov", 100)        # verify → sign locally → submit
print(order["status"])                      # success

Buy Premium

order = api.buy_premium("@durov", 12)       # 3 | 6 | 12 months

Read status, prices, and rates

# Python
print(api.get_order(order["id"]))

# REST equivalents
curl https://fragment-api.mboxcommunity.org/health
curl https://fragment-api.mboxcommunity.org/api/v1/commission/rates
curl https://fragment-api.mboxcommunity.org/api/v1/prices

Public methods

Build from a working reference

Start with the full REST reference, browse the engine source, or read how the purchase flow works end to end.

REST reference Browse the source