Skip to content

thirdwatch-dev/trade-data-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

UN Comtrade Trade Data Scraper - Bilateral Trade by HS Code

Scrape bilateral trade data from UN Comtrade. Get import/export values between any two countries at HS code level.

What you get

Extract import/export trade data from the UN Comtrade database. Find trade values between any two countries, track trade trends over time, and discover top traded product categories. Covers 200+ countries and all HS codes.

Output fields

Field Description
reporter Reporting country
partner Partner country
hs_code HS commodity code
commodity Product description
trade_flow Import or Export
trade_value Trade value in USD
year Data year
weight_kg Net weight in kg

Example output

{
    "reporter": "United States",
    "partner": "China",
    "hs_code": "8471",
    "commodity": "Automatic data processing machines",
    "trade_flow": "Import",
    "trade_value": 42000000000,
    "year": 2024,
    "weight_kg": 850000000
}

Input parameters

Parameter Required Description
reporterCountry Yes Reporting country code
partnerCountry No Partner country code (empty = all)
hsCode No HS commodity code filter
year No Data year (default: latest)
maxResults No Max results (default: 100)

Use cases

  • Trade analysts: Track bilateral trade flows and trends
  • Economists: Research international trade patterns
  • Policy researchers: Analyze trade imbalances and commodity flows
  • Business strategists: Identify export/import opportunities

Pricing

Pay-per-result pricing at $0.001 per record. Free API, no proxy needed.

Limitations

  • Data availability depends on UN Comtrade reporting (may lag 1-2 years)
  • Some country-commodity pairs may have limited data
  • HS code granularity varies by reporting country

About

Scrape UN Comtrade bilateral trade data by HS code

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors