Bilateral Trade Flow
trade.flowImport or export volume and value between two countries for one commodity and year, from UN Comtrade. Use for 'how much X did A sell to B'. Pass countries as ISO alpha-3 (IND, GHA) and partner=WLD for the world total. Call trade.codes-equivalent discovery via /v1/trade/codes for valid values. Annual data; the response says whether the rows reconcile with the upstream's own total.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"commodity": "<commodity>",
"reporter": "<reporter>",
"year": "<year>"
},
"name": "trade.flow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flow | No | Direction from the reporter's view. Example: export. | |
| year | Yes | Four-digit year. Example: 2023. | |
| partner | No | Partner country, or WLD for the world total. Example: GHA. | |
| reporter | Yes | Reporting country, ISO alpha-3 preferred. Example: IND. | |
| commodity | Yes | Instrument code with an HS heading. Example: ZR for rice. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flow | No | ||
| year | Yes | ||
| found | Yes | False when the upstream has no data for this cell | |
| source | No | series_id is the canonical query; url re-runs it | |
| hs_code | No | Harmonised System heading queried | |
| partner | Yes | ||
| complete | No | Whether returned rows reconcile with the upstream's World total; null when there is nothing to compare | |
| reporter | Yes | ||
| commodity | Yes | ||
| license_tag | No | ||
| net_weight_kg | No | ||
| shortfall_usd | No | ||
| primary_value_usd | No |