Import Export Trade Data Scraper - UN Comtrade avatar

Import Export Trade Data Scraper - UN Comtrade

Pricing

from $1.99 / 1,000 results

Go to Apify Store
Import Export Trade Data Scraper - UN Comtrade

Import Export Trade Data Scraper - UN Comtrade

UN Comtrade API alternative. Scrape import/export trade statistics by country & HS code with no API key. Export bilateral trade flows to CSV/JSON.

Pricing

from $1.99 / 1,000 results

Rating

0.0

(0)

Developer

Logiover

Logiover

Maintained by Community

Actor stats

0

Bookmarked

10

Total users

6

Monthly active users

5 days ago

Last modified

Share

Import Export Trade Data Scraper — UN Comtrade Statistics (No API Key)

Apify Actor No API key Pay per result Trade Data Export

Scrape global import and export trade statistics for any country pair straight from the official UN Comtrade database. This international trade data scraper returns clean bilateral trade flows broken down by reporter country, trading partner, HS commodity code, trade value (USD), quantity and net weight — annual or monthly, with no API key, no login, no registration. Enter plain country names like Germany, China or USA and the Actor resolves them to the correct UN M49 codes, handles throttling and pagination, and streams the data into a clean dataset.

🏆 Why this UN Comtrade scraper?

15 fields per record · thousands of trade-flow rows per run · direct API + JSON (no browser) · plain country names auto-resolved to M49 · CIF/FOB values · export to JSON / CSV / Excel. The unofficial UN Comtrade API alternative for trade intelligence, market-entry research and supply-chain analysis — the Actor does country/HS-code resolution, rate-limiting and fan-out for you, so you skip the raw API and key registration.


✨ What this Actor does / Key features

  • 🌍 Any country pair — one or many reporter countries × one or many partner countries, or World (all partners combined) and all.
  • 🔤 Plain names or codes — pass USA, Germany, China or M49 numeric codes (842, 276); the Actor resolves names to the correct UN M49 codes automatically.
  • 📦 HS commodity granularity — specific HS codes (8703, 8517) or an aggregation: TOTAL (all), AG2 (all 2-digit HS chapters), AG4 (4-digit headings), AG6 (6-digit subheadings).
  • 🔁 Import, export or both — pick the trade flow direction you need.
  • 📅 Annual or monthly — a single year 2023, a list 2021,2022, a range 2020-2023, or a monthly range 202301-202312.
  • 💵 Full value breakdown — trade value in USD plus CIF (imports) and FOB (exports) values, net weight in kg, quantity and unit.
  • 🗺️ ISO3 codes included — every row carries reporter and partner ISO3 codes for easy joins and mapping.
  • Direct API + JSON extraction — reads the official UN Comtrade endpoints; no browser, no HTML parsing, no headless overhead.
  • 🛡️ Keyless preview tier — uses UN Comtrade's public preview tier; the Actor throttles and fans out across countries, commodities and periods automatically.

🚀 Quick start (3 steps)

  1. Pick your countries — enter one or more reporter countries and partner countries (plain names or M49 codes). Use World to combine all partners.
  2. Choose commodities, flow & period — HS codes or an aggregation (AG2), import / export / both, annual or monthly, and the years or months you want.
  3. Run & download — click Start, then export to JSON, CSV, Excel or XML from the Output tab, or pull it via the Apify API. Schedule it to refresh your trade datasets automatically.

📥 Input

All fields are optional — the defaults (USA reporter, World partner, AG2 commodities, last full year) return a working dataset out of the box.

Example — who do the USA & Germany import from China?

{
"reporters": "USA, Germany",
"partners": "China",
"flow": "import",
"commodities": "AG2",
"periods": "2022-2023",
"frequency": "A",
"maxResults": 1000
}

Example — which countries import cars (HS 8703) from the world?

{
"reporters": "all",
"partners": "World",
"flow": "import",
"commodities": "8703",
"periods": "2023",
"frequency": "A",
"maxResults": 2000
}

Example — monthly electronics trade flows for one year

