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`.
ENDPOINTS
POST /api/v1/company/companyHscode

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

hs_code_type

string

HS code aggregation dimension. hs_code_6 = 6-digit, hs_code_8 = 8-digit. Default: raw HS code from data.

  • Required: No
  • Example: hs_code_6

date

array<integer>

Date range. Two-element array of 8-digit integers [YYYYMMDD, YYYYMMDD].

  • Required: Yes
  • Example: [20230101, 20251215]

sort

string

Sort field. Supports count, weight, amount.

  • Required: No
  • Example: amount

order

string

Sort order. asc = ascending, desc = descending. Default: desc.

  • Required: No
  • Example: desc

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",
    "hs_code_type": "hs_code_6",
    "date": [
        20230101,
        20251215
    ],
    "page": 1,
    "page_size": 10,
    "sort": "amount",
    "order": "desc"
}
curl https://api.tradedata.io/api/v1/company/companyHscode \
  -H "Authorization: Bearer yourTokenHere" \
  -H "Content-Type: application/json" \
  -d '{"com_role": 2, "com_id": "1ad397fa1acc309dae3dc54e4a963d4c", "hs_code_type": "hs_code_6", "date": [20230101, 20251215], "page": 1, "page_size": 10, "sort": "amount", "order": "desc"}'

Response parameters

data

array

HS code aggregation list.

data.val

string

HS code.

  • Example: 852990

data.hs_code_desc

string

HS code description.

  • Example: Reception and transmission apparatus; for use with the apparatus of heading no. 8524 to 8528

data.section

integer

HS section number.

  • Example: 16

data.amount

number

Total trade amount (USD).

  • Example: 1173029989.4210525

data.count

integer

Number of transactions.

  • Example: 3144

data.weight

number

Total weight (kg).

  • Example: 14161489.556259155

sumResult.sum_amount

number

Total amount across all pages.

  • Example: 1346424007.2935472

sumResult.count

integer

Total transaction count across all pages.

  • Example: 4056

sumResult.sum_weight

number

Total weight across all pages.

  • Example: 14178229.556259155
Response Example
{
    "code": 200,
    "success": true,
    "data": [
        {
            "val": "852990",
            "hs_code_desc": "Reception and transmission apparatus; for use with the apparatus of heading no. 8524 to 8528, excluding aerials and aerial reflectors",
            "section": 16,
            "amount": 1173029989.4210525,
            "count": 3144,
            "weight": 14161489.556259155
        }
    ],
    "msg": "OK",
    "total": 10,
    "pageSize": 10,
    "current": 1,
    "sumResult": {
        "sum_amount": 1346424007.2935472,
        "count": 4056,
        "sum_weight": 14178229.556259155,
        "sum_quantity": null
    }
}