Автопополнение
Список правил для bandwidth
Все правила автопополнения bandwidth в вашем аккаунте
GET
/
api
/
v1
/
bandwidth
/
auto-refill
Список правил для bandwidth
curl --request GET \
--url https://api.example.com/api/v1/bandwidth/auto-refillimport requests
url = "https://api.example.com/api/v1/bandwidth/auto-refill"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/bandwidth/auto-refill', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/bandwidth/auto-refill",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/bandwidth/auto-refill"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/bandwidth/auto-refill")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/bandwidth/auto-refill")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"rules": [
{
"id": 123,
"target_address": "<string>",
"label": {},
"threshold_bandwidth": 123,
"add_volume": 123,
"duration": "<string>",
"status": "<string>",
"stopped_reason": {},
"consecutive_failures": 123,
"last_checked_at": {},
"last_available_bandwidth": {},
"last_read_error_at": {},
"last_refill_at": {},
"refill_count": 123,
"total_spent_trx": "<string>",
"created_at": "<string>",
"estimated_cost_per_refill_trx": {},
"volume_below_threshold": true
}
]
}Список правил для bandwidth
Возвращает все правила автопополнения bandwidth в вашем аккаунте, начиная со старых. Удалённые правила в список не входят. Нужен скоупview.
Ответ
array
Ваши правила для bandwidth.
Показать объект правила
Показать объект правила
number
ID правила — используйте его в путях изменения и удаления
string
Адрес, который правило держит обеспеченным
string | null
Ваше название правила
number
Правило покупает, когда доступного bandwidth меньше этого значения
number
Сколько bandwidth покупается за одно пополнение
string
Срок аренды для каждого пополнения —
1h или 1dstring
active, paused или stopped_insufficient_balance — см. Статус правилаstring | null
Почему правило поставлено на паузу или остановлено:
insufficient_balance, order_failed, activation_failed или invalid_params. null, если причины нет.number
Сколько пополнений подряд не прошло. Когда значение доходит до 5, правило ставится на паузу; успешное пополнение сбрасывает его в 0.
string | null
Когда мы в последний раз проверяли адрес (ISO 8601, UTC) — независимо от того, удалось ли его прочитать.
null до первой проверки.number | null
Bandwidth, доступный на адресе при последней успешной проверке, включая бесплатный.
null до первого успешного чтения.string | null
Когда проверке в последний раз не удалось прочитать адрес (ISO 8601, UTC).
null, если последняя проверка прошла успешно. Пока значение задано, last_available_bandwidth взято из более ранней проверки и может быть устаревшим. Проверка, которой не удалось прочитать адрес, ничего не покупает.string | null
Когда было последнее пополнение.
null, если пополнений ещё не было.number
Число успешных пополнений с момента создания правила
string
Сколько всего TRX потрачено на эти пополнения
string
Когда правило создано (ISO 8601, UTC)
string | null
Полная цена одного пополнения для вашего аккаунта по текущим ценам, включая фиксированную комиссию. Активация адреса, когда она нужна, оплачивается сверх.
null, если цена временно недоступна.boolean
true, когда add_volume меньше threshold_bandwidth. Тогда одного пополнения может не хватить, чтобы поднять адрес выше порога, и правило покупает снова после каждой траты, — см. предупреждение в обзоре.Пример
curl https://api.tronrental.com/v1/bandwidth/auto-refill \
-H "X-API-Key: your_api_key"
import requests
resp = requests.get(
"https://api.tronrental.com/v1/bandwidth/auto-refill",
headers={"X-API-Key": "your_api_key"},
)
print(resp.json())
const resp = await fetch("https://api.tronrental.com/v1/bandwidth/auto-refill", {
headers: { "X-API-Key": "your_api_key" },
});
console.log(await resp.json());
Response
{
"rules": [
{
"id": 15,
"target_address": "TYourRecipientAddress1234567890abc",
"label": "Payouts",
"threshold_bandwidth": 1000,
"add_volume": 5000,
"duration": "1h",
"status": "active",
"stopped_reason": null,
"consecutive_failures": 0,
"last_checked_at": "2026-10-14T09:41:02Z",
"last_available_bandwidth": 3655,
"last_read_error_at": null,
"last_refill_at": "2026-10-14T09:12:30Z",
"refill_count": 4,
"total_spent_trx": "1.480000",
"created_at": "2026-10-14T08:15:00Z",
"estimated_cost_per_refill_trx": "0.370000",
"volume_below_threshold": false
}
]
}
Ошибки
| Статус | Код | Когда |
|---|---|---|
403 | FORBIDDEN | У API-ключа нет скоупа view |
⌘I
Список правил для bandwidth
curl --request GET \
--url https://api.example.com/api/v1/bandwidth/auto-refillimport requests
url = "https://api.example.com/api/v1/bandwidth/auto-refill"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/bandwidth/auto-refill', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/bandwidth/auto-refill",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/bandwidth/auto-refill"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/bandwidth/auto-refill")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/bandwidth/auto-refill")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"rules": [
{
"id": 123,
"target_address": "<string>",
"label": {},
"threshold_bandwidth": 123,
"add_volume": 123,
"duration": "<string>",
"status": "<string>",
"stopped_reason": {},
"consecutive_failures": 123,
"last_checked_at": {},
"last_available_bandwidth": {},
"last_read_error_at": {},
"last_refill_at": {},
"refill_count": 123,
"total_spent_trx": "<string>",
"created_at": "<string>",
"estimated_cost_per_refill_trx": {},
"volume_below_threshold": true
}
]
}