自动补充
列出带宽规则
您账户中的全部带宽自动补充规则
GET
/
api
/
v1
/
bandwidth
/
auto-refill
列出带宽规则
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
}
]
}列出带宽规则
返回您账户中的全部带宽自动补充规则,最早创建的在前。不包含已删除的规则。需要view 权限。
响应
array
您的带宽规则。
显示 规则对象
显示 规则对象
number
规则 ID——在编辑和删除路径中使用
string
规则持续供给的地址
string | null
您为规则起的名称
number
可用带宽低于此值时,规则会购买
number
每次补充购买的带宽
string
每次补充的租赁时长——
1h 或 1dstring | null
规则被暂停或停止的原因:
insufficient_balance、order_failed、activation_failed 或 invalid_params。没有原因时为 null。number
连续失败的补充次数。达到 5 时规则会被暂停;一次成功的补充会将其重置为 0。
string | null
我们最近一次检查该地址的时间(ISO 8601,UTC),无论读取是否成功。首次检查之前为
null。number | null
最近一次成功检查时该地址的可用带宽,包括免费带宽。首次成功读取之前为
null。string | null
最近一次检查未能读取该地址的时间(ISO 8601,UTC)。最近一次检查成功时为
null。该字段有值期间,last_available_bandwidth 来自更早的检查,可能已过时。无法读取地址的检查不会购买任何东西。string | null
最近一次补充的时间。从未补充过时为
null。number
自规则创建以来成功补充的次数
string
这些补充累计花费的 TRX
string
规则的创建时间(ISO 8601,UTC)
string | null
按当前价格计算的您账户补充一次的全部价格,已包含固定手续费。如需激活地址,激活费用另行收取。价格暂时不可用时为
null。示例
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
列出带宽规则
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
}
]
}