Trongy API Documents

Version 1.0.0


Introduction


Through our web service, you can perform all the operations that you carry out on the main page of the site or in the user panel via the web service. You can connect to our web service to execute your Tether transfers without any fees.

Getting Started

Our API Endpoint URL :

https://trongy.com/api

Register an account and apply for API

  • Register Trongy Account
  • Get API key from Api Sections
  • 1 - Wallet Information

    Get Your Account/Wallet Information

    Here, you can retrieve your account information, including balance, deposit address, and other relevant details using this endpoint.

    GET /wallet/info/

    Request Header:

    {
        "Authorization": "Token APIKEY",
        "Content-Type": "application/json"
    }
    

    Response:

    {
        "username": "email",
        "type": "TRX",
        "balance": 20,
        "deposit_address": "TBdRd6WEL***************jrTp"
    }
    


    Wallet Info Example Code :

    import requests
    
    url = "https://trongy.com/api/wallet/info/"
    headers = {
        "Authorization": "Token apikey",
        "Content-Type": "application/json"
    }
    
    response = requests.get(url, headers=headers)
    print(response.json())
        
    curl -X GET "https://trongy.com/api/wallet/info/" -H "Authorization: Token apikey" -H "Content-Type: application/json"
        
    <%
        Dim xmlhttp
        Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
        Dim url, token
        url = "https://trongy.com/api/wallet/info/"
        token = "apikey"
    
        xmlhttp.Open "GET", url, False
        xmlhttp.setRequestHeader "Authorization", "Token " & token
        xmlhttp.setRequestHeader "Content-Type", "application/json"
        xmlhttp.Send
    
        Response.Write xmlhttp.responseText
    %>
        
    
        


    2 - Wallet Charge List

    Get Wallet Charge List

    Here, you can retrieve your wallet charge list information, including ref_id, paid_status, and other relevant details using this endpoint.

    GET /wallet/order-list/

    Request Header:

    {
        "Authorization": "Token APIKEY",
        "Content-Type": "application/json"
    }
    

    Response:

    [
    
        {
            "ref_id": "zOdfhrmhF",
            "paid_status": true,
            "currency": "TRX",
            "amount": 1.0,
            "tx_id": "3e93e052a6c4c4e17bd095******************34ccbcb55361ee804361a3",
            "created_time": "2024-09-27T13:31:00.937896Z",
            "paid_time": "2024-09-27T13:31:00.937100Z"
        },
        {
            "ref_id": "68dfiE6",
            "paid_status": true,
            "currency": "TRX",
            "amount": 1.0,
            "tx_id": "dc1bb5fbbc2d17919b4e9465e*****************9d4766adab0abdda474b23deac",
            "created_time": "2024-09-28T07:25:00.547162Z",
            "paid_time": "2024-09-28T07:25:00.546455Z"
        },
    ]
    


    Wallet Charge Logs Example Code:

    import requests
    
    url = "https://trongy.com/api/wallet/order-list/"
    headers = {
        "Authorization": "Token apikey",
        "Content-Type": "application/json"
    }
    
    response = requests.get(url, headers=headers)
    print(response.json())
        
    curl -X GET "https://trongy.com/api/wallet/order-list/" -H "Authorization: Token apikey" -H "Content-Type: application/json"
        
    <%
        Dim xmlhttp
        Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
        Dim url, token
        url = "https://trongy.com/api/wallet/order-list/"
        token = "apikey"
    
        xmlhttp.Open "GET", url, False
        xmlhttp.setRequestHeader "Authorization", "Token " & token
        xmlhttp.setRequestHeader "Content-Type", "application/json"
        xmlhttp.Send
    
        Response.Write xmlhttp.responseText
    %>
        
    
        




    3 - Get Wallet Charge ID Inoformation

    Get Wallet Charge ID Inoformation

    Through this endpoint, you can receive the desired information by sending the charging Wallet ID

    GET /wallet/order-list/?ref_id=<order_id>

    Request Header:

    {
        "Authorization": "Token APIKEY",
        "Content-Type": "application/json"
    }
    

    Response:

    [
        {
            "ref_id": "zOzsdmhF",
            "paid_status": true,
            "currency": "TRX",
            "amount": 1.0,
            "tx_id": "3e93e052a6c4c4e17bd*************487b5a1134ccbcb55361ee804361a3",
            "created_time": "2024-09-27T13:31:00.937896Z",
            "paid_time": "2024-09-27T13:31:00.937100Z"
        }
    ]
    


    Order Detail Example Code:

    import requests
    
    url = "https://trongy.com/api/wallet/order-list/?ref_id=zOzdfrmhF"
    headers = {
        "Authorization": "Token apikey",
        "Content-Type": "application/json"
    }
    
    response = requests.get(url, headers=headers)
    print(response.json())
        
    curl -X GET "https://trongy.com/api/wallet/order-list/?ref_id=zOzdfrmhF" -H "Authorization: Token apikey" -H "Content-Type: application/json"
        
    <%
        Dim xmlhttp
        Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
        Dim url, token, ref_id
        url = "https://trongy.com/api/wallet/order-list/?ref_id=zOzdfrmhF"
        token = "apikey"
    
        xmlhttp.Open "GET", url, False
        xmlhttp.setRequestHeader "Authorization", "Token " & token
        xmlhttp.setRequestHeader "Content-Type", "application/json"
        xmlhttp.Send
    
        Response.Write xmlhttp.responseText
    %>
        
    
        


    4- Get Order List

    Get Order List

    Through this endpoint, you can receive all your user panel orders with complete information and details.

    GET /orders/order-list/

    Request Header:

    {
        "Authorization": "Token APIKEY",
        "Content-Type": "application/json"
    }
    

    Response:

    [
        {
            "ref_id": "Vzdfe6K8",
            "resource_type": "energy",
            "paid_status": true,
            "to_address": "TCzGuyzFhVeH*****s7Bih1iA8ANnBss",
            "energy_amount": 20000.0,
            "duration": 300,
            "payout_trx": 1.80625,
            "paid_with": "wallet",
            "created_time": "2024-09-28T07:35:19.815941Z",
            "paid_time": "2024-09-28T07:35:19.835207Z",
            "balance_before": "2.0",
            "balance_after": "0.1937500000000001"
        },
        {
            "ref_id": "34vcxh2F",
            "resource_type": "energy",
            "paid_status": true,
            "to_address": "TCzGuyzFhVeH*****s7Bih1iA8ANnBss",
            "energy_amount": 20000.0,
            "duration": 300,
            "payout_trx": 2.80625,
            "paid_with": "wallet",
            "created_time": "2024-09-28T07:47:15.527070Z",
            "paid_time": "2024-09-28T07:47:15.541050Z",
            "balance_before": "5.172922",
            "balance_after": "2.366672"
        },
    ]
    


    Order List Example Code:

    import requests
    
    url = "https://trongy.com/api/orders/order-list/"
    headers = {
        "Authorization": "Token apikey",
        "Content-Type": "application/json"
    }
    
    response = requests.get(url, headers=headers)
    print(response.json())
        
    curl -X GET "https://trongy.com/api/orders/order-list/" -H "Authorization: Token apikey" -H "Content-Type: application/json"
        
    <%
        Dim xmlhttp
        Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
        Dim url, token
        url = "https://trongy.com/api/orders/order-list/"
        token = "apikey"
    
        xmlhttp.Open "GET", url, False
        xmlhttp.setRequestHeader "Authorization", "Token " & token
        xmlhttp.setRequestHeader "Content-Type", "application/json"
        xmlhttp.Send
    
        Response.Write xmlhttp.responseText
    %>
        
    
        


    5- Get Order ID Deatil

    Get Order ID Deatil

    Through this endpoint, you can get information and the status of your order by sending the order ID.

    GET /orders/order-list/?ref_id=<order_id>

    Request Header:

    {
        "Authorization": "Token APIKEY",
        "Content-Type": "application/json"
    }
    

    Response:

    [
        {
            "ref_id": "VzZVsdK8",
            "resource_type": "energy",
            "paid_status": true,
            "to_address": "TCzGuyzFhV******wts7Bih1iA8ANnBss",
            "energy_amount": 20000.0,
            "duration": 300,
            "payout_trx": 1.80625,
            "paid_with": "wallet",
            "created_time": "2024-09-28T07:35:19.815941Z",
            "paid_time": "2024-09-28T07:35:19.835207Z",
            "balance_before": "2.0",
            "balance_after": "0.1937500000000001"
        }
    ]
    


    Order Detail Example Code:

    import requests
    
    url = "https://trongy.com/api/orders/order-list/?ref_id=zOzdfrmhF"  # Replace with the actual order ID
    headers = {
        "Authorization": "Token apikey",
        "Content-Type": "application/json"
    }
    
    response = requests.get(url, headers=headers)
    print(response.json())
        
    curl -X GET "https://trongy.com/api/orders/order-list/?ref_id=zOzdfrmhF" -H "Authorization: Token apikey" -H "Content-Type: application/json"
        
    <%
        Dim xmlhttp
        Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
        Dim url, token, ref_id
        url = "https://trongy.com/api/orders/order-list/?ref_id=zOzdfrmhF"  ' Replace with the actual order ID
        token = "apikey"
    
        xmlhttp.Open "GET", url, False
        xmlhttp.setRequestHeader "Authorization", "Token " & token
        xmlhttp.setRequestHeader "Content-Type", "application/json"
        xmlhttp.Send
    
        Response.Write xmlhttp.responseText
    %>
        
    
        


    6- Get Duration

    Get Duration List

    Through this endpoint, you can find the terms and conditions for purchasing and the available active durations on our platform, and then submit your energy purchase request based on these terms and conditions.

    GET /get-duration-list/

    Request Header:

    {
        "Authorization": "Token APIKEY",
        "Content-Type": "application/json"
    }
    

    Response:

    {
        "5m": "5 minutes",
        "15m": "15 minutes",
        "1h": "1 hour",
        "1d": "1 day",
        "2d": "2 day",
        "3d": "3 day",
        "4d": "4 day",
        "5d": "5 day",
        "6d": "6 day",
        "7d": "7 day",
        "8d": "8 day",
    }
    


    Duration List Example Code:

    import requests
    
    url = "https://trongy.com/api/get-duration-list/"
    headers = {
        "Authorization": "Token apikey",  # Replace with your actual API key
        "Content-Type": "application/json"
    }
    
    response = requests.get(url, headers=headers)
    print(response.json())
        
    curl -X GET "https://trongy.com/api/get-duration-list/" -H "Authorization: Token apikey" -H "Content-Type: application/json"
        
    <%
        Dim xmlhttp
        Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
        Dim url, token
        url = "https://trongy.com/api/get-duration-list/"
        token = "apikey"  ' Replace with your actual API key
    
        xmlhttp.Open "GET", url, False
        xmlhttp.setRequestHeader "Authorization", "Token " & token
        xmlhttp.setRequestHeader "Content-Type", "application/json"
        xmlhttp.Send
    
        Response.Write xmlhttp.responseText
    %>
        
    
        


    7- Get Estimated Amount

    Get Estimated Amount

    Through this endpoint, you can find out the cost of purchasing energy by sending the amount and duration.

    Post /get-estimated/

    Request Header:

    {
        "Authorization": "Token APIKEY",
        "Content-Type": "application/json"
    }
    

    Request Body:

    {
        "amount": "32000",
        "duration": "1h"
    }
    

    Response:

    {
        "amount": 32000,
        "duration_seconds": 3600,
        "total_payout": 3.17
    }
    


    Estimated Value Example Code:

    import requests
    import json
    
    url = "https://trongy.com/api/get-estimated/"
    headers = {
        "Authorization": "Token apikey",  # Replace with your actual API key
        "Content-Type": "application/json"
    }
    body = {
        "amount": "32000",
        "duration": "1h"
    }
    
    response = requests.post(url, headers=headers, data=json.dumps(body))
    print(response.json())
        
    curl -X POST "https://trongy.com/api/get-estimated/" -H "Authorization: Token apikey" -H "Content-Type: application/json" -d '{"amount": "32000", "duration": "1h"}'
        
    <%
        Dim xmlhttp
        Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
        Dim url, token, jsonBody
        url = "https://trongy.com/api/get-estimated/"
        token = "apikey"  ' Replace with your actual API key
    
        jsonBody = "{""amount"": ""32000"", ""duration"": ""1h""}"
    
        xmlhttp.Open "POST", url, False
        xmlhttp.setRequestHeader "Authorization", "Token " & token
        xmlhttp.setRequestHeader "Content-Type", "application/json"
        xmlhttp.Send jsonBody
    
        Response.Write xmlhttp.responseText
    %>
        
     "32000",
        "duration" => "1h"
    ]);
    
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
    
    $response = curl_exec($ch);
    curl_close($ch);
    
    echo $response;
    ?>
        


    8- Buy Tron Energy

    Buy Tron Energy

    Through this endpoint, you can purchase the required energy for your wallet addresses.

    Post /buy-energy/

    Request Header:

    {
        "Authorization": "Token APIKEY",
        "Content-Type": "application/json"
    }
    

    Request Body:

    {
        "wallet": "TCzGuyzFhVeHXG3Sfwts7Bih1iA8ANnBZs",
        "amount": "23000",
        "duration": "1h"
    }
    

    Response:

    {
        "status": "success",
        "ref_id": "ldbussabhb",
        "energy_amount": 12000.0,
        "to_address": "TYSrtJteKNJRJ4C5S3kauNG3secexhKl2y",
        "payout_trx": 1.11,
        "paid_time": "2024-10-16T09:07:54.406476Z",
        "wallet_balance": 3.669999999999999
    }
    


    Buy Energy Example Code:

    import requests
    import json
    
    url = "https://trongy.com/api/buy-energy/"
    headers = {
        "Authorization": "Token apikey",  # Replace with your actual API key
        "Content-Type": "application/json"
    }
    body = {
        "wallet": "target wallet",  # Replace with the target wallet address
        "amount": "23000",
        "duration": "1h"
    }
    
    response = requests.post(url, headers=headers, data=json.dumps(body))
    print(response.json())
        
    curl -X POST "https://trongy.com/api/buy-energy/" -H "Authorization: Token apikey" -H "Content-Type: application/json" -d '{"wallet": "target wallet", "amount": "23000", "duration": "1h"}'
        
    <%
        Dim xmlhttp
        Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
        Dim url, token, jsonBody
        url = "https://trongy.com/api/buy-energy/"
        token = "apikey"  ' Replace with your actual API key
    
        jsonBody = "{""wallet"": ""target wallet"", ""amount"": ""23000"", ""duration"": ""1h""}"  ' Replace with the target wallet address
    
        xmlhttp.Open "POST", url, False
        xmlhttp.setRequestHeader "Authorization", "Token " & token
        xmlhttp.setRequestHeader "Content-Type", "application/json"
        xmlhttp.Send jsonBody
    
        Response.Write xmlhttp.responseText
    %>
        
     "target wallet",  // Replace with the target wallet address
        "amount" => "23000",
        "duration" => "1h"
    ]);
    
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
    
    $response = curl_exec($ch);
    curl_close($ch);
    
    echo $response;
    ?>