Overview Statistics
POST /api/v1/tradeAnalytics/overviewStat
Request parameters
countryCode
string
Country ISO3 code
- Required:
Yes - Example:
CHN
ie
string
Trade flow. Use i for import and e for export.
- Required:
Yes - Example:
i
partnerIso3
string
Partner country ISO3 code(s), separated by commas.
- Required:
No - Example:
ITA,MEX
hsCode
string
HS code
- Required:
No - Example:
02
startDate
string
Start period in YYYY-MM format
- Required:
Yes - Example:
2021-01
endDate
string
End period in YYYY-MM format
- Required:
Yes - Example:
2023-01
{
"countryCode": "USA",
"ie": "i",
"partnerIso3": "ITA,MEX",
"hsCode": "02",
"startDate": "2024-01",
"endDate": "2024-12"
}
curl https://api.tradedata.io/api/v1/tradeAnalytics/overviewStat \
-H "Authorization: Bearer yourTokenHere" \
-H "Content-Type: application/json" \
-d '{"countryCode": "USA", "ie": "i", "partnerIso3": "ITA,MEX", "hsCode": "02", "startDate": "2024-01", "endDate": "2024-12"}'
import requests
response = requests.post(
"https://api.tradedata.io/api/v1/tradeAnalytics/overviewStat",
headers={
"Authorization": "Bearer yourTokenHere",
"Content-Type": "application/json",
},
json={
"countryCode": "USA",
"ie": "i",
"partnerIso3": "ITA,MEX",
"hsCode": "02",
"startDate": "2024-01",
"endDate": "2024-12",
},
)
print(response.json())
const response = await fetch("https://api.tradedata.io/api/v1/tradeAnalytics/overviewStat", {
method: "POST",
headers: {
"Authorization": "Bearer yourTokenHere",
"Content-Type": "application/json",
},
body: JSON.stringify({
"countryCode": "USA",
"ie": "i",
"partnerIso3": "ITA,MEX",
"hsCode": "02",
"startDate": "2024-01",
"endDate": "2024-12"
}),
});
const data = await response.json();
<?php
$ch = curl_init("https://api.tradedata.io/api/v1/tradeAnalytics/overviewStat");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer yourTokenHere",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"countryCode" => "USA",
"ie" => "i",
"partnerIso3" => "ITA,MEX",
"hsCode" => "02",
"startDate" => "2024-01",
"endDate" => "2024-12"
]),
]);
echo curl_exec($ch);
Response parameters
code
int
Status code
- Example:
200
data
object
Result container
data.totalValue
number
Total trade value
- Example:
5408047716412
data.totalTrend
array
Total trend series
- Example:
-
data.totalTrend.totalValue
number
Total trade value
- Example:
421377868942
data.totalTrend.period
string
Period
- Example:
202401
data.totalTrend.totalQty
number
Total quantity
- Example:
231020292293
data.topPartnerIso3
string
Top partner ISO3 code
- Example:
MEX
data.totalQty
number
Total quantity
- Example:
2452204850585
data.totalBalanceValue
number
Total trade balance value
- Example:
-1282299624310
data.topPartnerValue
number
Top partner trade value
- Example:
843576521692
data.totalBalanceValueYoy
number
Year-over-year change of total trade balance value
- Example:
11.51
data.totalBalanceTrend
array
Total trade balance trend series
- Example:
-
data.totalBalanceTrend.totalValue
number
Trade balance value
- Example:
-100381354816
data.totalBalanceTrend.period
string
Period
- Example:
202401
data.topPartnerValueYoy
number
Year-over-year change of top partner trade value
- Example:
5.02
data.totalValueYoy
number
Year-over-year change of total trade value
- Example:
4.26
data.totalQtyYoy
number
Year-over-year change of total quantity
- Example:
2.35
data.topPartnerName
string
Top partner name
- Example:
Mexico
data.topPartner
string
Top partner code
- Example:
MEX
data.partnerTrend
array
Top partner trend series
- Example:
-
data.partnerTrend.totalValue
number
Trade value
- Example:
64883473278
data.partnerTrend.period
string
Period
- Example:
202401
data.partnerTrend.totalQty
number
Quantity
- Example:
27688198356
{
"code": 200,
"success": true,
"data": {
"totalValue": 5408047716412,
"totalTrend": [
{
"totalValue": 421377868942,
"period": "202401",
"totalQty": 231020292293
}
],
"topPartnerIso3": "MEX",
"totalQty": 2452204850585,
"totalBalanceValue": -1282299624310,
"topPartnerValue": 843576521692,
"totalBalanceValueYoy": 11.51,
"totalBalanceTrend": [
{
"totalValue": -100381354816,
"period": "202401"
}
],
"topPartnerValueYoy": 5.02,
"totalValueYoy": 4.26,
"totalQtyYoy": 2.35,
"topPartnerName": "Mexico",
"topPartner": "MEX",
"partnerTrend": [
{
"totalValue": 64883473278,
"period": "202401",
"totalQty": 27688198356
}
]
},
"msg": "success",
"total": 0,
"pageSize": 0,
"current": 0,
"sumResult": null
}