wits.worldbank.org APIwits.worldbank.org ↗
Access country trade profiles, bilateral trade data, tariffs, GDP, and World Bank development indicators via the WITS API. 5 endpoints, 266 countries covered.
curl -X GET 'https://api.parse.bot/scraper/2f90776c-49cd-4aae-bacb-3de969248392/get_country_list' \ -H 'X-API-Key: $PARSE_API_KEY'
Retrieve the list of countries available in WITS with their ISO3 codes, names, regions, and income groups. Optionally filter by region name (case-insensitive substring match). Returns all 266 countries when no filter is applied.
| Param | Type | Description |
|---|---|---|
| region | string | Region filter applied as a case-insensitive substring match on the region field. Example values: 'Sub-Saharan Africa', 'Europe & Central Asia', 'Middle East & North Africa'. Omit to return all countries. |
{
"type": "object",
"fields": {
"count": "integer total number of countries returned",
"countries": "array of country objects each containing name, iso3, region, and income_group"
},
"sample": {
"data": {
"count": 48,
"countries": [
{
"iso3": "AGO",
"name": "Angola",
"region": "Sub-Saharan Africa",
"income_group": "Lower middle income"
},
{
"iso3": "BEN",
"name": "Benin",
"region": "Sub-Saharan Africa",
"income_group": "Lower middle income"
}
]
},
"status": "success"
}
}About the wits.worldbank.org API
The WITS API delivers trade statistics and development indicators from the World Bank's World Integrated Trade Solution platform across 266 countries through 5 endpoints. Use get_country_list to look up ISO3 codes and regional groupings, get_trade_by_partner to retrieve bilateral import/export volumes and trade balances, or get_trade_indicators to pull GDP, GNI, merchandise trade breakdowns, and tariff figures for any country-year pair.
Country Coverage and Lookup
The get_country_list endpoint returns all 266 countries in the WITS database, each with a name, iso3 code, region, and income_group. An optional region parameter filters results by case-insensitive substring match, so querying 'Sub-Saharan' narrows the list to Sub-Saharan African economies. ISO3 codes returned here are the required input for every other endpoint.
Country Trade Profiles
get_country_snapshot returns an at-a-glance trade summary for a given ISO3 code. The response includes summary_stats — a flat object of labeled indicators like total exports, imports, FDI inflows, and average tariff rates — plus top_partners, which maps category headings to ranked arrays of trading partners with associated value_mil figures. get_trade_summary goes deeper: for a specific iso3 and year, it returns multiple structured tables covering top products, top export markets, top import sources, product category breakdowns, market concentration indexes, and GDP indicators.
Bilateral and Indicator Data
get_trade_by_partner accepts an iso3 and year and returns partner-level records containing Reporter, Partner, Import, Export, and MetaData fields, including partner share percentages and trade balance figures. An optional limit parameter caps the number of partner records returned. get_trade_indicators maps a broad set of World Bank indicators — including trade as a percentage of GDP, service trade values, tax data, and GNI figures — to their values for a given country and year, returned as a flat indicators object.
Data Source Notes
WITS aggregates data from UN Comtrade, UNCTAD, and World Bank datasets. Not all country-year combinations have complete data; some indicators or trade tables may return sparse results depending on a country's reporting history. The year parameter accepts four-digit strings and should reflect years for which the country has submitted trade data to the underlying databases.
- Build a country trade profile dashboard showing exports, imports, FDI, and top partners using
get_country_snapshot - Analyze bilateral trade balances between specific country pairs with import/export values from
get_trade_by_partner - Filter countries by income group or region using
get_country_listto scope economic research datasets - Track GDP, GNI, and trade-as-percent-of-GDP trends over time with
get_trade_indicators - Compare top export markets and product category breakdowns across years using
get_trade_summarytables - Identify market concentration and tariff exposure for a given country-year using trade summary indexes
- Populate country selectors in trade analytics tools with ISO3 codes and region metadata from
get_country_list
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 250 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does WITS have an official developer API?+
What does `get_trade_by_partner` return, and how does the `limit` parameter work?+
get_trade_by_partner returns one record per trading partner, each with Reporter, Partner, Import, Export, and a MetaData array containing aggregate trade values and partner share percentages. The optional limit parameter caps how many partner records are included in data; omitting it returns all available partners for that country-year.Can I retrieve historical time-series data across multiple years in a single call?+
get_trade_summary, get_trade_by_partner, and get_trade_indicators accepts a single year per request. To build a time series you would need one call per year. You can fork this API on Parse and revise it to add a multi-year endpoint that loops and aggregates results.Does the API expose product-level tariff lines or HS code data?+
get_trade_summary includes aggregate tariff figures and product category breakdowns, and get_country_snapshot surfaces average tariff rates in summary_stats, but line-level tariff schedules are not currently returned. You can fork this API on Parse and revise it to add an endpoint targeting WITS product-level tariff data.Are there gaps in country or year coverage?+
get_country_list confirms which ISO3 codes exist, but it does not indicate which years have data for a given country.