Monthly Aggregation
View time-series trade statistics by month. Analyze trends in value, weight, quantity, and trade partners over time. Suitable for forecasting, seasonal analysis, and market monitoring.
ENDPOINTS
POST /api/v1/reportTrend
Request parameters
sort
string
Field to sort by transactionCount, weight, or amount.
- Example:
"count","weight","amount"
order
string
Asc for ascending, desc for descending.
- Example:
"desc"
Request Example
{
"data_coverage": 1,
"date_range": [20231012, 20251212],
"product_keyword": ["led"],
"order": "desc",
"sort": "count"
}
curl https://api.tradedata.io/api/v1/reportTrend \
-H "Authorization: Bearer yourTokenHere" \
-H "Content-Type: application/json" \
-d '{"data_coverage": 1, "date_range": [20231012, 20251212], "product_keyword": ["led"], "order": "desc", "sort": "count"}'
import requests
response = requests.post(
"https://api.tradedata.io/api/v1/reportTrend",
headers={
"Authorization": "Bearer yourTokenHere",
"Content-Type": "application/json",
},
json={
"data_coverage": 1,
"date_range": [
20231012,
20251212,
],
"product_keyword": [
"led",
],
"order": "desc",
"sort": "count",
},
)
print(response.json())
const response = await fetch("https://api.tradedata.io/api/v1/reportTrend", {
method: "POST",
headers: {
"Authorization": "Bearer yourTokenHere",
"Content-Type": "application/json",
},
body: JSON.stringify({
"data_coverage": 1,
"date_range": [
20231012,
20251212
],
"product_keyword": [
"led"
],
"order": "desc",
"sort": "count"
}),
});
const data = await response.json();
<?php
$ch = curl_init("https://api.tradedata.io/api/v1/reportTrend");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer yourTokenHere",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"data_coverage" => 1,
"date_range" => [
20231012,
20251212
],
"product_keyword" => [
"led"
],
"order" => "desc",
"sort" => "count"
]),
]);
echo curl_exec($ch);
Response parameters
statusCode
int
Status code
- Example:
200
data
array
Result container
entityObject
Json
Each field in the entityObject contains:
month
string
Month
- Example:
"2023-01-01"
totalBuyers
int
Number of buyers
- Example:
121
totalSuppliers
int
Number of suppliers
- Example:
235
totalQuantity
float
Total quantity of goods (aggregated)
- Example:
312.83
totalWeight
float
Total shipment weight (aggregated, kg)
- Example:
453.62
totalAmount
float
Total trade amount (aggregated,USD)
- Example:
369.53
transactionCount
int
Total number of trade records or shipments
- Example:
666
Response Example
{
"code": 200,
"success": true,
"data": [
{
"date": "2022-12-01T00:00:00Z",
"totalBuyers": 235,
"totalSuppliers": 207,
"totalQuantity": 0,
"totalWeight": 364138659.56,
"totalAmount": 66370209.43,
"transactionCount": 3780
}
],
"msg": "success",
"total": 0,
"pageSize": 10,
"current": 1,
"sumResult": {}
}