๐ Fragment API by @bohd4nx
Automate TON topups, Telegram Premium purchases, and Stars transactions via Fragment.com
[Report Bug](https://github.com/bohd4nx/fragmentapi/issues) ยท [Request Feature](https://github.com/bohd4nx/fragmentapi/issues) ยท [**Donate TON**](https://app.tonkeeper.com/transfer/UQBUAa7KCx1ifmoEy6lF7j-822Dm_cE1j9SR7UWteu3jzukV)
---
## โจ Features
- ๐ฐ **TON Advertisement Topups** - Send TON for advertising campaigns and purchasing gifts (1-1,000,000,000 TON)
- ๐ **Telegram Premium Gifts** - Purchase Premium subscriptions (3, 6, or 12 months)
- โญ **Telegram Stars Purchases** - Buy Stars for users (50-1,000,000 Stars)
## ๐ Quick Start
### 1. Installation
```bash
git clone https://github.com/bohd4nx/FragmentAPI.git
cd FragmentAPI
pip install -r requirements.txt
```
### 2. Configuration
Copy example configuration and edit:
```bash
cp .env.example .env
```
Edit `.env` file:
```env
COOKIES=your_fragment_cookies_here
SEED=word1 word2 word3 ... word24
HASH=your_fragment_hash_here
API_KEY=your_ton_api_key_here
```
### 3. Getting Required Data
#### ๐ช Fragment.com Cookies
**Prerequisites**: Login to your Telegram account and connect the TON wallet you want to use for payments.
1. **Install Cookie Editor Extension**:
- Download from [Chrome Web Store](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm)
- Add extension to your browser
2. **Extract Cookies**:
- Open [Fragment.com](https://fragment.com) and ensure you're logged in
- Refresh the page completely
- Click on the Cookie Editor extension icon
- Click **"Export"** button
- Select **"Header String"** format
- Copy the result โ paste to `COOKIES` in your `.env` file
- **Important**: Wrap the value in quotes to prevent semicolons from being treated as comments
**Expected format**:
```env
COOKIES = "stel_token=