Skip to main content
POST
/
api
/
comtrade
/
trades
/
search
/comtrade/trades/search
curl --request POST \
  --url https://api.anysite.io/api/comtrade/trades/search \
  --header 'Content-Type: application/json' \
  --header 'access-token: <api-key>' \
  --data '
{
  "count": 250,
  "timeout": 300,
  "type_code": "C",
  "freq_code": "A",
  "classification": "HS",
  "reporter_code": "842",
  "partner_code": "156",
  "partner2_code": "<string>",
  "cmd_code": "TOTAL",
  "customs_code": "C00",
  "mot_code": "3200",
  "period": "2022"
}
'
[
  {
    "type_code": "<string>",
    "freq_code": "<string>",
    "period": "<string>",
    "@type": "@comtrade_trade",
    "ref_year": 123,
    "ref_month": 123,
    "reporter_code": 123,
    "reporter_iso": "<string>",
    "reporter_desc": "<string>",
    "flow_code": "<string>",
    "flow_desc": "<string>",
    "partner_code": 123,
    "partner_iso": "<string>",
    "partner_desc": "<string>",
    "partner2_code": 123,
    "partner2_iso": "<string>",
    "partner2_desc": "<string>",
    "classification_code": "<string>",
    "classification_search_code": "<string>",
    "is_original_classification": true,
    "cmd_code": "<string>",
    "cmd_desc": "<string>",
    "aggr_level": 123,
    "is_leaf": true,
    "customs_code": "<string>",
    "customs_desc": "<string>",
    "mos_code": "<string>",
    "mot_code": 123,
    "mot_desc": "<string>",
    "qty_unit_code": 123,
    "qty_unit_abbr": "<string>",
    "qty": 123,
    "is_qty_estimated": true,
    "alt_qty_unit_code": 123,
    "alt_qty_unit_abbr": "<string>",
    "alt_qty": 123,
    "is_alt_qty_estimated": true,
    "net_wgt": 123,
    "is_net_wgt_estimated": true,
    "gross_wgt": 123,
    "is_gross_wgt_estimated": true,
    "cif_value": 123,
    "fob_value": 123,
    "primary_value": 123,
    "legacy_estimation_flag": 123,
    "is_reported": true,
    "is_aggregate": true
  }
]

Authorizations

access-token
string
header
required

API token from the dashboard

Headers

access-token
string
required

Body

application/json
count
integer
required

Number of trade records to return

Required range: 1 <= x <= 500
timeout
integer
default:300

Max scrapping execution timeout (in seconds)

Required range: 20 <= x <= 1500
type_code
enum<string>
default:C

Trade type — goods (C) or services (S)

Available options:
C,
S
freq_code
enum<string>
default:A

Frequency — annual (A) or monthly (M)

Available options:
A,
M
classification
enum<string>
default:HS

Commodity/service classification scheme

Available options:
HS,
H0,
H1,
H2,
H3,
H4,
H5,
H6,
SITC,
S1,
S2,
S3,
S4,
ST,
BEC,
B4,
B5,
EB,
EB02,
EB10,
EB10S
reporter_code
string | null

Reporter area code(s), comma-separated (M49/UN numeric). Look up via the reporters endpoint

Example:

"842"

partner_code
string | null

Partner area code(s), comma-separated. 0 = World. Use the partners endpoint to look up codes

Example:

"156"

partner2_code
string | null

Second partner area code(s) for re-export/re-import breakdown, comma-separated

cmd_code
string | null

Commodity code(s), comma-separated. TOTAL = all commodities; AG2/AG4/AG6 = aggregation levels

Example:

"TOTAL"

flow_code
enum<string> | null

Trade flow direction — import (M), export (X), re-export (RX), etc.

Available options:
M,
X,
DX,
FM,
MIP,
MOP,
RM,
RX,
XIP,
XOP
customs_code
string | null

Customs procedure code(s), comma-separated. C00 = TOTAL customs procedures

Example:

"C00"

mot_code
string | null

Mode of transport code(s), comma-separated. 0 = TOTAL modes of transport

Example:

"3200"

period
string | null

Period(s), comma-separated. Year (YYYY) for annual, year-month (YYYYMM) for monthly

Example:

"2022"

Response

Successful Response

type_code
string
required
freq_code
string
required
period
string
required
@type
string
default:@comtrade_trade
ref_year
integer | null
ref_month
integer | null
reporter_code
integer | null
reporter_iso
string | null
reporter_desc
string | null
flow_code
string | null
flow_desc
string | null
partner_code
integer | null
partner_iso
string | null
partner_desc
string | null
partner2_code
integer | null
partner2_iso
string | null
partner2_desc
string | null
classification_code
string | null
classification_search_code
string | null
is_original_classification
boolean | null
cmd_code
string | null
cmd_desc
string | null
aggr_level
integer | null
is_leaf
boolean | null
customs_code
string | null
customs_desc
string | null
mos_code
string | null
mot_code
integer | null
mot_desc
string | null
qty_unit_code
integer | null
qty_unit_abbr
string | null
qty
number | null
is_qty_estimated
boolean | null
alt_qty_unit_code
integer | null
alt_qty_unit_abbr
string | null
alt_qty
number | null
is_alt_qty_estimated
boolean | null
net_wgt
number | null
is_net_wgt_estimated
boolean | null
gross_wgt
number | null
is_gross_wgt_estimated
boolean | null
cif_value
number | null
fob_value
number | null
primary_value
number | null
legacy_estimation_flag
integer | null
is_reported
boolean | null
is_aggregate
boolean | null