UN Comtrade (comtradeplus.un.org) · Data availability
comtradeplus-un-org/trade-statistics/data_availabilityGet market and financial data with UN Comtrade (comtradeplus.un.org) · Data availability from Alexandria through one Spiral API key. Before pulling data: which years/months exist for a reporter, how many records each dataset has, when it was first and last released, which HS edition it uses. Also to resolve dataset_code values for dataset_metadata. 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 |
|---|---|---|---|
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})*$. |
period | text | — | Period(s) YYYY or YYYYMM, comma-separated; omit for every period. Pattern: ^\d{4}(\d{2})?(,\d{4}(\d{2})?)*$. |
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. |
tariffline | true or false | — | Query the tariffline dataset catalogue instead of the standard one. |
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). |
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/data_availability",
"input": {
"reporter_code": "<reporter_code>"
}
}'Frequently asked questions
How much does UN Comtrade (comtradeplus.un.org) · Data availability 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) · Data availability through an API?
Send `POST /v1/runs` with `"provider": "alexandria"`, `"model": "comtradeplus-un-org/trade-statistics/data_availability"` 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) · Data availability?
No. Spiral runs it on its own Alexandria account and charges your Spiral balance.
Can my AI agent use UN Comtrade (comtradeplus.un.org) · Data availability?
Yes. Agents find and run it through Spiral's MCP server, CLI or agent skill, with the same API key.