月度统计
获取买家账户最近 6 个月的月度交易统计数据。需要已加入白名单的 API 密钥。
Last updated
{
"error": false,
"message": "Success",
"data": {
"fromMonth": string, // oldest month in the result window, formatted as YYYY-MM
"toMonth": string, // current month, formatted as YYYY-MM
"monthCount": number, // Total number of months in the data array
"timezone": string, // Timezone applied to all month boundaries — always UTC
"data": [
{
"month": string, // Month identifier, formatted as YYYY-MM
"totalOrder": number, // Total number of orders placed in the month
"totalOrderEnergy": number, // Number of energy orders placed in the month
"totalOrderBW": number, // Number of bandwidth orders placed in the month
"totalTrxDepositToCreateBuyOrder": number, // Total TRX spent to create buy orders in the month
"totalTrxDepositInternal": number // Total TRX deposited into the internal account in the month
}
]
}
}{
"error": false,
"message": "Success",
"data": {
"fromMonth": "2025-12",
"toMonth": "2026-05",
"monthCount": 6,
"timezone": "UTC",
"data": [
{
"month": "2026-05",
"totalOrder": 16,
"totalOrderEnergy": 13,
"totalOrderBW": 3,
"totalTrxDepositToCreateBuyOrder": 1080.88,
"totalTrxDepositInternal": 2000
},
{
"month": "2026-04",
"totalOrder": 23,
"totalOrderEnergy": 23,
"totalOrderBW": 0,
"totalTrxDepositToCreateBuyOrder": 99.6,
"totalTrxDepositInternal": 164
}
]
}
}{
"error": true,
"message": "TSAS:106 API_KEY_REQUIRED",
"data": null
}{
"error": true,
"message": "TSAS:107 INVALID_API_KEY",
"data": null
}{
"error": true,
"message": "TSAS:108 FORBIDDEN Forbidden",
"data": null
}curl -X GET "https://api.tronsave.io/v2/internal/buyer/monthly-stats" \
-H "apikey: YOUR_API_KEY"const TRONSAVE_API_URL = "https://api.tronsave.io";
const getMonthlyStats = async (apiKey) => {
const url = `${TRONSAVE_API_URL}/v2/internal/buyer/monthly-stats`;
const res = await fetch(url, {
headers: {
apikey: apiKey,
},
});
return res.json();
};
getMonthlyStats("YOUR_API_KEY").then(console.log);import requests
TRONSAVE_API_URL = "https://api.tronsave.io"
API_KEY = "YOUR_API_KEY"
def get_monthly_stats() -> dict:
"""Get buyer monthly statistics (last 6 months)."""
url = f"{TRONSAVE_API_URL}/v2/internal/buyer/monthly-stats"
headers = {"apikey": API_KEY}
response = requests.get(url, headers=headers)
return response.json()
print(get_monthly_stats())import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class GetMonthlyStats {
static final String TRONSAVE_API_URL = "https://api.tronsave.io";
static final String API_KEY = "YOUR_API_KEY";
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(TRONSAVE_API_URL + "/v2/internal/buyer/monthly-stats"))
.header("apikey", API_KEY)
.GET()
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
)
const (
tronsaveAPIURL = "https://api.tronsave.io"
apiKey = "YOUR_API_KEY"
)
func main() {
req, err := http.NewRequest(http.MethodGet, tronsaveAPIURL+"/v2/internal/buyer/monthly-stats", nil)
if err != nil {
panic(err)
}
req.Header.Set("apikey", apiKey)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}use serde_json::Value;
const TRONSAVE_API_URL: &str = "https://api.tronsave.io";
const API_KEY: &str = "YOUR_API_KEY";
fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::blocking::Client::new();
let resp: Value = client
.get(format!("{TRONSAVE_API_URL}/v2/internal/buyer/monthly-stats"))
.header("apikey", API_KEY)
.send()?
.json()?;
println!("{resp:#?}");
Ok(())
}