🧩 Simple API client wrapper for Fragment, purchase of Telegram Stars & Premium
Project description
⚡️ 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)
-
✅ TON Wallet v4r2 🪙
-
✅ TON Wallet should be Active (send any transaction from it) 🪙
📌 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()
# Ping
print("API ping:", client.ping())
# Replace with your 24 words seed phrase from TON v4r2 Wallet
seed = "your_24_words_seed_phrase"
# Replace with your Fragment cookies exported from Cookie-Editor extension as Header String
# https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm
fragment_cookies = "your_fragment_cookies"
# Get balance
res = client.get_balance(seed=seed)
print("Balance:", res)
# Get user info
res = client.get_user_info(
username="NightStrang6r", # or "@NightStrang6r", or "https://t.me/NightStrang6r"
fragment_cookies=fragment_cookies
)
print("User info:", res)
# Buy stars without KYC
res = client.buy_stars_without_kyc(
username="NightStrang6r", # or "@NightStrang6r", or "https://t.me/NightStrang6r"
amount=100,
seed=seed
)
print("Buy stars without KYC response:", res)
# Buy stars
res = client.buy_stars(
username="NightStrang6r", # or "@NightStrang6r", or "https://t.me/NightStrang6r"
amount=100,
show_sender=False,
fragment_cookies=fragment_cookies,
seed=seed
)
print("Buy stars response:", res)
# Buy Telegram Premium without KYC
res = client.buy_premium_without_kyc(
username="NightStrang6r", # or "@NightStrang6r", or "https://t.me/NightStrang6r"
duration=3, # 3 or 6 or 12 months
fragment_cookies=fragment_cookies,
seed=seed
)
print("Buy Telegram Premium without KYC response:", res)
# Buy Telegram Premium
res = client.buy_premium(
username="NightStrang6r", # or "@NightStrang6r", or "https://t.me/NightStrang6r"
duration=3, # 3 or 6 or 12 months
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fragment_api_lib-1.0.1.tar.gz.
File metadata
- Download URL: fragment_api_lib-1.0.1.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c305da1d6409740be6dea3d4b5d85790a6ee7af5db9189703394cb27be52ffb
|
|
| MD5 |
446cf3bb5305e72526f546b62efb9cbc
|
|
| BLAKE2b-256 |
f90fabd2efdd64009464f4b2d59597dc12331c4b00d01ef86827a08387bfe087
|
File details
Details for the file fragment_api_lib-1.0.1-py3-none-any.whl.
File metadata
- Download URL: fragment_api_lib-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e45e6c15d468cf7a05eee9876dbb7d4679dc027862eaca482645473777b2640
|
|
| MD5 |
b80aae8416bacc795fe7b60ce01f5dbc
|
|
| BLAKE2b-256 |
b62c636c69b1078ec28d7b2ba1989099ee73f3dee7d3bec14a6e60062b0768a0
|