UN Comtrade Dataset Metadata
comtrade.trade.metadataRetrieve methodological metadata for a UN Comtrade dataset: the reporting currency, USD conversion factors applied (import/export), trade system used (General vs Special trade), import/export valuation method (CIF vs FOB), partner country attribution rules, and publication notes. Essential for understanding how to interpret the trade values in comtrade.trade_data results. Each country reports using its own methodology and currency — this endpoint reveals those details. Source: UN Comtrade public preview API, no auth.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period | Yes | Reference period. Annual: 4-digit year (e.g. "2022"). Monthly: YYYYMM (e.g. "202209"). Returns currency conversion factors, trade system, valuation notes for this dataset. | |
| freq_code | No | Frequency. A=Annual (default), M=Monthly. | |
| type_code | No | Data type. C=Commodities (default), S=Services. | |
| show_history | No | Include historical revisions in the metadata response. Default false (returns only the latest version). | |
| reporter_code | Yes | UN numeric code for the reporting country. Example: 276=Germany, 840=USA, 156=China. Use comtrade.reporters to look up codes. | |
| classification | No | Classification system. HS=Harmonized System (default). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Present only when the call failed. Includes error code, message, request_id, and any provider-specific extras. | |
| result | No | Tool response payload. Shape varies per tool — consult the tool description and inputSchema. May be an object, array, string, or number depending on the upstream provider response. |