Python SDK
Current version: 2.1.6
The current official client is fragment-stars-api 2.1.6. It uses https://api.fragment-api.space by default.
Install with pipbash
pip install fragment-stars-api
통합 가이드
민감한 지갑 및 세션 데이터는 백엔드에 남아 있습니다.
Current version: 2.1.6
The current official client is fragment-stars-api 2.1.6. It uses https://api.fragment-api.space by default.
pip install fragment-stars-api
There is no published TypeScript SDK. Use the standard fetch API against the REST service from Node.js or server-side TypeScript.
https://api.fragment-api.spaceThe primary Stars flow in version 2.1.6 uses buy_stars and /api/v1/stars/buy.
from fragment_api import FragmentAPIClientclient = FragmentAPIClient()result = client.buy_stars(username="@telegram_user",amount=100,seed="YOUR_BASE64_ENCODED_SEED",cookies="YOUR_BASE64_ENCODED_COOKIES",payment_method="ton",account_index=0,)print(result.success)
Public client methods and their equivalent direct REST requests.
prices = client.get_prices()rates = client.get_rates()queue = client.get_queue_status()eligibility = client.check_premium_eligibility("@telegram_user")status = client.get_status("REQUEST_ID")wallet = client.resolve_wallet(seed="YOUR_BASE64_ENCODED_SEED",wallet_address="YOUR_TON_WALLET_ADDRESS",)print(wallet.account_index)premium = client.buy_premium(username="@telegram_user",duration=3,seed="YOUR_BASE64_ENCODED_SEED",)
Start with the ready-made Telegram Stars and Premium shop, browse the Python source, or open the full REST reference.