Company Trade Trend API
Retrieve monthly aggregated trade statistics (amount, count, weight) for a company.
ENDPOINTS
POST /api/v1/company/companyTrend
Request parameters
com_role
integer
Company role in trade. 1 = buyer, 2 = supplier.
- Required:
Yes - Example:
2
com_id
string
Company ID.
- Required:
Yes - Example:
1ad397fa1acc309dae3dc54e4a963d4c
date
array<integer>
Date range. Two-element array of 8-digit integers [YYYYMMDD, YYYYMMDD].
- Required:
Yes - Example:
[20230101, 20251215]
page
integer
Page number. Default: 1, max: 1000.
- Required:
No - Example:
1
page_size
integer
Records per page. Default: 10, max: 50.
- Required:
No - Example:
10
Request Example
{
"com_role": "2",
"com_id": "1ad397fa1acc309dae3dc54e4a963d4c",
"date": [
20230101,
20251215
],
"page": 1,
"page_size": 10
}
curl https://api.tradedata.io/api/v1/company/companyTrend \
-H "Authorization: Bearer yourTokenHere" \
-H "Content-Type: application/json" \
-d '{"com_role": "2", "com_id": "1ad397fa1acc309dae3dc54e4a963d4c", "date": [20230101, 20251215], "page": 1, "page_size": 10}'
import requests
response = requests.post(
"https://api.tradedata.io/api/v1/company/companyTrend",
headers={
"Authorization": "Bearer yourTokenHere",
"Content-Type": "application/json",
},
json={
"com_role": "2",
"com_id": "1ad397fa1acc309dae3dc54e4a963d4c",
"date": [
20230101,
20251215,
],
"page": 1,
"page_size": 10,
},
)
print(response.json())
const response = await fetch("https://api.tradedata.io/api/v1/company/companyTrend", {
method: "POST",
headers: {
"Authorization": "Bearer yourTokenHere",
"Content-Type": "application/json",
},
body: JSON.stringify({
"com_role": "2",
"com_id": "1ad397fa1acc309dae3dc54e4a963d4c",
"date": [
20230101,
20251215
],
"page": 1,
"page_size": 10
}),
});
const data = await response.json();
<?php
$ch = curl_init("https://api.tradedata.io/api/v1/company/companyTrend");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer yourTokenHere",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"com_role" => "2",
"com_id" => "1ad397fa1acc309dae3dc54e4a963d4c",
"date" => [
20230101,
20251215
],
"page" => 1,
"page_size" => 10
]),
]);
echo curl_exec($ch);
Response parameters
data
array
Monthly trend data.
data.val
string
Month timestamp (ISO 8601).
- Example:
2023-01-01T00:00:00Z
data.amount
string
Total trade amount (USD).
- Example:
19831604.32421875
data.count
string
Number of transactions.
- Example:
47
data.weight
string
Total weight (kg).
- Example:
0.0
pageSize
integer
Number of months returned per page.
- Example:
10
Response Example
{
"code": 200,
"success": true,
"data": [
{
"val": "2023-01-01T00:00:00Z",
"amount": "19831604.32421875",
"count": "47",
"weight": "0.0"
}
],
"msg": "OK",
"total": 0,
"pageSize": 10,
"current": 1,
"sumResult": {}
}
Company Trade Detail API
Retrieve paginated trade transaction records for a company in a given role and date range, sortable by `date` or `weight`.
Company HS Code Analysis API
Retrieve trade statistics grouped by HS code for a company, aggregated at 6 or 8 digits and sortable by `count`, `weight` or `amount`.