Interactive Python examples • Auth via X-API-Key • Issued in Telegram: @saving_trx_bot
https://YOUR_API_URL
X-API-Key: <YOUR_KEY>. Use Idempotency-Key for POSTs./v1/me/balanceGet current balance in SUN and TRX.
import requests
BASE_URL = "https://YOUR_API_URL"
API_KEY = "YOUR_API_KEY"
r = requests.get(
f"{BASE_URL}/v1/me/balance",
headers={"X-API-Key": API_KEY},
timeout=15
)
print(r.status_code)
print(r.json())
{
"balance_sun": 123456789,
"balance_trx": 123.456789
}
/v1/me/transactionsList recent transactions (top-ups, energy orders, etc.).
import requests
BASE_URL = "https://YOUR_API_URL"
API_KEY = "YOUR_API_KEY"
params = {"limit": 50} # 1..500, default 50
r = requests.get(
f"{BASE_URL}/v1/me/transactions",
headers={"X-API-Key": API_KEY},
params=params,
timeout=20
)
print(r.status_code)
for item in r.json():
print(item["id"], item["kind"], item["status"], item.get("energy"))
[
{
"id": 1,
"kind": "ORDER",
"amount": 65000,
"wallet": "TX...",
"energy": 65000,
"status": "DONE",
"balance_before": 123456,
"balance_after": 58456,
"created_at": "2025-01-01T12:00:00Z"
}
]
/v1/orderCreate energy order for a TRON wallet.
import requests
import uuid
BASE_URL = "https://YOUR_API_URL"
API_KEY = "YOUR_API_KEY"
payload = {
"wallet": "TX12345678901234567890123456789012", # 34 chars, starts with 'T'
"energy": 65000 # or 130000
}
headers = {
"X-API-Key": API_KEY,
"Idempotency-Key": str(uuid.uuid4()), # optional but recommended
"Content-Type": "application/json"
}
r = requests.post(
f"{BASE_URL}/v1/order",
headers=headers,
json=payload,
timeout=20
)
print(r.status_code)
print(r.json())
{
"ok": true,
"balance_sun_after": 999999,
"balance_trx_after": 999.999,
"price_trx": 2.9,
"price_currency": "TRX",
"external_status_code": 200,
"external_order_id": null,
"external_body": null,
"tx_id": 12345
}
/v1/me/profileGet client profile and balances.
import requests
BASE_URL = "https://YOUR_API_URL"
API_KEY = "YOUR_API_KEY"
r = requests.get(
f"{BASE_URL}/v1/me/profile",
headers={"X-API-Key": API_KEY},
timeout=15
)
print(r.json())
{
"api_key": "...",
"name": "Partner A",
"description": "OTC desk",
"balance_sun": 123456789,
"balance_trx": 123.456789,
"deposit_address": "TX..."
}
/v1/me/tariffsGet current tariffs for energy packages.
import requests
BASE_URL = "https://YOUR_API_URL"
API_KEY = "YOUR_API_KEY"
r = requests.get(
f"{BASE_URL}/v1/me/tariffs",
headers={"X-API-Key": API_KEY},
timeout=15
)
print(r.json())
{
"65000": 2.9,
"130000": 5.8
}