/api/auth/telegramPublicAuthenticate via Telegram Login Widget
{ "id": 123456789, "firstName": "...", "authDate": 1710000000, "hash": "..." }{ "token": "eyJ...", "username": "...", "walletBalance": 1.5, "commissionRate": 0.05 }Integrate TGTools into your own services. Purchase Telegram Stars and Premium programmatically, check wallet balances, and track orders — all via a simple REST API.
Protected endpoints accept either a short-lived JWT or a long-lived API key (tgt_...) from Settings.
Get a token from POST /api/auth/telegram. Expires in ~60 minutes.
Authorization: Bearer <your-jwt-token>
Generate from Settings → API Keys. No expiry until revoked. Use X-Api-Key or Authorization: Bearer tgt_...
X-Api-Key: tgt_<your-api-key>
Authorization: Bearer tgt_<your-api-key>
Base URL: https://api.tg-tools.shop
/api/auth/telegramPublicAuthenticate via Telegram Login Widget
{ "id": 123456789, "firstName": "...", "authDate": 1710000000, "hash": "..." }{ "token": "eyJ...", "username": "...", "walletBalance": 1.5, "commissionRate": 0.05 }/api/auth/telegram/miniappPublicAuthenticate via Telegram Mini App initData
{ "initData": "query_id=...&user=...&hash=..." }{ "token": "eyJ...", "username": "...", "walletBalance": 0 }/api/walletAuth requiredGet your wallet balance and deposit info
{ "balance": 1.5, "depositAddress": "UQ...", "depositMemo": "TGT-ABCD" }/api/wallet/deposits?page=1&pageSize=20Auth requiredList your deposit history
{ "items": [...], "total": 5 }/api/purchase/pricesPublicGet current prices (public; logged-in users get their commission rate applied)
{ "stars_price_ton": 0.0105, "premium_3m_ton": 8.3, "premium_6m_ton": 14.2, "premium_12m_ton": 24.5 }/api/purchase/user/{username}Auth requiredLook up a Telegram user by username — returns profile info, whether the account exists, and Premium eligibility (requires authentication)
curl -X GET https://api.tg-tools.shop/api/purchase/user/johndoe \ -H "X-Api-Key: tgt_YOUR_API_KEY"
{ "username": "johndoe", "found": true, "displayName": "John Doe", "photoUrl": "https://...", "premiumEligible": true }/api/purchase/starsAuth requiredPurchase Telegram Stars for any username
{ "recipientUsername": "johndoe", "amount": 100, "paymentMethod": "ton", "payFromBalance": true }{ "transactionId": 42, "status": "Completed", "costTon": 1.05, "createdAt": "2026-07-01T00:00:00Z" }/api/purchase/premiumAuth requiredPurchase Telegram Premium (3, 6, or 12 months)
{ "recipientUsername": "johndoe", "months": 3, "paymentMethod": "ton", "payFromBalance": true }{ "transactionId": 43, "status": "Completed", "costTon": 8.37, "createdAt": "2026-07-01T00:00:00Z" }/api/transaction?page=1&pageSize=20&status=Completed&type=StarsAuth requiredList your orders with optional filters
{ "items": [...], "total": 10 }/api/transaction/{id}Auth requiredGet a single order by ID
{ "id": 42, "status": "Completed", "costTon": 1.05, "recipientUsername": "johndoe" }/api/marketplace/quote?address=0:...Auth requiredGet purchase quote for a gift NFT
curl -X GET "https://api.tg-tools.shop/api/marketplace/quote?address=0:..." \ -H "X-Api-Key: tgt_YOUR_API_KEY"
{ "nftAddress": "0:...", "totalPriceTon": 1.115, "canBuy": true }/api/marketplace/collections?offset=0&limit=100&search=lolAuth requiredList all Telegram gift NFT collections
curl -X GET "https://api.tg-tools.shop/api/marketplace/collections?limit=50" \ -H "X-Api-Key: tgt_YOUR_API_KEY"
{ "items": [{ "address": "0:...", "name": "Lol Pop", "supply": 100000 }], "total": 120, "hasMore": true }/api/marketplace/collections/{address}Auth requiredGet collection summary (floor, supply, listed count)
curl -X GET https://api.tg-tools.shop/api/marketplace/collections/0:... \ -H "X-Api-Key: tgt_YOUR_API_KEY"
{ "address": "0:...", "name": "Lol Pop", "supply": 100000, "floorTon": 1.2, "listedForSale": 42 }/api/marketplace/collections/{address}/items?offset=0&limit=50&sort=price_asc&onSaleOnly=trueAuth requiredList NFTs in a collection (paginated, filterable)
curl -X GET "https://api.tg-tools.shop/api/marketplace/collections/0:.../items?onSaleOnly=true" \ -H "X-Api-Key: tgt_YOUR_API_KEY"
{ "items": [{ "address": "0:...", "name": "Lol Pop #1", "salePriceTon": 1.5, "isOnSale": true }], "hasMore": true }/api/marketplace/nft?address=0:...Auth requiredGet full NFT detail (metadata, sale/rental state, history)
curl -X GET "https://api.tg-tools.shop/api/marketplace/nft?address=0:..." \ -H "X-Api-Key: tgt_YOUR_API_KEY"
{ "address": "0:...", "name": "Lol Pop #1", "isOnSale": true, "salePriceTon": 1.5, "platformSaleListing": { "priceTon": 1.4 } }/api/marketplace/nft-by-slug?collection=lol-pop&number=392829Auth requiredLook up NFT by collection slug and number (e.g. lol-pop #392829)
curl -X GET "https://api.tg-tools.shop/api/marketplace/nft-by-slug?collection=lol-pop&number=392829" \ -H "X-Api-Key: tgt_YOUR_API_KEY"
{ "address": "0:...", "name": "Lol Pop #392829", "isOnSale": true }/api/marketplace/buy/autoAuth requiredAPI-only: buy a gift NFT from wallet balance (no Tonkeeper). Requires 500+ TON lifetime deposits. Poll GET /api/marketplace/orders/{id}.
curl -X POST https://api.tg-tools.shop/api/marketplace/buy/auto \
-H "X-Api-Key: tgt_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"nftAddress":"0:...","recipientTonAddress":"UQ...","clientOrderId":"order-001"}'{ "nftAddress": "0:...", "recipientTonAddress": "UQ...", "clientOrderId": "order-001" }{ "orderId": 12, "status": "PaymentReceived", "totalPriceTon": 1.115, "recipientTonAddress": "UQ..." }/api/marketplace/orders/{id}Auth requiredPoll NFT purchase order status (PaymentReceived → Complete)
{ "orderId": 12, "status": "Complete", "nftAddress": "0:...", "totalPriceTon": 1.115 }