International Trade Statistics — UN Comtrade Imports & Exports avatar

International Trade Statistics — UN Comtrade Imports & Exports

Pricing

from $40.00 / 1,000 trade queries

Go to Apify Store
International Trade Statistics — UN Comtrade Imports & Exports

International Trade Statistics — UN Comtrade Imports & Exports

Official import and export figures between any two countries, by commodity, by year: value in US dollars, quantity, net weight and the implied unit price. From UN Comtrade, the United Nations' trade database. Country and commodity names resolved for you.

Pricing

from $40.00 / 1,000 trade queries

Rating

0.0

(0)

Developer

Benjamin Jerez

Benjamin Jerez

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Share

International Trade Statistics — UN Comtrade Imports and Exports

Official customs figures for trade between any two countries, by commodity and by year: value in US dollars, quantity, net weight, and the unit price the two imply.

From UN Comtrade, the United Nations' trade database — the source national statistics offices, market researchers and trade economists all work from.

What a query returns

US imports of passenger cars (HS 8703) from Germany and Japan:

YearPartnerValueUnitsUnit price
2021Japan$33 390 640 6721 353 572$24 669
2021Germany$15 287 824 543298 089$51 286
2022Japan$33 524 672 6751 309 665$25 598
2022Germany$19 518 487 208335 991$58 092
2023Japan$40 876 679 8721 465 999$27 883
2023Germany$23 866 838 184393 926$60 587

The unit price column is the point. Comtrade publishes value and quantity separately; dividing one by the other turns a trade figure into a market signal — a German car crossing into the US averaged $51 286 in 2021 and $60 587 two years later, while the Japanese average moved from $24 669 to $27 883.

Each row also carries CIF and FOB values where the reporter files both, net weight, price per kilogram, and flags marking any figure the UN estimated rather than received.

Names instead of codes

Comtrade speaks in numbers. Its open endpoint returns reporterDesc, partnerDesc and cmdDesc as null on every single row, so a raw response is a wall of integers: country 842, partner 276, commodity 8703.

This Actor loads the UN's reference tables at the start of each run and joins the names back on. The same tables work in the other direction, so you can write what you mean:

  • Countries — United States, USA, US, Germany, DE, DEU all resolve. The UN's own spelling is frequently not the obvious one: it calls the United States USA, South Korea Rep. of Korea, Russia Russian Federation, and Hong Kong China, Hong Kong SAR. Common names are mapped, and an unrecognised one is reported with an explanation rather than silently dropped.
  • Commodities — an HS code (8703), or a word. coffee resolves to 0901, Coffee, whether or not roasted or decaffeinated. A word search returns the four-digit heading rather than the two-digit chapter, because a chapter is usually far broader than intended — chapter 09 is "Coffee, tea, mate and spices", and would hand you tea.
  • TOTAL gives all goods, and World as a partner gives the total across every partner at once.

Two digits is a chapter, four a heading, six a specific product. The resolved code and its full label are on the summary row, so you can always see what was actually queried.

Years

The open Comtrade endpoint accepts exactly one year per request and answers a multi-year query with an error. Write 2019-2023 and the Actor issues one request per year and reassembles the series — which is why a long range takes proportionally longer.

Who uses this

Importers and exporters sizing a market or checking what a corridor is worth. Market researchers and consultancies building country-by-product models. Supply-chain and procurement teams tracking where a component actually comes from. Commodity traders watching unit prices move. Economists, journalists and NGOs working on trade flows.

What the numbers are, and are not

They are the reporter's own customs figures. Germany's exports to France and France's imports from Germany will not match. Both are correct: they are measured at different borders, on different valuations (exports FOB, imports CIF, so imports include freight and insurance), and recorded at different moments. Economists call the gap the mirror discrepancy, and it is expected rather than an error in the data.

Recent years are incomplete. Countries file months to years late, and some never file at all. An empty result for last year usually means nobody has reported yet, not that no trade occurred. The Actor says so on the summary row instead of returning a bare zero.

Estimated figures are flagged. isNetWeightEstimated and isQuantityEstimated mark values the UN derived rather than received. Net weight in particular is frequently estimated.

The open endpoint returns at most 500 rows per query. That is the UN's ceiling, not a setting here. Asking for one commodity across every partner will hit it on a large economy; naming the partners you care about, or using a four-digit code instead of a two-digit chapter, is how you stay under it. The summary row says plainly when a result was capped.

Source and licence

UN Comtrade, through its public preview endpoint at comtradeapi.un.org. No key, no account. The service throttles, and the Actor waits and retries rather than dropping a year — a multi-year run will pause occasionally, which is normal and logged.

UN Comtrade data is made available by the United Nations Statistics Division for public use.

Frequently asked

Why did my country name not resolve? Because the UN spells it differently. Try the ISO code — US, DE, JP — which always works, or the numeric code. The error message names what went wrong rather than returning an empty run.

Why do two rows have the same partner? Because they are different commodity codes. A chapter-level query returns each heading beneath it separately.

Can I get monthly figures? Not from this endpoint. It serves annual data. Monthly series require a UN Comtrade subscription key.

Why is quantity empty on some rows? Because the reporter filed a value but no quantity, which is common for aggregated codes and for commodities with no natural unit. valueUsd is still reliable; unitValueUsd is simply omitted rather than guessed.

What is HS? The Harmonised System, the world's shared customs classification. Nearly every country codes its trade with it, which is what makes these figures comparable across borders at all.