International Trade Flows API (UN Comtrade)
Official yearly or monthly trade between countries from UN Comtrade: exports or imports of a reporting country with a partner, for all goods or one HS product code, in US dollars, with weight and quantity when reported.
$0.50 per 1,000 records
You pay only for the records you get. Zero records cost zero. 10,000 free records of this API to start (5,000 at the base price of $1 per 1,000), no card.
Get this data
Try it here with a few records, download the sample, fill a Google Sheet, or call it from your own code.
Try it
Run it on this page, or call it from your code with the endpoint in the developer section. A free key covers 10,000 records of this API, no card. Create a free key
For developers: the API and MCPThe endpoint, code in curl, JavaScript and Python, every input, and files for your tools
- Small runs answer in the same request; longer ones answer
202with a run to poll. fieldsreturns only the fields you name. The examples send the ones picked on this page.Idempotency-Keyis optional. A retry with it is never charged twice.- You pay for records returned. Zero records cost zero.
curl -X POST "https://pullrow.dev/v1/apis/un-comtrade-trade-flows/run" \
-H "Authorization: Bearer $PULLROW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"reporter":"CA"},"max_items":50}'Inputs
Send them as input in the request body. Leave one out to use its default.
What's in each record
9 fields.
Basics
- Reporter
Reporting country.
Example Canada
- Partner country or World
Example World
- Period
Year, or year and month, the figure covers.
Example 2024
- Flow
exports or imports.
Example imports
- Hs code
Product code (Harmonized System) or TOTAL.
Example 0201
- Description
Name of the product group.
Example Meat of bovine animals; fresh or chilled
- Trade value (USD)
Value of the trade in US dollars.
Example 846,316,155.891
- Net weight (kg)
Net weight in kilograms, when reported.
Example 79,076,414
- Quantity
Quantity in the product's standard unit, when reported.
Example 79,076,414
Technical detailsField names and types for developers
Field names and types
The names your code reads in each record. "Filled" counts how many of the 3 sample records carry the field.
| Field name | Type | Shown on this page as | Filled |
|---|---|---|---|
reporter | text | Reporter | 3 of 3 |
partner | text | Partner country or World | 3 of 3 |
period | text | Period | 3 of 3 |
flow | text | Flow | 3 of 3 |
hs_code | text | Hs code | 3 of 3 |
description | text | Description | 3 of 3 |
trade_value_usd | number | Trade value (USD) | 3 of 3 |
net_weight_kg | number | Net weight (kg) | 3 of 3 |
quantity | number | Quantity | 3 of 3 |
How it reads the site
Runs on a reader we built and maintain by hand for this site.
Save as pipeline
A pipeline remembers this API, your inputs and the fields you picked. It can run on a schedule and email you the results.
Sample records
| Record | Reporter | Partner country or World | Period | Flow | Hs code | Description | Trade value (USD) | Net weight (kg) | Quantity |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Canada | World | 2024 | imports | 0201 | Meat of bovine animals; fresh or chilled | 846,316,155.891 | 79,076,414 | 79,076,414 |
| 2 | Canada | World | 2024 | imports | 2709 | Petroleum oils and oils obtained from bituminous minerals; crude | 15,154,800,354.105 | 24,774,635,123.58 | 24,774,635,123.58 |
| 3 | Canada | World | 2024 | imports | 8703 | Motor cars and other motor vehicles; principally designed for the transport of persons (other than those of heading no. 8702), including station wagons and racing cars | 40,529,774,655.885 | 2,238,724,546.388 | 1,462,390 |
Sample records from the example output this API publishes. Email addresses and phone numbers in them are masked. Hover over a column name to see the field name your code reads.
Reliability
Counted from real runs. Our own health checks are left out. A run succeeded when it finished and the site neither blocked it nor broke it.
Incidents and repairs
How it is kept working What a repair can't do
A ready-made API, maintained by us. It is not part of the daily check or the automatic rebuild yet.
- You pay only for records returned. A run that returns none costs nothing.
- The free preview service returns at most 500 rows per request, so a broad question (all partners with all products) is cut at 500 rows; ask for one partner or one HS code to get the rest.
- Countries report on their own schedule: the latest year is often incomplete or missing, and some countries publish with a delay of a year or more. A period with no data returns no rows.
- Values are as reported to the United Nations, in US dollars. Exports are usually valued free-on-board, imports including freight; mirror data from partners can differ.
- Weight and quantity are empty for many products and for total-trade rows.
- HS codes can be 2, 4 or 6 digits (or TOTAL); the goods classification is the Harmonized System as of the version the country used.
- The source asks users to stay within fair-use limits; runs keep about one request per second. Credit UN Comtrade when you publish the data.
Version history
A run uses the live version unless the request names another one with version.
Manage this API
Only your workspace sees this part.
Automatic repair
Off: a rebuilt version is stored and waits for you in the version history.
Delete this API
Removes the API, its versions and the saved records of its runs. Calls to its address then answer 404. Records already charged stay charged. This cannot be undone.