# UN Comtrade (comtradeplus.un.org) · Trade data

Get market and financial data with UN Comtrade (comtradeplus.un.org) · Trade data from Alexandria through one Spiral API key. Annual or monthly import/export value, net weight and quantity of one HS/SITC/BEC/EBOPS code (or TOTAL, AG2/AG4/AG6 aggregates) for a reporter, optionally broken down by partner, e.g. China HS6 850440 imports 2012-2019. It runs in the background and returns structured JSON. Pay as you go, with no subscription.

- Provider: Alexandria
- Category: Finance
- Runs: In the background
- Returns: json
- Tool id: `alexandria` / `comtradeplus-un-org/trade-statistics/trade_data`
- Page: https://spiral.ai/tools/alexandria/comtradeplus-un-org/trade-statistics/trade_data

## Pricing

$0.00873 per call.

## Limits

- Longest queue wait: 1 hour
- Run deadline: 5 minutes
- Longest run, end to end: 225 minutes
- Largest inline input: 1 MB
- Largest input file: 2 GB
- Largest output: 5 GB

## Input

| Field | Kind | Allowed | Default | Description |
| --- | --- | --- | --- | --- |
| `period` (required) | text |  | — | Period(s): YYYY (annual) or YYYYMM (monthly); a comma-separated list and/or inclusive ranges (2012-2019, 201901-201906). At most 12 periods after expansion; each costs one upstream request. Pattern: ^\d{4}(\d{2})?(-\d{4}(\d{2})?)?(,\d{4}(\d{2})?(-\d{4}(\d{2})?)?)*$. |
| `reporter_code` (required) | text |  | — | UN M49 numeric reporter code(s), comma-separated (156 China, 842 USA, 276 Germany). Look codes up with reference_codes table=Reporters. Pattern: ^\d{1,4}(,\d{1,4})*$. |
| `cmd_code` | text |  | TOTAL | One commodity code: TOTAL, an HS/SITC/BEC/EBOPS code at any level (85, 8504, 850440), or an aggregate alias AG2/AG4/AG6 for every code at that digit level. Default TOTAL. Pattern: ^[A-Za-z0-9]{1,12}$. |
| `flow_code` | text |  | — | Trade flow code(s), comma-separated: M import, X export, RM re-import, RX re-export, MIP/XIP/MOP/XOP/MIF/XIF/DX/FM sub-flows. Omit for every flow. Pattern: ^[A-Za-z]{1,3}(,[A-Za-z]{1,3})*$. |
| `freq_code` | one of | A, M | A | Frequency: A annual (period YYYY), M monthly (period YYYYMM). |
| `type_code` | one of | C, S | C | Type of trade: C commodities (goods), S services. |
| `include_desc` | true or false |  | — | Ask the API for description and ISO columns (reporter_desc, partner_iso, cmd_desc ...). When false those come back null. |
| `partner_code` | text |  | — | Partner area code(s), comma-separated. 0 is World (the reporter's total); omit for a breakdown by every partner. Look codes up with reference_codes table=partnerAreas. Pattern: ^\d{1,4}(,\d{1,4})*$. |
| `classification` | one of | HS, H6, H5, H4, H3, H2, H1, H0, S4, S3, S2, S1, BE, BE5, EB, EB10, EB02, EBS | HS | Product classification in the URL path: HS (as reported, any HS edition), H0-H6 (a specific HS edition), S1-S4 (SITC), BE/BE5 (BEC), EB/EB10/EB02/EBS (EBOPS, services). |

## Example

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "alexandria",
    "model": "comtradeplus-un-org/trade-statistics/trade_data",
    "input": {
      "period": "<period>",
      "reporter_code": "<reporter_code>"
    }
  }'
```

Try it in the Playground: https://spiral.ai/start?provider=alexandria&model=comtradeplus-un-org%2Ftrade-statistics%2Ftrade_data

## Common questions

### UN Comtrade (comtradeplus.un.org) · Trade data

**How much does UN Comtrade (comtradeplus.un.org) · Trade data cost?**

$0.00873 per call. You pay as you go from one Spiral balance, with no subscription, and a failed run is not charged.

**How do I use UN Comtrade (comtradeplus.un.org) · Trade data through an API?**

Send `POST /v1/runs` with `"provider": "alexandria"`, `"model": "comtradeplus-un-org/trade-statistics/trade_data"` and the input fields on this page, using one Spiral API key. It runs in the background: poll the run, or name a webhook to be told when it finishes.

**Do I need an account with Alexandria to use UN Comtrade (comtradeplus.un.org) · Trade data?**

No. Spiral runs it on its own Alexandria account and charges your Spiral balance.

**Can my AI agent use UN Comtrade (comtradeplus.un.org) · Trade data?**

Yes. Agents find and run it through Spiral's MCP server, CLI or agent skill, with the same API key.

