Skip to main content
POST
Trade data

Request contract

  • Method and path: POST /apis/v1/comtradeplus-un-org/trade-statistics/trade-data
  • Availability: enabled
  • Request URL template: https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/trade-data
Complete OpenAPI definition Effective request declaration (including authentication and referenced schemas):

Cost and request rules

Usage-based pricing. Default request estimate: $0.0005 USD. The final charge depends on actual usage. Your account price may differ; use a request quote where supported.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
period
string
required

Period(s): YYYY (annual) or YYYYMM (monthly); a comma-separated list and/or inclusive ranges (2012-2019, 201901-201906). At most 12 periods after expansion; each costs one upstream request. Pattern: ^\d{4}(\d{2})?(-\d{4}(\d{2})?)?(,\d{4}(\d{2})?(-\d{4}(\d{2})?)?)*$.

reporter_code
string
required

UN M49 numeric reporter code(s), comma-separated (156 China, 842 USA, 276 Germany). Look codes up with reference_codes table=Reporters. Pattern: ^\d{1,4}(,\d{1,4})*$.

classification
string
default:HS

Product classification in the URL path: HS (as reported, any HS edition), H0-H6 (a specific HS edition), S1-S4 (SITC), BE/BE5 (BEC), EB/EB10/EB02/EBS (EBOPS, services).

Provider reference: allowed values ["HS", "H6", "H5", "H4", "H3", "H2", "H1", "H0", "S4", "S3", "S2", "S1", "BE", "BE5", "EB", "EB10", "EB02", "EBS"]; default "HS".

cmd_code
string
default:TOTAL

One commodity code: TOTAL, an HS/SITC/BEC/EBOPS code at any level (85, 8504, 850440), or an aggregate alias AG2/AG4/AG6 for every code at that digit level. Default TOTAL. Pattern: ^[A-Za-z0-9]{1,12}$.

Provider reference: default "TOTAL".

flow_code
string

Trade flow code(s), comma-separated: M import, X export, RM re-import, RX re-export, MIP/XIP/MOP/XOP/MIF/XIF/DX/FM sub-flows. Omit for every flow. Pattern: ^[A-Za-z]{1,3}(,[A-Za-z]{1,3})*$.

freq_code
string
default:A

Frequency: A annual (period YYYY), M monthly (period YYYYMM).

Provider reference: allowed values ["A", "M"]; default "A".

include_desc
boolean

Ask the API for description and ISO columns (reporter_desc, partner_iso, cmd_desc ...). When false those come back null.

partner_code
string

Partner area code(s), comma-separated. 0 is World (the reporter's total); omit for a breakdown by every partner. Look codes up with reference_codes table=partnerAreas. Pattern: ^\d{1,4}(,\d{1,4})*$.

type_code
string
default:C

Type of trade: C commodities (goods), S services.

Provider reference: allowed values ["C", "S"]; default "C".

Response

Trade values, quantities and weights from the public preview of UN Comtrade (GET /public/v1/preview/{type}/{freq}/{classification}). One commodity code per call; the API accepts one period per request and silently caps each request at 500 records, so the function issues one request per requested period (up to 12, listed or as a range such as 2012-2019) and reports truncated per period. Partner omitted = breakdown by every partner; partner 0 = the reporter's world total. Values are USD as published (CIF for imports, FOB for exports); the full key-gated /data/v1 endpoint is not used.

The response contains the tool result directly.

These are the provider's documented fields. Field requiredness, nullability and nested object structures are specified only where the descriptions explicitly say so.