HS Code Depth List
Retrieve the available HS code depth levels for the selected filters.
ENDPOINTS
POST /api/v1/tradeAnalytics/hsDepthList
Request parameters
countryCode
string
Country ISO3 code
- Required:
Yes - Example:
USA
startDate
string
Start period in YYYY-MM format
- Required:
No - Example:
2024-01
endDate
string
End period in YYYY-MM format
- Required:
No - Example:
2024-12
hsCode
string
HS code
- Required:
No - Example:
28
ie
string
Trade flow. Use i for import and e for export.
- Required:
No - Example:
i
partnerIso3
string
Partner country ISO3 code(s), separated by commas.
- Required:
No - Example:
ITA,MEX
Request Example
{
"countryCode": "USA",
"startDate": "2024-01",
"endDate": "2024-12",
"ie": "i",
"partnerIso3": "ITA,MEX"
}
curl https://api.tradedata.io/api/v1/tradeAnalytics/hsDepthList \
-H "Authorization: Bearer yourTokenHere" \
-H "Content-Type: application/json" \
-d '{"countryCode": "USA", "startDate": "2024-01", "endDate": "2024-12", "ie": "i", "partnerIso3": "ITA,MEX"}'
import requests
response = requests.post(
"https://api.tradedata.io/api/v1/tradeAnalytics/hsDepthList",
headers={
"Authorization": "Bearer yourTokenHere",
"Content-Type": "application/json",
},
json={
"countryCode": "USA",
"startDate": "2024-01",
"endDate": "2024-12",
"ie": "i",
"partnerIso3": "ITA,MEX",
},
)
print(response.json())
const response = await fetch("https://api.tradedata.io/api/v1/tradeAnalytics/hsDepthList", {
method: "POST",
headers: {
"Authorization": "Bearer yourTokenHere",
"Content-Type": "application/json",
},
body: JSON.stringify({
"countryCode": "USA",
"startDate": "2024-01",
"endDate": "2024-12",
"ie": "i",
"partnerIso3": "ITA,MEX"
}),
});
const data = await response.json();
<?php
$ch = curl_init("https://api.tradedata.io/api/v1/tradeAnalytics/hsDepthList");
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",
"startDate" => "2024-01",
"endDate" => "2024-12",
"ie" => "i",
"partnerIso3" => "ITA,MEX"
]),
]);
echo curl_exec($ch);
Response parameters
code
int
Status code
- Example:
200
data
array
Available HS code depth levels
- Example:
2
Response Example
{
"code": 200,
"success": true,
"data": [
2,
4,
6,
10
],
"msg": "success",
"total": 0,
"pageSize": 0,
"current": 0,
"sumResult": null
}