⚡️ fragment-api-lib ⚡️
✨ Simple Python library for fast integration with Fragment (fragment.com) ✨
🚀 Info
fragment-api-lib is a simple API client wrapper for Fragment, which uses fragment-api.net under the hood. It supports:
-
💸 Purchase Telegram Stars & Premium
-
✅ Works with or without KYC
-
🔂 Bypass Fragment purchase limits
-
🔐 End-to-end encryption supported
-
🧩 No API key or registration required
-
💙 No need to use the TON API directly
-
📦 Built-in request models for clean integration
-
📈 Supports multi-order transactions
-
🧠 Lightweight & developer-friendly
📌 Requirements (without KYC)
📌 Requirements (with KYC)
-
✅ Fragment account with linked TON wallet and Telegram account 🔗
-
✅ KYC verification on Fragment 🆔
-
✅ Export cookies from Fragment 🍪 (as Header String using Cookie Editor extension)
➕ Installation
pip install fragment-api-lib
☑️ Usage examples
from fragment_api_lib.client import FragmentAPIClient
from fragment_api_lib.models import *
client = FragmentAPIClient()
print("API ping:", client.ping())
seed = "your_24_words_seed_phrase"
fragment_cookies = "your_fragment_cookies"
res = client.get_balance(seed=seed)
print("Balance:", res)
res = client.get_user_info(
username="NightStrang6r",
fragment_cookies=fragment_cookies
)
print("User info:", res)
res = client.buy_stars_without_kyc(
username="NightStrang6r",
amount=100,
seed=seed
)
print("Buy stars without KYC response:", res)
res = client.buy_stars(
username="NightStrang6r",
amount=100,
show_sender=False,
fragment_cookies=fragment_cookies,
seed=seed
)
print("Buy stars response:", res)
res = client.buy_premium_without_kyc(
username="NightStrang6r",
duration=3,
fragment_cookies=fragment_cookies,
seed=seed
)
print("Buy Telegram Premium without KYC response:", res)
res = client.buy_premium(
username="NightStrang6r",
duration=3,
show_sender=False,
fragment_cookies=fragment_cookies,
seed=seed
)
🎉 Like it? Star it!
Please rate this repository by giving it a star rating in the top right corner of the GitHub page (you must be logged in to your account). Thank you ❤️

📄 License
This repository is licensed under Apache Licence 2.0.
Made with ❤️ by NightStrang6r