UN Comtrade (comtradeplus.un.org) · Tariffline data
comtradeplus-un-org/trade-statistics/tariffline_dataGet market and financial data with UN Comtrade (comtradeplus.un.org) · Tariffline data from Alexandria through one Spiral API key. Which national tariff lines under an HS6 code a reporter traded with a partner in a period, with value, quantity and weight, e.g. USA imports from China under 850440 in 2019. For HS6-and-above aggregates use trade_data. It runs in the background and returns structured JSON. Pay as you go, with no subscription.
Pricing
$0.00873 per call.
Limits
- Runs
- In the background
- Returns
- json
- 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 | Default | Description |
|---|---|---|---|
period required | text | — | Period(s) YYYY or YYYYMM, comma-separated. Pattern: ^\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 | — | Commodity code(s), comma-separated: HS6 codes select every national line beneath them; national 8-10 digit codes are accepted as the reporter publishes them. Pattern: ^[A-Za-z0-9]{1,12}(,[A-Za-z0-9]{1,12})*$. |
mot_code | text | — | Mode of transport code(s), comma-separated (0 total). Pattern: ^\d{1,4}(,\d{1,4})*$. |
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. |
customs_code | text | — | Customs procedure code(s), comma-separated (C00 total). Pattern: ^[A-Za-z0-9]{1,4}(,[A-Za-z0-9]{1,4})*$. |
include_desc | true or false | — | Ask the API for description and ISO columns. |
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})*$. |
partner2_code | text | — | Second partner (consignment) code(s), comma-separated. Pattern: ^\d{1,4}(,\d{1,4})*$. |
classification | one of HS, H6, H5, H4, H3, H2, H1, H0 | HS | HS edition in the URL path (tariffline is goods only). |
Same request in code
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/tariffline_data",
"input": {
"period": "<period>",
"reporter_code": "<reporter_code>"
}
}'Frequently asked questions
How much does UN Comtrade (comtradeplus.un.org) · Tariffline 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) · Tariffline data through an API?
Send `POST /v1/runs` with `"provider": "alexandria"`, `"model": "comtradeplus-un-org/trade-statistics/tariffline_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) · Tariffline 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) · Tariffline data?
Yes. Agents find and run it through Spiral's MCP server, CLI or agent skill, with the same API key.