{
"reporters": "China",
"partners": "USA, Germany, Japan",
"flow": "export",
"commodities": "8517,8542",
"periods": "202301-202312",
"frequency": "M",
"throttleMs": 1100
}
FieldTypeDescription
reportersstringReporting country/countries — plain names, M49 codes, or all. Comma-separated (e.g. USA, Germany, China or 842,276). Default USA.
partnersstringTrading partner(s) — plain names, M49 codes, World (all partners combined), or all. Comma-separated. Default World.
flowstringimport, export or both. Default both.
commoditiesstringSpecific HS codes (8703,8517) or an aggregation: TOTAL (all), AG2 (all HS2 chapters), AG4 (4-digit headings), AG6 (6-digit subheadings). Default AG2.
periodsstringYear 2023, list 2021,2022, range 2020-2023, or monthly 202301-202312. Blank = last full year.
frequencystringA (annual) or M (monthly). Default A.
maxResultsintegerMaximum trade records to save. Default 1000.
throttleMsintegerDelay between API calls in ms. The keyless tier rate-limits to ~1 req/sec — keep ≥ 1100. Default 1100.
proxyConfigurationobjectApify Proxy settings. Datacenter is fine for this API.

Tip — finding M49 codes: you rarely need them. Just type the country name (Germany, Republic of Korea, Viet Nam) and the Actor maps it to the UN M49 numeric code. Use World as the partner to get each reporter's total trade with all partners in one row, or all to expand every bilateral pair.

📤 Output

One row per reporter × partner × commodity × period × flow15 fields, exportable to JSON, CSV, Excel or XML. Here is a trimmed sample record:

{
"reporter": "USA",
"reporterISO": "USA",
"partner": "China",
"partnerISO": "CHN",
"flow": "Import",
"period": "2023",
"hsCode": "85",
"commodity": "Electrical machinery and equipment",
"tradeValueUsd": "127845300000",
"cifValueUsd": "127845300000",
"fobValueUsd": null,
"netWeightKg": "4120500000",
"qty": "N/A",
"qtyUnit": "N/A",
"scrapedAt": "2026-07-06T08:30:11.000Z"
}

💡 Use cases

  • Market-entry research — see which countries buy a product and how much, before you enter a market.
  • Competitor & supplier sourcing — find where a country imports a commodity from, and in what volume.
  • Commodity trade trends — track import/export value over years or months by HS code.
  • Supply-chain & tariff impact analysis — model how bilateral flows shift over time.
  • Economics & BI dashboards — feed clean bilateral trade statistics into your reports and visualizations.
  • AI agents & data products — provide structured international trade data to LLM workflows and datasets.

👥 Who uses it

Trade analysts & market-entry consultants · supply-chain and procurement teams · economists & data journalists · import/export businesses sourcing suppliers · BI/analytics teams building trade dashboards · researchers and AI/data-product builders needing structured customs statistics.

💰 Pricing

This Actor runs on a simple pay-per-result model — you pay for the trade records you extract, with no separate Apify platform fees to calculate. Try it on the free tier first, then scale up. See the Pricing tab on this page for the current rate.

❓ Frequently Asked Questions

Is it legal to scrape UN Comtrade data? The Actor collects publicly available official trade statistics from UN Comtrade's preview tier. You are responsible for using the data in compliance with UN Comtrade's terms and applicable laws.

Do I need a UN Comtrade API key? No. This Actor uses the keyless UN Comtrade preview tier — no registration, no key, no login. Only an Apify account is required.

Does UN Comtrade have a public API — is this an API alternative? UN Comtrade exposes a raw data API that normally involves key registration, M49 code lookups, throttling and pagination handling. This Actor is an unofficial UN Comtrade API alternative that does all of that for you: it resolves country names to M49 codes, respects the rate limit, fans out across your countries/commodities/periods, and returns tidy rows.

Can I use plain country names? Yes. Pass names like Germany, China, USA, Republic of Korea and the Actor resolves them to the correct UN M49 codes automatically. Numeric M49 codes also work.

What are AG2, AG4 and AG6? HS aggregation levels — AG2 = all 2-digit HS chapters, AG4 = 4-digit headings, AG6 = 6-digit subheadings. You can also pass specific HS codes like 8703,8517, or TOTAL for the all-commodities total.

Is this company- or shipment-level data? No — this is statistical trade-flow data (country × commodity × value), the official UN Comtrade figures. It is not shipment-level bill-of-lading or individual company records.

