Comtrade
liveTradeEconomicsUN Comtrade API for international bilateral trade data.
Tools
comtrade_trade_dataTrade values and quantities between two countries, from UN Comtrade customs statistics.
No parameters required.
Try it
comtrade_top_partnersFind a country's top trading partners ranked by trade volume. Returns partner countries and total trade values. Defaults to ANNUAL; pass frequency="monthly" for a single month's ranking instead of the
No parameters required.
Try it
comtrade_top_commoditiesRank the products a country actually trades, largest value first, "what are Thailand's biggest exports", "what does Brazil import most", "what does the US import most from China". Works for any countr
No parameters required.
Try it
comtrade_country_codesLook up UN Comtrade reporter/partner codes for trade queries (e.g., "842" = US, "156" = China). Note Comtrade uses 842 for the US, not the ISO 840. Returns code and country name pairs.
No parameters required.
Try it
Test with curl
The gateway speaks JSON-RPC 2.0 over HTTP POST. You can test any pack directly from the terminal.
curl -X POST https://gateway.pipeworx.io/comtrade/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'curl -X POST https://gateway.pipeworx.io/comtrade/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"comtrade_trade_data","arguments":{}}}'Use with the SDK
Install @pipeworx/sdk to call tools from any TypeScript/Node project.
import { Pipeworx } from '@pipeworx/sdk';
const px = new Pipeworx();
const result = await px.call("comtrade_trade_data", {});// Or ask in plain English:
const answer = await px.ask("un comtrade api for international bilateral trade data");Related compound tools
These combine Comtrade with other data sources in a single call:
Compound trade-intelligence tools chaining Comtrade, Census, and Treasury, bilateral analysis, country profiles, and US macro trade dashboard in one call.
3 tools — trade_bilateral_analysis, trade_country_profile, trade_macro_dashboard