Top 10 Trade Partners
Retrieve the top 10 trade partners by value for a selected country, HS code, trade flow, and period.
ENDPOINTS
POST /api/v1/tradeAnalytics/top10Partner
Request parameters
countryCode
string
Country ISO3 code
- Required:
Yes - Example:
USA
ie
string
Trade flow. Use i for import and e for export.
- Required:
No - Example:
i
hsCode
string
HS code
- Required:
No - Example:
28
startDate
string
Start period in YYYY-MM format
- Required:
Yes - Example:
2024-01
endDate
string
End period in YYYY-MM format
- Required:
Yes - Example:
2024-12
Request Example
{
"countryCode": "USA",
"ie": "i",
"hsCode": "28",
"startDate": "2024-01",
"endDate": "2024-12"
}
curl https://api.tradedata.io/api/v1/tradeAnalytics/top10Partner \
-H "Authorization: Bearer yourTokenHere" \
-H "Content-Type: application/json" \
-d '{"countryCode": "USA", "ie": "i", "hsCode": "28", "startDate": "2024-01", "endDate": "2024-12"}'
import requests
response = requests.post(
"https://api.tradedata.io/api/v1/tradeAnalytics/top10Partner",
headers={
"Authorization": "Bearer yourTokenHere",
"Content-Type": "application/json",
},
json={
"countryCode": "USA",
"ie": "i",
"hsCode": "28",
"startDate": "2024-01",
"endDate": "2024-12",
},
)
print(response.json())
const response = await fetch("https://api.tradedata.io/api/v1/tradeAnalytics/top10Partner", {
method: "POST",
headers: {
"Authorization": "Bearer yourTokenHere",
"Content-Type": "application/json",
},
body: JSON.stringify({
"countryCode": "USA",
"ie": "i",
"hsCode": "28",
"startDate": "2024-01",
"endDate": "2024-12"
}),
});
const data = await response.json();
<?php
$ch = curl_init("https://api.tradedata.io/api/v1/tradeAnalytics/top10Partner");
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",
"hsCode" => "28",
"startDate" => "2024-01",
"endDate" => "2024-12"
]),
]);
echo curl_exec($ch);
Response parameters
code
int
Status code
- Example:
200
data
array
Result container
data.countryName
string
Partner country name
- Example:
China
data.iso3
string
Partner country ISO3 code
- Example:
CHN
data.value
number
Trade value
- Example:
2203563727
data.percent
number
Share
- Example:
10.25
Response Example
{
"code": 200,
"success": true,
"data": [
{
"countryName": "China",
"iso3": "CHN",
"value": 2203563727,
"percent": 10.25
}
],
"msg": "success",
"total": 0,
"pageSize": 0,
"current": 0,
"sumResult": null
}