Can I scrape UN Comtrade without an API or login?

Yes. There is no UN Comtrade account, login or API key needed — only an Apify account. Enter your reporter/partner countries, HS codes, flow and periods, then run. The Actor uses the keyless UN Comtrade preview tier.

How do I export UN Comtrade data to CSV or JSON?

Run the Actor and download the dataset as CSV, JSON, Excel, HTML or XML from the run, or fetch it through the Apify API and integrations (Make, Zapier, Google Sheets). Every row is one reporter × partner × HS code × period × flow record.

How much data can I get?

You can pull thousands of trade-flow rows per run. The keyless preview tier caps ~500 records per single query and rate-limits to ~1 request/second, so the Actor automatically throttles (keep throttleMs ≥ 1100) and fans out across countries, commodities and periods. For very broad jobs (e.g. all reporters over many years), split into smaller runs.

How do I find which countries import a product by HS code?

Set the partner to World and enter the HS code as commodities; the scraper returns each reporter country's import value and quantity for that product from UN Comtrade.

Can I get monthly trade data instead of annual figures?

Yes. Set frequency to M and pass a monthly range like 202301-202312 to pull month-by-month bilateral trade flows.

🔗 More B2B & registry data scrapers by logiover

Building a trade-intelligence or company-data pipeline? Pair UN Comtrade with the rest of the B2B, registry and government-data suite:

SourceActor
🇪🇺 EU registriesEU Companies Registry Scraper
🇬🇧 UKUK Companies House Bulk Scraper
🇺🇸 USASEC EDGAR Form D Scraper · USAspending.gov Scraper · NY Company Registry Scraper
🇫🇷 FranceFrance Company Registry Scraper
🇫🇮 FinlandFinland Company Registry Scraper
🇨🇿 CzechiaCzech Company Registry Scraper
🇳🇴 NorwayBrreg Norway Company Scraper
🇸🇪 SwedenAllabolag Scraper
🇦🇺 AustraliaAustralia Business Register Scraper
🌐 GlobalGLEIF LEI Scraper · Global Public Tenders Scraper
🏥 Health/registryNPI Registry Scraper · FDA Data Scraper · ClinicalTrials.gov Scraper

👉 Browse all logiover scrapers on Apify Store — 180+ actors across real estate, jobs, crypto, social media & B2B data.

⏰ Scheduling & integration

Schedule this Actor on Apify to refresh your trade datasets monthly or quarterly as new UN Comtrade periods are released. Export results to JSON, CSV or Excel, sync to Google Sheets, or push to your database, BI tools and webhooks through the Apify API. Connect it to Make, n8n or Zapier to build automated trade-intelligence pipelines.

⭐ Support & feedback

Found a bug or need an extra field? Open an issue on the Issues tab — response is usually fast. If this Actor saves you time, a ★★★★★ review on the Store page genuinely helps and is hugely appreciated. 🙏

This Actor extracts only publicly available official UN Comtrade statistics and is intended for legitimate research, analytics and business intelligence. It is an independent scraper and is not affiliated with or endorsed by the United Nations. You are responsible for complying with UN Comtrade's terms of service and any applicable local laws.


📝 Changelog

2026-07-06

  • ✨ README overhaul: added badge row, ready-to-run example scenarios, full field reference, B2B/registry cross-suite links and an expanded high-intent FAQ.

2026-07-01

  • Maintenance pass: re-verified end-to-end on live data and confirmed successful runs within the 5-minute quality window on the default input.
  • Sharpened Store metadata (SEO title & description) and expanded the FAQ with high-intent, long-tail questions for easier discovery in Google and Apify Store search.
  • Added ready-to-run example tasks that cover common real-world use cases.

2026-06-15

  • Reliability pass: re-verified end-to-end on live data with real-world inputs. Routine maintenance build.

2026-06-07

  • Docs: added coverage for using this as a UN Comtrade API alternative, scraping without an API key, and exporting trade data to CSV/JSON.

2026-06-05

  • 🛡️ Reliability fix: results are no longer dropped by strict output validation — runs now complete cleanly even at high volume (thousands of results).
  • ⚡ Stability & performance hardening; fresh rebuild.

2026-06-04

  • Verified live & refreshed build — reliability/maintenance pass.