Async Python library for Fragment.com API with seqno/balance confirmation and confirmReq
Project description
Fragment API Python
Async Python library for Fragment.com automation — purchases, marketplace, bids, and management.
Installation
pip install fragment-api-py
Quick Start
import asyncio
from FragmentAPI import FragmentClient
async def main():
client = FragmentClient(
seed="your 24 word mnemonic...",
cookies={"stel_ssid": "...", "stel_token": "...", "stel_dt": "...", "stel_ton_token": "..."}
)
# Get wallet info
wallet = await client.get_wallet()
print(f"Balance: {wallet.balance_ton} TON")
# Purchase Telegram Stars
result = await client.purchase_stars("@username", amount=100)
print(f"Transaction: {result.transaction_id}")
# Purchase Telegram Premium
await client.purchase_premium("@username", months=6)
# Place bid on username
await client.place_bid(item_type=1, slug="username", bid=150)
# Search marketplace
items = await client.search_usernames("gold", filter="sale")
asyncio.run(main())
Auto-Authentication
cookies = await FragmentClient.authenticate(
seed="24 words...",
telegram_phone="+71234567890" # or telegram_auth_data
)
client = FragmentClient(seed="...", cookies=cookies)
Features
| Feature | Description |
|---|---|
| Purchases | Stars (50–10M), Premium (3/6/12 mo), TON Ads |
| Giveaways | Stars & Premium for channels |
| Bids | Usernames (type=1), Numbers (type=3), Gifts (type=5) |
| Marketplace | Search with filters & pagination |
| Wallet | V4R2 & V5R1 (W5) support |
| Anonymous Numbers | Login codes, session termination |
| NFT | Withdraw/transfer gifts to wallet |
| Stars Revenue | Withdraw earned Stars |
Requirements
- Python 3.10+
- Fragment cookies:
stel_ssid,stel_dt,stel_token,stel_ton_token - TON wallet seed phrase
Documentation
Support
💬 Telegram Chat | 🐛 GitHub Issues
License
MIT
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
fragment_api_py-6.0.1.tar.gz
(37.2 kB
view details)
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_py-6.0.1.tar.gz.
File metadata
- Download URL: fragment_api_py-6.0.1.tar.gz
- Upload date:
- Size: 37.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
212df68c98baa2c3edf1dcb69418a4c32ff3b7d25decc1187dfc088493d1fae5
|
|
| MD5 |
34c2736242299fd60894b78d5a8c72ef
|
|
| BLAKE2b-256 |
f03cee2e157d418126ce7185de2738f1c47d907ef8d81ca648713ae8a191d045
|
File details
Details for the file fragment_api_py-6.0.1-py3-none-any.whl.
File metadata
- Download URL: fragment_api_py-6.0.1-py3-none-any.whl
- Upload date:
- Size: 48.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff9915b3d6c43ac2c11426b351ed8759e4e74c2d904098a6b2be1fd334a2f53d
|
|
| MD5 |
09e5de36c2924f47421751c93bfd7e2d
|
|
| BLAKE2b-256 |
474549b940e73d6ccbaf996dd8f1ed8d772679f3bd22f3d387f5b08ffb63f985
|