> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# UN Comtrade

> International merchandise and services trade statistics by reporter, partner, commodity and flow from UN Comtrade's keyless public API: preview queries, world shares, data availability and metadata.

![](https://mintcdn.com/webrouter/8QP9EZc8V07Kl-0I/logo/data-apis/un-comtrade.webp?fit=max\&auto=format\&n=8QP9EZc8V07Kl-0I\&q=85\&s=0301290c995e2613e132ea088473423c)

[Web Catalog · Finance](https://docs.webrouter.net/data-apis.md?category=finance)

No key needed

Endpoints

6

Auth

None

[Vendor docs](https://comtradeplus.un.org/ApiDocs)

## Notes

* The public endpoints here need no key. Preview queries return at most 500 records; /preview takes one period and one commodity code per call.
* Path codes: typeCode C (goods) or S (services); freqCode A (annual) or M (monthly); clCode the classification (HS, H6..H0, S4..S1, BE, BE5, EB, EB10, EB02, EBS).
* Full queries, bulk files and async jobs need a free subscription key (Ocp-Apim-Subscription-Key) on other paths; this entry covers only the public ones.

## Endpoints

GET

Preview trade flows

Trade values by reporter, partner, commodity and flow for one period, up to 500 records.

[Open](#un-comtrade-trade-preview)

GET

Preview tariff-line trade flows

Tariff-line detail (with customs procedure and mode of transport) for several periods and commodities, up to 500 records.

[Open](#un-comtrade-trade-preview-tariffline)

GET

Get reporters' share of world trade

Each reporter's share of world trade for a period.

[Open](#un-comtrade-trade-world-share)

GET

Get data availability

Which reporters and periods have data for a type, frequency and classification.

[Open](#un-comtrade-availability)

GET

Get dataset metadata

Metadata and notes of the datasets for a type, frequency and classification.

[Open](#un-comtrade-metadata)

GET

List data releases

Recent Comtrade data releases.

[Open](#un-comtrade-releases)

### Preview trade flows

GET

`/preview/{typeCode}/{freqCode}/{clCode}`

`un-comtrade.trade.preview`

Trade values by reporter, partner, commodity and flow for one period, up to 500 records.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`typeCode` required</td><td>string</td><td>path</td><td>C goods, S services. One of `C`, `S` Example `C`</td></tr>
    <tr><td>`freqCode` required</td><td>string</td><td>path</td><td>A annual, M monthly. One of `A`, `M` Example `A`</td></tr>
    <tr><td>`clCode` required</td><td>string</td><td>path</td><td>Classification code. Example `HS`</td></tr>

    <tr>
      <td>
        `reporterCode`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Reporter codes, comma-separated.
      </td>
    </tr>

    <tr><td>`period`</td><td>string</td><td>query</td><td>One period: YYYY or YYYYMM. Example `2022`</td></tr>

    <tr>
      <td>
        `partnerCode`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Partner codes, comma-separated.
      </td>
    </tr>

    <tr>
      <td>
        `cmdCode`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        One commodity code.
      </td>
    </tr>

    <tr>
      <td>
        `flowCode`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Trade flow codes, comma-separated.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://comtradeplus.un.org/ApiDocs)

```python Python theme={null}
router.call_data_api("un-comtrade.trade.preview", {'typeCode': 'C', 'freqCode': 'A', 'clCode': 'HS', 'period': '2022'})
```

```text MCP theme={null}
call_data_api(endpoint="un-comtrade.trade.preview", params={"typeCode": "C", "freqCode": "A", "clCode": "HS", "period": "2022"})
```

### Preview tariff-line trade flows

GET

`/previewTariffline/{typeCode}/{freqCode}/{clCode}`

`un-comtrade.trade.preview_tariffline`

Tariff-line detail (with customs procedure and mode of transport) for several periods and commodities, up to 500 records.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`typeCode` required</td><td>string</td><td>path</td><td>C goods, S services. One of `C`, `S` Example `C`</td></tr>
    <tr><td>`freqCode` required</td><td>string</td><td>path</td><td>A annual, M monthly. One of `A`, `M` Example `M`</td></tr>
    <tr><td>`clCode` required</td><td>string</td><td>path</td><td>HS or H6..H0. Example `HS`</td></tr>

    <tr>
      <td>
        `reporterCode`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Reporter code.
      </td>
    </tr>

    <tr>
      <td>
        `period`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Periods, comma-separated (YYYY or YYYYMM).
      </td>
    </tr>

    <tr>
      <td>
        `partnerCode`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Partner code.
      </td>
    </tr>

    <tr>
      <td>
        `partner2Code`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Second partner code.
      </td>
    </tr>

    <tr>
      <td>
        `cmdCode`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Commodity codes, comma-separated.
      </td>
    </tr>

    <tr>
      <td>
        `flowCode`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Trade flow codes, comma-separated.
      </td>
    </tr>

    <tr>
      <td>
        `customsCode`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Customs procedure codes, comma-separated.
      </td>
    </tr>

    <tr>
      <td>
        `motCode`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Mode of transport codes, comma-separated.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://comtradeplus.un.org/ApiDocs)

```python Python theme={null}
router.call_data_api("un-comtrade.trade.preview_tariffline", {'typeCode': 'C', 'freqCode': 'M', 'clCode': 'HS'})
```

```text MCP theme={null}
call_data_api(endpoint="un-comtrade.trade.preview_tariffline", params={"typeCode": "C", "freqCode": "M", "clCode": "HS"})
```

### Get reporters' share of world trade

GET

`/getWorldShare/{typeCode}/{freqCode}`

`un-comtrade.trade.world_share`

Each reporter's share of world trade for a period.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`typeCode` required</td><td>string</td><td>path</td><td>C goods, S services. One of `C`, `S` Example `C`</td></tr>
    <tr><td>`freqCode` required</td><td>string</td><td>path</td><td>A annual, M monthly. One of `A`, `M` Example `A`</td></tr>
    <tr><td>`period`</td><td>string</td><td>query</td><td>YYYY or YYYYMM, comma-separated, or 'recent'. Example `recent`</td></tr>

    <tr>
      <td>
        `reporterCode`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Reporter codes, comma-separated.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://comtradeplus.un.org/ApiDocs)

```python Python theme={null}
router.call_data_api("un-comtrade.trade.world_share", {'typeCode': 'C', 'freqCode': 'A', 'period': 'recent'})
```

```text MCP theme={null}
call_data_api(endpoint="un-comtrade.trade.world_share", params={"typeCode": "C", "freqCode": "A", "period": "recent"})
```

### Get data availability

GET

`/getDA/{typeCode}/{freqCode}/{clCode}`

`un-comtrade.availability`

Which reporters and periods have data for a type, frequency and classification.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`typeCode` required</td><td>string</td><td>path</td><td>C goods, S services. One of `C`, `S` Example `C`</td></tr>
    <tr><td>`freqCode` required</td><td>string</td><td>path</td><td>A annual, M monthly. One of `A`, `M` Example `A`</td></tr>
    <tr><td>`clCode` required</td><td>string</td><td>path</td><td>Classification code. Example `HS`</td></tr>
  </tbody>
</table>

[Vendor docs](https://comtradeplus.un.org/ApiDocs) · Same job: [Corpo API](https://docs.webrouter.net/data-apis/corpoapi.md#corpoapi-coverage-list), [Openverse](https://docs.webrouter.net/data-apis/openverse.md#openverse-images-stats)

```python Python theme={null}
router.call_data_api("un-comtrade.availability", {'typeCode': 'C', 'freqCode': 'A', 'clCode': 'HS'})
```

```text MCP theme={null}
call_data_api(endpoint="un-comtrade.availability", params={"typeCode": "C", "freqCode": "A", "clCode": "HS"})
```

### Get dataset metadata

GET

`/getMetadata/{typeCode}/{freqCode}/{clCode}`

`un-comtrade.metadata`

Metadata and notes of the datasets for a type, frequency and classification.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`typeCode` required</td><td>string</td><td>path</td><td>C goods, S services. One of `C`, `S` Example `C`</td></tr>
    <tr><td>`freqCode` required</td><td>string</td><td>path</td><td>A annual, M monthly. One of `A`, `M` Example `A`</td></tr>
    <tr><td>`clCode` required</td><td>string</td><td>path</td><td>Classification code. Example `HS`</td></tr>
  </tbody>
</table>

[Vendor docs](https://comtradeplus.un.org/ApiDocs) · Same job: [Affinity](https://docs.webrouter.net/data-apis/affinity.md#affinity-companies-fields), [ArcGIS Online](https://docs.webrouter.net/data-apis/arcgis.md#arcgis-items-get), [Attio](https://docs.webrouter.net/data-apis/attio.md#attio-attributes-list), [Bank of Canada](https://docs.webrouter.net/data-apis/bankofcanada.md#bankofcanada-series-get), [US Bureau of Economic Analysis](https://docs.webrouter.net/data-apis/bea.md#bea-parameters-list), [Bright Data](https://docs.webrouter.net/data-apis/brightdata.md#brightdata-datasets-metadata)

```python Python theme={null}
router.call_data_api("un-comtrade.metadata", {'typeCode': 'C', 'freqCode': 'A', 'clCode': 'HS'})
```

```text MCP theme={null}
call_data_api(endpoint="un-comtrade.metadata", params={"typeCode": "C", "freqCode": "A", "clCode": "HS"})
```

### List data releases

GET

`/getComtradeReleases`

`un-comtrade.releases`

Recent Comtrade data releases.

Input

No inputs.

[Vendor docs](https://comtradeplus.un.org/ApiDocs) · Same job: [ArcGIS Online](https://docs.webrouter.net/data-apis/arcgis.md#arcgis-groups-search), [Attio](https://docs.webrouter.net/data-apis/attio.md#attio-objects-list), [Bank of Canada](https://docs.webrouter.net/data-apis/bankofcanada.md#bankofcanada-lists), [US Bureau of Economic Analysis](https://docs.webrouter.net/data-apis/bea.md#bea-datasets-list), [Bright Data](https://docs.webrouter.net/data-apis/brightdata.md#brightdata-datasets-list), [Clay](https://docs.webrouter.net/data-apis/clay.md#clay-tables-query)

```python Python theme={null}
router.call_data_api("un-comtrade.releases")
```

```text MCP theme={null}
call_data_api(endpoint="un-comtrade.releases")
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.