Fragment.com API — Documentation (v0.0.4) Full automation API for Fragment.com — Telegram marketplace on TON blockchain. Multi-tenant: anyone can use it with their own key. TON wallet auto-pay, scheduled sniper, bulk purchases, structured marketplace data and persistent sessions BASE_URL: https://fragment-api.contact-3mh.workers.dev AUTH: Send Fragment cookies as Cookie header: stel_dt, stel_ssid, stel_token (+ stel_ton_token for purchases) — or log in ONCE with Telegram (GET /api/login or POST /api/auth/telegram/start) and the session is stored under your key WALLET: Setup a TON wallet once (POST /api/wallet/setup), then add auto_pay=1 to any purchase to sign & broadcast automatically. ── Utility / Docs ── ────────────────────────────────────────────────── GET / Interactive HTML documentation (this page) GET /docs.txt Plain-text documentation GET /health Health check GET /api/login Telegram login page (auto-generated key, one-click login) GET /api/key Generate a fresh random API key {ok, key} GET /api/hash Get fresh API hash GET /api/session Check saved/current session validity POST /api/session/save Save cookies ONCE (validated, AES-256-GCM) DELETE /api/session Clear saved session GET /api/session/helper Browser snippet to copy your cookies POST /api/raw Call any Fragment API method directly GET /api/page Scrape raw marketplace page HTML GET /api/marketplace Structured JSON listings {type, sort, filter, q, limit} ── Telegram Login (auto session) ── ────────────────────────────────────────────────── POST /api/auth/telegram/start Start login {phone, stel_dt?} — Telegram pushes a confirm request → {session_id} — your key POST /api/auth/telegram/status Poll {session_id} → {status:'waiting'} until confirmed → logs into Fragment and SAVES the session — your key POST /api/auth/telegram/finish Finish with an existing Telegram result {id_token} or {auth} → saves the session — your key ── Sniper (auto-bid) ── ────────────────────────────────────────────────── POST /api/sniper/create Arm an auto-bid {item, type, max_bid, trigger_seconds?, auto_pay?, webhook?} — your key GET /api/sniper/list List YOUR sniper tasks — your key POST /api/sniper/remove Remove task {id} — your key POST /api/sniper/run Run the sniper now (cron runs it every minute) — your key ── Wallet / Auto-pay ── ────────────────────────────────────────────────── POST /api/wallet/setup Store 24-word seed {seed} OR register an external {address} (read-only) — protected by YOUR key GET /api/wallet Public info: address, balance, seqno — your key (X-API-Key) or ?address= DELETE /api/wallet Remove YOUR wallet — your key POST /api/wallet/pay Sign & send payment {to, amount_ton|amount_nano, payload?} — your key POST /api/wallet/pay/tx Sign & send TonConnect messages {messages[]} or {transaction} — your key GET /api/wallet/activity Last 20 wallet transactions POST /api/tx/status Check a payment {hash} — your key ── Bulk actions ── ────────────────────────────────────────────────── POST /api/stars/bulk Buy Stars for many recipients {recipients[], quantity, auto_pay?} ── Search ── ────────────────────────────────────────────────── GET /api/search Browse marketplace (?type=usernames&sort=price_desc&filter=auction&q=) POST /api/search/auctions Search auctions {query, type, offset_id} ── Auction ── ────────────────────────────────────────────────── POST /api/auction/state Get auction state {type, username} POST /api/auction/bid Place bid {type, username, bid} POST /api/auction/offer/init Init direct offer {type, username} POST /api/auction/offer/confirm Confirm offer {id, amount} POST /api/auction/sell Start auction {type, username, min_amount, max_amount?} POST /api/auction/cancel Cancel auction {type, username} POST /api/auction/subscribe Subscribe to updates {type, username} POST /api/auction/unsubscribe Unsubscribe {type, username} POST /api/auction/can-sell Check sell eligibility {type, username, auction} ── Stars ── ────────────────────────────────────────────────── POST /api/stars/state Init Stars page {mode?, lv?, dh?} POST /api/stars/prices Get Stars prices {stars, quantity} POST /api/stars/search Search recipient {query, quantity} POST /api/stars/buy Buy Stars for user {recipient, quantity, show_sender?, auto_pay?} POST /api/stars/buy-self Buy Stars for yourself {quantity, auto_pay?} POST /api/stars/repeat Repeat last Stars purchase ── Stars Giveaway ── ────────────────────────────────────────────────── POST /api/stars-giveaway/state Init page POST /api/stars-giveaway/prices Get prices {stars, quantity} POST /api/stars-giveaway/search Search recipient {query} POST /api/stars-giveaway/create Create giveaway {recipient, quantity, stars, days, auto_pay?} POST /api/stars-giveaway/repeat Repeat last ── Premium ── ────────────────────────────────────────────────── POST /api/premium/state Init Premium page POST /api/premium/search Search recipient {query, months} POST /api/premium/gift Gift Premium {recipient, months: 3|6|12, auto_pay?} POST /api/premium/repeat Repeat last ── Premium Giveaway ── ────────────────────────────────────────────────── POST /api/premium-giveaway/state Init page POST /api/premium-giveaway/prices Get prices {quantity} POST /api/premium-giveaway/search Search channel {query} POST /api/premium-giveaway/create Create giveaway {recipient, quantity, months, auto_pay?} POST /api/premium-giveaway/repeat Repeat last ── Ads ── ────────────────────────────────────────────────── POST /api/ads/topup/state Init topup page POST /api/ads/topup/search Search account {query} POST /api/ads/topup Topup someone {recipient, amount, auto_pay?} POST /api/ads/recharge Recharge own {recipient, amount, auto_pay?} POST /api/ads/repeat-topup Repeat topup POST /api/ads/repeat-recharge Repeat recharge POST /api/ads/revenue/state Init withdrawal page POST /api/ads/revenue/withdraw Withdraw revenue {amount, address} ── Gateway ── ────────────────────────────────────────────────── POST /api/gateway/state Init page POST /api/gateway/prices Get prices {quantity} POST /api/gateway/recharge Recharge {quantity, auto_pay?} POST /api/gateway/repeat Repeat last ── Assets ── ────────────────────────────────────────────────── POST /api/assets List owned assets {type, offset_id?} POST /api/assets/assign Assign username {type, username, assign_to} POST /api/assets/bot-link Get bot link {id} ── NFT ── ────────────────────────────────────────────────── POST /api/nft/convert/init Start conversion {username} POST /api/nft/convert/check Check conversion {id} POST /api/nft/convert/start Finalize conversion {id, bid, transaction} POST /api/nft/convert/revert Revert conversion {username, confirmed} POST /api/nft/transfer Transfer NFT {username, recipient} POST /api/nft/transfer/check Check transfer {id} POST /api/nft/withdraw Withdraw to wallet {username, address} ── Random ── ────────────────────────────────────────────────── POST /api/random/state Init page POST /api/random/play Play {amount, number} POST /api/random/repeat Repeat last ── Login Codes ── ────────────────────────────────────────────────── POST /api/login-codes/state Get state POST /api/login-codes/toggle Toggle codes {enabled} POST /api/login-codes/terminate Terminate sessions {phone} ── KYC ── ────────────────────────────────────────────────── POST /api/kyc/token Get KYC token POST /api/kyc/status Update KYC status ── Fragment Wallet / Auth ── ────────────────────────────────────────────────── POST /api/auth/ton-link Get TON auth link POST /api/auth/ton-proof Verify wallet proof {account, device, proof} POST /api/auth/ton-logout Disconnect TON wallet POST /api/wallet/verify Verify wallet {address, proof} POST /api/wallet/check Check wallet {address} POST /api/wallet/link Link wallet {address, proof} POST /api/wallet/sessions Get active sessions POST /api/wallet/terminate Terminate session {session_id} POST /api/auth/logout Full logout ── History ── ────────────────────────────────────────────────── POST /api/history/bids Bids history POST /api/history/premium Premium history POST /api/history/orders Orders history POST /api/history/owners Ownership history ── Stars Revenue ── ────────────────────────────────────────────────── POST /api/stars-revenue/state Init withdrawal page POST /api/stars-revenue/withdraw Withdraw revenue {amount, address} ── Tonkeeper ── ────────────────────────────────────────────────── GET /api/tonkeeper/raw Get raw TX data (?id=req_xxx) TOTAL ENDPOINTS: 105 EXAMPLE: curl -X POST "https://fragment-api.contact-3mh.workers.dev/api/stars/buy" -H "X-API-Key: your-key" -H "Cookie: stel_dt=-240; stel_ssid=xxx; stel_token=xxx; stel_ton_token=xxx" -H "Content-Type: application/json" -d '{"recipient":"durov","quantity":"100"}' © 2026 3MH TECHNOLOGIES — https://3mh.pages.dev/ — All rights reserved.