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
0
Monthly active users
2 hours ago
Last modified
Categories
Share
From The Mine Works, makers of Threads Scraper and B2B Leads Finder, with over 140,000 runs across 170+ public actors. This actor ranks #1 for "world bank trade" in Apify Store search.
Pick a country, its trading partners and a range of years, and get the value of its imports and exports with each partner as flat rows: one row per product group, partner, year and direction, in thousands of US dollars. The data comes from the World Bank's WITS TradeStats service, which publishes it as nested SDMX JSON; this actor decodes it into 12 plain fields. No API key and no World Bank account.
Why choose this actor?
- A country's trade with a partner, broken down, in seconds. In our test on 2 October, India's 2021 imports from and exports to China came back as 58 rows in 10 seconds: 29 product groups each way, from Animal and Fuels to Machinery and Electronics, Consumer goods and the All Products total.
- Flat rows, not SDMX. Every row names the reporter, partner, year, flow, product group and indicator in plain words, with the value in
value_usd_thousand, so it drops straight into a spreadsheet or a database. No dimension index decoding on your side. - Pay only for data points delivered. From $1.50 per 1,000 points on Gold, plus $0.005 per run. Combinations WITS has no data for (a year not yet published, an unknown code) are skipped and never charged.
Part of The Mine Works Company and business data family: GST Taxpayer Lookup, Company Domain Finder, SEC EDGAR Filings Scraper, EU VAT Checker (VIES), Company KYB Resolver, Bundesanzeiger Scraper.
Try it in one minute
Paste this into the JSON tab of the input page and press Start:
{"reporter": "USA","partners": ["WLD"],"yearFrom": 2022,"yearTo": 2023,"flows": ["exports"],"productCode": "Total"}
You get two rows: total US exports to the world in 2022 and in 2023 (about $2.06 trillion and $2.02 trillion, given as 2,062,089,832 and 2,018,542,583 thousand dollars).
Give countries as ISO 3 letter codes: reporter is the country whose trade you want (USA, IND, CHN, DEU, GBR), and partners is a list of the countries it trades with, or WLD for the world total. Years go in yearFrom and yearTo, the direction in flows, and the product breakdown in productCode.
Apify's free plan includes $5 of credit every month, which covers about 1,900 trade data points at this actor's Free plan price ($0.0025 a point plus the $0.005 start fee, in runs of about 58 points).
Copy to your AI assistant
themineworks/global-trade-data on Apify. Returns bilateral import and export values from the World Bank WITS TradeStats service as flat rows: reporter, partner, year, flow, product group and value in thousands of US dollars. Call ApifyClient("TOKEN").actor("themineworks/global-trade-data").call(run_input={...}), then client.dataset(run["defaultDatasetId"]).list_items().items. Required: reporter (ISO3 string, e.g. "USA"). Optional: partners (ISO3 string[], default ["WLD"] = world), yearFrom (default 2021), yearTo (default 2021), flows (["imports","exports"], default both), productCode (default "all" = 29 overlapping product groups per query; "Total" = one all products row; other WITS group codes such as "Fuels" or "84-85_MachElec"; HS codes are rejected), maxResults (1 to 50000, default 1000). Rows with _type "summary" or "info" are run reports and never billed. Full spec: GET https://api.apify.com/v2/acts/themineworks~global-trade-data/builds/default (Bearer TOKEN), which returns inputSchema and readme. Token: https://console.apify.com/account/integrations?fpr=ymnoit&utm_source=apify-readme&utm_medium=referral
Key features
- 12 fields per data point:
reporter_code,reporter,partner_code,partner,year,flow,product_code,product_name,indicator_code,indicator,value_usd_thousandandscraped_at. - Many partners, many years, both directions in one run. The actor walks every partner, year and flow you list, one WITS query each, 300 milliseconds apart, with up to 4 retries on rate limits and server errors.
- 29 product groups per query with
productCode: "all": 16 HS sections (such as27-27_Fuelsand84-85_MachElec), 8 broad groups (such asFood,Fuels,manuf), 4 UNCTAD stages of processing (raw materials to capital goods) andTotal. Ask for one code, such asTotal, to get just that row. - Up to 50,000 data points per run, capped by
maxResults. - No key, no proxy. WITS TradeStats is an open World Bank service.
How to use it
Basic: a country's trade with the world, by product group
{"reporter": "IND","yearFrom": 2021,"yearTo": 2021}
With no partners, the actor uses WLD, the world. With no flows, it reads both imports and exports. This gives 58 rows: 29 product groups each way.
Several partners and years at once
{"reporter": "IND","partners": ["CHN", "USA", "ARE", "DEU"],"yearFrom": 2019,"yearTo": 2023,"productCode": "Total","maxResults": 100}
Four partners, five years, two flows: 40 WITS queries, one Total row each. Subtract imports from exports per partner and year for India's bilateral trade balances.
One product group across partners
{"reporter": "DEU","partners": ["CHN", "USA"],"yearFrom": 2023,"yearTo": 2023,"flows": ["exports"],"productCode": "84-85_MachElec"}
On 2 October this returned German machinery and electronics exports for 2023: about $42.7 billion to China and $52.0 billion to the United States.
Market sizing before you enter a country
{"reporter": "BRA","partners": ["WLD"],"yearFrom": 2019,"yearTo": 2023,"flows": ["imports"],"maxResults": 500}
How much of a product group a country already imports is a quick proxy for demand. Read the HS section rows (codes such as 16-24_FoodProd or 50-63_TextCloth) year by year to see which groups are growing.
Annual refresh of a trade dashboard
Save any of the inputs above as a task and schedule it monthly (for example 0 6 1 * *). WITS adds a new year of data when countries report it, typically a year or two behind; set yearTo one year ahead of the latest year you have, and years that are not published yet are skipped and not charged. Each run charges every point it returns, so keep maxResults close to what you need.
Input parameters
| Parameter | Type | Default | What it does |
|---|---|---|---|
reporter | string | required (form prefill: USA) | The country whose trade you want, as an ISO 3 letter code. |
partners | array of strings | WLD when empty (form prefill: CHN) | Trading partners as ISO 3 letter codes. WLD is the world total. |
yearFrom | integer | 2021 | First year. |
yearTo | integer | 2021 | Last year. In our 2 October test, 2023 was available for the United States and 2024 was not yet published. |
flows | array of strings | both | imports, exports or both. One WITS query per partner, year and flow. |
productCode | string | all | all returns the 29 product groups listed below for every query. Give one group code, such as Total or 27-27_Fuels, to get only that row. Detailed HS codes such as 270900 are not supported: WITS answers them with an error and nothing is charged. |
maxResults | integer (1 to 50,000) | 1000 (form prefill: 100) | Most data points to return in the run. |
Product group codes returned by productCode: "all" (and accepted one at a time): Total; HS sections 01-05_Animal, 06-15_Vegetable, 16-24_FoodProd, 25-26_Minerals, 27-27_Fuels, 28-38_Chemicals, 39-40_PlastiRub, 41-43_HidesSkin, 44-49_Wood, 50-63_TextCloth, 64-67_Footwear, 68-71_StoneGlas, 72-83_Metals, 84-85_MachElec, 86-89_Transport, 90-99_Miscellan; broad groups AgrRaw, Chemical, Food, Fuels, OresMtls, Textiles, Transp, manuf; stages of processing UNCTAD-SoP1 (raw materials), UNCTAD-SoP2 (intermediate goods), UNCTAD-SoP3 (consumer goods) and UNCTAD-SoP4 (capital goods).
Run options. The default memory is 512 MB and the default timeout is 300 seconds. Each query takes about 2 to 5 seconds, so for more than about 60 partner, year and flow combinations raise the timeout in the run options.
What data do you get?
One row per data point: one reporter, partner, year, direction and product group.
Who traded with whom: reporter_code and reporter (code and name, such as IND and India), partner_code and partner (WLD and World for world totals).
When and which way: year (as text, such as "2021") and flow (imports or exports).
What and how much: product_code and product_name (the product group, such as 27-27_Fuels and Fuels), indicator_code and indicator (MPRT-TRD-VL, Import Trade Value, or XPRT-TRD-VL, Export Trade Value) and value_usd_thousand, the value in thousands of US dollars, as WITS publishes it. Multiply by 1,000 for dollars.
Capture time: scraped_at.
Do not add up all the rows. The 29 groups overlap: the HS sections, the broad groups and the stages of processing each cover the same trade in a different way, and Total is all of it. Use Total for the overall figure, and pick one family of groups for a breakdown.
Each run ends with a _type: "summary" row (reporter, partners, years, flows, points_scraped, queries_failed and charged_for) and a _type: "info" row. Neither is charged. queries_failed counts combinations WITS refused or had no data for, such as a year not yet published. Skip rows that have a _type field when you load the data.
Stable fields for automations
All 12 fields were present in every data point we sampled (72 rows from four runs between 30 September and 2 October):
| Field | What it holds |
|---|---|
reporter_code | Reporter ISO 3 code |
reporter | Reporter country name |
partner_code | Partner ISO 3 code, or WLD |
partner | Partner name, or World |
year | Year, as text |
flow | imports or exports |
product_code | WITS product group code |
product_name | Product group name |
indicator_code | MPRT-TRD-VL or XPRT-TRD-VL |
indicator | Indicator name |
value_usd_thousand | Trade value in thousands of US dollars |
scraped_at | ISO timestamp when the row was captured |
We will not rename these fields. New fields may be added over time; existing ones keep their names.
Output examples
Real rows from our test runs.
India's 2021 imports of animal products from China (reporter: "IND", partners: ["CHN"], 2 October):
{"reporter_code": "IND","reporter": "India","partner_code": "CHN","partner": "China","year": "2021","flow": "imports","product_code": "01-05_Animal","product_name": "Animal","indicator_code": "MPRT-TRD-VL","indicator": "Import Trade Value (US$ Thousand)","value_usd_thousand": 15061.8829221054,"scraped_at": "2026-10-02T15:27:42.826Z"}
Total US exports to the world in 2023 (productCode: "Total"):
{"reporter_code": "USA","reporter": "United States","partner_code": "WLD","partner": "World","year": "2023","flow": "exports","product_code": "Total","product_name": "All Products","indicator_code": "XPRT-TRD-VL","indicator": "Export Trade Value (US$ Thousand)","value_usd_thousand": 2018542583.771,"scraped_at": "2026-10-02T15:28:19.210Z"}
A stage of processing group, India's 2021 consumer goods exports to China:
{"reporter_code": "IND","reporter": "India","partner_code": "CHN","partner": "China","year": "2021","flow": "exports","product_code": "UNCTAD-SoP3","product_name": "Consumer goods","indicator_code": "XPRT-TRD-VL","indicator": "Export Trade Value (US$ Thousand)","value_usd_thousand": 3375045.22781738,"scraped_at": "2026-10-02T15:27:47.169Z"}
The summary row of a run where 2024 was not yet published (never charged):
{"_type": "summary","reporter": "USA","partners": ["WLD"],"years": [2022, 2023, 2024],"flows": ["exports"],"points_scraped": 2,"queries_failed": 1,"charged_for": 0,"scraped_at": "2026-10-02T15:28:23.284Z"}
charged_for shows 0 here only because this was a local test run; on Apify it counts the points charged.
Pricing
Pay per event: you pay for each trade data point delivered to your dataset, plus a small start fee per run.
| Event | Free | Bronze | Silver | Gold and above |
|---|---|---|---|---|
trade-point-scraped, per data point | $0.0025 | $0.0021 | $0.0018 | $0.0015 |
trade-point-scraped, per 1,000 points | $2.50 | $2.10 | $1.80 | $1.50 |
apify-actor-start, per run | $0.005 per GB of run memory, minimum one event | same | same | same |
The start fee, exactly. Apify's apify-actor-start event is charged once when a run starts, at $0.005 for each GB of memory the run uses, with a minimum of one event. This actor runs on 512 MB by default, so a default run pays one event: $0.005.
Worked examples. One country pair, one year, both flows, all groups (58 points): $0.145 plus $0.005 on the Free plan, or $0.087 plus $0.005 on Gold. Four partners over five years with productCode: "Total" (40 points): $0.10 plus $0.005 on Free. Using Total or one group code instead of all is the easiest way to pay only for the rows you need.
Never charged: partner, year and flow combinations WITS has no data for or refuses (counted in queries_failed), the summary and info rows, and retries. A run that delivers nothing pays only the start fee.
There is no scheduled price change for this actor. The Pricing tab on this page always shows the rate for your own plan; if it and this table ever differ, the Pricing tab is right.
FAQ
What is WITS TradeStats? WITS (World Integrated Trade Solution) is the World Bank's trade data platform. Its TradeStats service publishes each country's merchandise imports and exports with each partner by year and product group, drawing on the countries' own customs reporting. This actor reads its public API.
Do I need a World Bank API key or account? No. You need only an Apify account.
What unit are the values in?
Thousands of US dollars, as WITS publishes them. The field is named value_usd_thousand so it cannot be misread.
Which years are available?
Whatever the reporting country has filed with WITS, usually up to one or two years ago. On 2 October 2026, US exports were available for 2023 but not 2024. Years that are not published are skipped, counted in queries_failed and not charged.
Can I get a specific HS product code, such as crude oil?
No. TradeStats publishes product groups, not detailed HS codes: a code such as 270900 is refused by WITS. The closest group for crude oil is 27-27_Fuels. For shipment level US import detail, see US Import Records.
Why do the rows add up to more than the total?
Because the 29 groups overlap. Use the Total row for the overall value and one family of groups (HS sections, broad groups or stages of processing) for a breakdown.
How many data points does a run return?
About 29 per partner, year and flow with productCode: "all", or 1 with a single group code, up to maxResults.
Is this the same as UN Comtrade? No. WITS TradeStats is a World Bank service built on the same national customs reporting, with its own product groups and coverage.
Can I run it on a schedule?
Yes. Save your input as a task, then in Apify Console go to Schedules, Create new, and pick a time or a cron expression such as 0 6 1 * *. Trade data changes yearly, so a monthly or quarterly schedule is plenty.
How do I export the data?
From the run's Storage tab as JSON, CSV, Excel, XML or HTML, or through the Apify API. Drop the rows that have a _type field if you want data points only.
Can I use it from Claude, ChatGPT or another AI assistant?
- Connector URL:
https://mcp.apify.com/?tools=themineworks/global-trade-data. - Claude: Settings > Connectors > Add custom connector, paste the URL, sign in with Apify.
- ChatGPT: developer mode, add an MCP connector with the URL, sign in with Apify.
- Cursor or VS Code: add it as an HTTP MCP server with that URL.
- Claude Code:
claude mcp add -t http global-trade-data "https://mcp.apify.com/?tools=themineworks/global-trade-data".
Is it legal to use this data? Yes, in general: these are public statistics the World Bank publishes through an open API, with no personal data. Check the World Bank's terms of use for how to cite and redistribute them. This actor is not affiliated with the World Bank Group. This is general information, not legal advice.
Integrations
- Google Sheets: export a run to a sheet, or use Apify's Google Sheets integration to refresh a trade table on a schedule.
- Make, Zapier and n8n: use the Apify app or node to start a run and load the rows into a database or BI tool.
- Webhooks: have Apify call your URL when a run succeeds, then read the dataset.
- API and client libraries: start runs and read datasets from Python, JavaScript or any HTTP client. The "Copy to your AI assistant" block above has the exact call.
- MCP clients: Claude, ChatGPT, Cursor, VS Code and Claude Code can call the actor as a tool through
https://mcp.apify.com.
For the economic context around the trade figures, pair it with World Bank Indicators Scraper for GDP, population and other development indicators of the same countries.
More from The Mine Works
Company and business data
- GST Taxpayer Lookup
- Company Domain Finder
- SEC EDGAR Filings Scraper
- EU VAT Checker (VIES)
- Company KYB Resolver
- Bundesanzeiger Scraper
- Tech Stack Detector
- Domain to LinkedIn URL Resolver
- US Import Records
- Y Combinator Scraper
- USAspending Scraper
- Norway Company Register
Social media and video
Leads and business directories
Marketing, SEO and reviews
Real estate
Science, health and government data
Jobs and hiring
E-commerce and marketplaces
Food and local services
Developer and AI tools
More tools
Support
Found a combination that should return data but does not, or need another trade source? Open an issue on the Issues tab of this page with your input and the run ID, and we will reply there. To ask for a new data source, email dmineworks@gmail.com.
World Bank Trade Scraper turns WITS TradeStats into flat rows of imports and exports by country, partner, year and product group, charged only per data point delivered.

