World Bank Trade Scraper | Imports, Exports & 12 Fields
Pricing
from $1.50 / 1,000 trade data points
World Bank Trade Scraper | Imports, Exports & 12 Fields
Scrape bilateral import/export trade values by country & product from World Bank WITS. India, China, US & 200+ economies, no API key. Free tier, zero charge on empty runs. Works in Claude, ChatGPT & any MCP agent.
Pricing
from $1.50 / 1,000 trade data points
Rating
0.0
(0)
Developer
The Mine Works
Maintained by CommunityActor stats
0
Bookmarked
9
Total users
2
Monthly active users
6 days ago
Last modified
Categories
Share
World Bank Trade Scraper: Imports, Exports & 12 Fields
Pay only for results delivered. Browse all Actors.
💰 From $1.50 / 1,000 results.
Bilateral import and export values between any two countries, by year and product code, straight from the World Bank WITS TradeStats API. No key.
Why use this global trade data scraper
Trade data is public but awkward. WITS serves it as SDMX-JSON, a statistical interchange format where the values live in a nested dataSets object keyed by colon-delimited dimension indices that you have to resolve against a separate structure block. This actor decodes all of that and gives you flat rows.
One reporter, many partners, many years, both directions. Set the reporting country, a list of partner countries, a year range and whether you want imports, exports or both, and the actor walks the full cross-product and de-nests every data point it gets back.
Use the special partner code WLD for world totals, which is the default when you do not name partners. Product code all gives you aggregate totals; supply a specific code to narrow to a product group.
No API key. WITS TradeStats is open.
Coverage depends on what WITS has published for a given reporter, partner and year. Combinations WITS has no data for are logged and skipped, and cost nothing.
Get a country's total imports and exports for a year
The simplest run. With no partners, the actor uses WLD, the world aggregate, so this returns the country's total trade with the world.
{"reporter": "USA","yearFrom": 2021,"yearTo": 2021,"maxResults": 500}
Compare trade with several partner countries
Partner codes are ISO 3-letter country codes. The actor walks every partner-year-flow combination.
{"reporter": "IND","partners": ["CHN","USA","ARE","DEU"],"yearFrom": 2019,"yearTo": 2021,"maxResults": 2000}
Pull exports only, over a multi-year window
flows accepts imports, exports or both. Restricting to one halves the number of API calls and the number of billed data points.
{"reporter": "DEU","partners": ["CHN"],"flows": ["exports"],"yearFrom": 2015,"yearTo": 2021,"maxResults": 1000}
Narrow to a specific product group
productCode defaults to all for aggregate totals. Supply a WITS product code to restrict the query to that group.
{"reporter": "BRA","partners": ["WLD"],"productCode": "all","yearFrom": 2018,"yearTo": 2021,"flows": ["imports","exports"],"maxResults": 1500}
What data you get back
12 fields per data point.
| Field | What it is |
|---|---|
reporter_code | Reporting country code |
reporter | Reporting country name |
partner_code | Partner country code, or WLD for world |
partner | Partner country name |
year | Year of the observation |
flow | imports or exports |
product_code | Product code for the observation |
product_name | Plain-English product group name |
indicator_code | WITS indicator code |
indicator | Plain-English indicator name |
value_usd_thousand | Trade value, in thousands of US dollars |
scraped_at | ISO timestamp of capture |
Note the unit: value_usd_thousand is thousands of USD, which is how WITS publishes it.
A final _type: "summary" record lists the reporter, partners, years and flows requested, the number of points delivered, and how many individual WITS queries returned nothing.
How it works
For every partner, year and flow combination the actor calls wits.worldbank.org/API/V1/SDMX/V21/datasource/tradestats-trade/... with the import (MPRT-TRD-VL) or export (XPRT-TRD-VL) indicator, spacing requests 300ms apart.
The SDMX-JSON response is decoded by resolving each series key against the structure's dimension list: frequency, reporter, partner, product code and indicator. Observations are then flattened into one row per year value.
Combinations WITS has no data for return an empty decode and are logged and skipped, never charged. 429 and 5xx responses are retried with capped backoff.
Who uses global trade data data
Supply-chain and sourcing research. See which countries actually supply a market and at what scale before you commit to a sourcing strategy.
Macroeconomic analysis. Bilateral trade balances over a multi-year window, computed directly from import and export values.
Trade policy and tariff research. Establish a pre-policy baseline for a country pair, then compare the years after.
Market entry sizing. How much of a product category a country already imports is the fastest proxy for addressable demand.
What it costs
One pay-per-event charge, trade-point-scraped, billed per trade data point that actually lands in your dataset. Your rate depends on your own Apify discount tier:
| Your Apify tier | Per trade data point | Per 1,000 |
|---|---|---|
| FREE | $0.0025 | $2.50 |
| BRONZE | $0.0021 | $2.10 |
| SILVER | $0.0018 | $1.80 |
| GOLD / PLATINUM / DIAMOND | $0.0015 | $1.50 |
Nothing else is billed. Failed requests, blocked pages, empty searches and error records are never charged, so a run that returns no trade data points costs nothing. There is no subscription and no monthly minimum.
Run it on a schedule
Scheduled runs are the pattern most people end up on: smaller, more frequent runs finish faster, keep the data fresh, and cost exactly the same per record as one big run.
- On this actor's page, click ... -> Schedule Actor (or Console -> Schedules -> Create new).
- Pick a frequency.
@dailysuits most standing queries. - Your saved input is reused on every run and each run appends to the dataset.
- Wire the dataset to Google Sheets, Slack, or a webhook from the Integrations tab so new rows reach you without you looking.
FAQ
Do I need a World Bank API key? No. WITS TradeStats is open.
What country codes does it use?
ISO 3-letter codes, for example USA, IND, DEU, CHN. The special code WLD means the world aggregate and is the default partner.
What unit are the values in?
Thousands of US dollars. The field is named value_usd_thousand so this cannot be misread.
Why did a year return no data? WITS coverage varies by reporter, partner and year, and recent years lag. Combinations with no published data are logged and skipped, and are never charged.
Can I get product-level detail?
Yes, by setting productCode to a specific WITS product code. The default all returns aggregate totals.
How many data points does one run produce?
Roughly partners times years times flows, times however many series WITS returns for each. Set maxResults to bound it.
Is this the same as UN Comtrade? No. This is the World Bank's WITS TradeStats service. It draws on the same underlying reporting but is a separate product with its own coverage and aggregation.
Use it from Claude, ChatGPT and any MCP agent
Hosted MCP endpoint, no install, OAuth on first connect:
https://mcp.apify.com/?tools=themineworks/global-trade-data
Claude Desktop / Cursor config with token auth:
{"mcpServers": {"worldbank-trade": {"url": "https://mcp.apify.com/?tools=themineworks/global-trade-data","headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }}}}
Or call it from code with the Apify client:
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });const run = await client.actor('themineworks/global-trade-data').call({"reporter": "USA","partners": ["CHN"],"yearFrom": 2020,"yearTo": 2021,"maxResults": 500});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);
Related actors
- World Bank Indicators: GDP, population and thousands of other development indicators for the same countries.
- USAspending Scraper: US federal procurement, the government side of trade flows.
- Socrata Open Data Scraper: state and city government datasets.
- India Data.gov Scraper: Indian government open data.
Disclaimer: This actor is an independent tool and is not affiliated with, endorsed by, or sponsored by The World Bank Group. It uses the public WITS TradeStats API. Trade statistics are published by the World Bank and its data partners.
Found a bug or want a field added? Open an issue from the actor's Apify Console page or reach out through the The Mine Works profile.
Related guides
Last verified: 2026-08