trade

Annual international merchandise-trade flows from UN...

Annual international merchandise-trade flows from UN Comtrade (HS classification). Pass reporter (the country whose trade you want; ISO-2/ISO-3 like 'US'/'USA', a UN M49 number, or 'World'), optional partner (counterparty; default World), year (YYYY), flow (export|import), and commodity: 'TOTAL' (all goods, default), a specific HS code ('27', '8703'), or 'AG2'/'AG4'/'AG6' for a top-commodity breakdown at the 2/4/6-digit level. Returns trade value (USD), net weight, quantity, and the HS commodity, sorted by value. Country names are resolved from Comtrade's own reference data.

get/api/trade/flows

Request

  • Base URL: https://2s.io
  • URL: https://2s.io/api/trade/flows
  • Auth: API key in header PAYMENT-SIGNATURE

Query parameters

reporterstring required

Reporting country: ISO-2/ISO-3 ("US"/"USA"), UN M49 number, or "World".

partnerstring

Partner/counterparty country (same formats). Default "World" (all partners aggregated).

yearstring required

Calendar year (YYYY). Comtrade annual data typically lags ~6-12 months.

flow'export' | 'import'

Trade direction from the reporter's perspective. Default export.

commoditystring

"TOTAL" (all goods, default), a specific HS code ("27", "8703"), or "AG2"/"AG4"/"AG6" for a top-commodity breakdown.

limitinteger

Max rows to return (1-100), sorted by trade value desc. Default 25.

trial1

Try before you buy. Set to 1 for one free real call per endpoint per hour — no wallet or payment needed — to verify the endpoint before paying. Equivalent to sending the "X-2s-Trial: 1" request header. Listed only on operations that offer a trial; the others always answer 402.

Response

(unresolved $ref)

Changes

No recorded changes to this operation across all 1 revision of this API.