API Description
It will check whether the destination is an empty address and automatically send 65k or 131k energy to the receiver.
API Endpoints
GET https://web.apitrx.com/estimate
Parameters
| Parameter Name | Type | Description | Example |
|---|---|---|---|
| apikey | string | apikey obtained from the TG bot | 83928AFB-14A5-4878-A63D-128467830293 |
| receiver | string | TRON address receiving the energy | TX8BF429hr7qK1Te8UWLxD9xbumtX11111 |
| destination | string | Target address for the transfer (will check the energy required to transfer to this address) | TX8BF429hr7qK1Te8UWLxD9xbumtX22222 |
| traceId | string | (Optional) Link trace ID, maximum 36 characters | 7c2c1d6f-9b8a-4a6f-8c3d-2f5f9c1a4e7b |
Response
{
"code": 200,
"data": {
"amount": 2.0,
"balance": 99.5,
"receiver": "TX8BF429hr7qK1Te8UWLxD9xbumtX11111",
"destination": "TX8BF429hr7qK1Te8UWLxD9xbumtX22222",
"quantity": 131000,
"txid":"cedf46ed366fb89cddc1e892383c6f5abe2f16dbefa97b15c76989c111027880",
"traceId": "7c2c1d6f-9b8a-4a6f-8c3d-2f5f9c1a4e7b"
},
"message": "SUCCESS"
}
| Parameter Name | Type | Description | Example |
|---|---|---|---|
| code | int | 200 indicates success, others indicate failure | 200/Success 500/Failure 501/Account Disabled 502/Insufficient Balance |
| message | string | Prompt message | SUCCESS/ERROR |
| data.amount | float | This transaction amount (TRX) | 2.0 |
| data.balance | float | Remaining amount (TRX) | 99.5 |
| data.quantity | int | Quantity sent this time | 131000 |
| data.txid | string | Proxy hash value | TX8BF429hr7qK1Te8UWLxD9xbumtX11111 |
| data.receiver | string | Receiving address | TX8BF429hr7qK1Te8UWLxD9xbumtX22222 |
| data.destination | string | Destination address | cedf46ed366fb89cddc... |
| data.traceId | string | Trace ID passed during the request | 7c2c1d6f-9b8a-4a6f-8c3d... |
Code Example
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
public class HttpGetWithParameters {
public static void main(String[] args) {
try {
// Set the URL to access
String baseUrl = "https://web.apitrx.com/estimate";
// Set parameters
String apiKey = "83928AFB-14A5-4878-A63D-128467830293";
String receiver = "TX8BF429hr7qK1Te8UWLxD9xbumtX11111";
String destination = "TX8BF429hr7qK1Te8UWLxD9xbumtX22222";
String urlWithParams = baseUrl + "?" +
"apikey=" + URLEncoder.encode(apiKey, "UTF-8") +
"&receiver=" + URLEncoder.encode(receiver, "UTF-8") +
"&destination=" + URLEncoder.encode(destination, "UTF-8");
URL obj = new URL(urlWithParams);
HttpURLConnection connection = (HttpURLConnection) obj.openConnection();
connection.setRequestMethod("GET");
int responseCode = connection.getResponseCode();
System.out.println("Response Code: " + responseCode);
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println("Response Content: " + response.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
}
package main
import (
"fmt"
"net/http"
"net/url"
)
func sendGetRequest() {
baseURL := "https://web.apitrx.com/estimate"
params := url.Values{}
params.Add("apikey", "83928AFB-14A5-4878-A63D-128467830293")
params.Add("receiver", "TX8BF429hr7qK1Te8UWLxD9xbumtX11111")
params.Add("destination", "TX8BF429hr7qK1Te8UWLxD9xbumtX22222")
urlWithParams := baseURL + "?" + params.Encode()
response, err := http.Get(urlWithParams)
if err != nil {
fmt.Println("Error:", err)
return
}
defer response.Body.Close()
body, err := io.ReadAll(response.Body)
if err != nil {
fmt.Println("Error reading response:", err)
return
}
fmt.Println("Response Code:", response.Status)
fmt.Println("Response Content:", string(body))
}
func main() {
sendGetRequest()
}
import requests
def send_get_request():
url = "https://web.apitrx.com/estimate"
params = {
'apikey': '83928AFB-14A5-4878-A63D-128467830293',
'receiver': 'TX8BF429hr7qK1Te8UWLxD9xbumtX11111',
'destination': 'TX8BF429hr7qK1Te8UWLxD9xbumtX22222'
}
response = requests.get(url, params=params)
print("Response Code:", response.status_code)
print("Response Content:", response.text)
if __name__ == "__main__":
send_get_request()
<?php
$url = 'https://web.apitrx.com/estimate';
$apiKey = '83928AFB-14A5-4878-A63D-128467830293';
$receiver = 'TX8BF429hr7qK1Te8UWLxD9xbumtX11111';
$destination = 'TX8BF429hr7qK1Te8UWLxD9xbumtX22222';
$params = [
'apikey' => $apiKey,
'receiver' => $receiver,
'destination' => $destination
];
$urlWithParams = $url . '?' . http_build_query($params);
$response = file_get_contents($urlWithParams);
echo $response;
?>
curl --location 'https://web.apitrx.com/estimate?apikey=83928AFB-14A5-4878-A63D-128467830293&receiver=TX8BF429hr7qK1Te8UWLxD9xbumtX11111&destination=TX8BF429hr7qK1Te8UWLxD9xbumtX22222'
