Latest Country Import/Export Statistics
Retrieve the latest annual import and export statistics for a selected country and optional HS code.
ENDPOINTS
POST /api/v1/tradeAnalytics/latestCountryStat
Request parameters
countryCode
string
Country ISO3 code
- Required:
Yes - Example:
CHN
hsCode
string
HS code
- Required:
No - Example:
02
Request Example
{
"countryCode": "USA",
"hsCode": "28"
}
curl https://api.tradedata.io/api/v1/tradeAnalytics/latestCountryStat \
-H "Authorization: Bearer yourTokenHere" \
-H "Content-Type: application/json" \
-d '{"countryCode": "USA", "hsCode": "28"}'
import requests
response = requests.post(
"https://api.tradedata.io/api/v1/tradeAnalytics/latestCountryStat",
headers={
"Authorization": "Bearer yourTokenHere",
"Content-Type": "application/json",
},
json={
"countryCode": "USA",
"hsCode": "28",
},
)
print(response.json())
const response = await fetch("https://api.tradedata.io/api/v1/tradeAnalytics/latestCountryStat", {
method: "POST",
headers: {
"Authorization": "Bearer yourTokenHere",
"Content-Type": "application/json",
},
body: JSON.stringify({
"countryCode": "USA",
"hsCode": "28"
}),
});
const data = await response.json();
<?php
$ch = curl_init("https://api.tradedata.io/api/v1/tradeAnalytics/latestCountryStat");
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",
"hsCode" => "28"
]),
]);
echo curl_exec($ch);
Response parameters
code
int
Status code
- Example:
200
data
object
Result container
data.countryName
string
Country name
- Example:
China
data.year
int
Year
- Example:
2022
data.yearlyBalance
number
Annual trade balance
- Example:
2203563727
data.import
object
Import statistics
data.import.value
number
Import value
- Example:
2715997517261
data.import.yoy
number
Year-over-year change of import value
- Example:
7.08
data.export
object
Export statistics
data.export.value
number
Export value
- Example:
3593601435602
data.export.yoy
number
Year-over-year change of export value
- Example:
83.55
Response Example
{
"code": 200,
"success": true,
"data": {
"countryName": "China",
"year": 2022,
"yearlyBalance": 2203563727,
"import": {
"value": 2715997517261,
"yoy": 7.08
},
"export": {
"value": 3593601435602,
"yoy": 83.55
}
},
"msg": "OK",
"total": 0,
"pageSize": 0,
"current": 0,
"sumResult": null
}