Discover/World Bank API
live

World Bank 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.

Endpoint health
verified 6d ago
get_country_list
get_country_snapshot
get_trade_by_partner
get_trade_indicators
get_trade_summary
5/5 passing latest checkself-healing
Endpoints
5
Updated
21d ago

What is the World Bank 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.

Try it
Region filter applied as a case-insensitive substring match on the region field. Accepted values include 'Sub-Saharan Africa', 'Europe & Central Asia', 'Middle East & North Africa', 'East Asia & Pacific', 'South Asia', 'Latin America & Caribbean', 'North America'. Omit to return all countries.
api.parse.bot/scraper/2f90776c-49cd-4aae-bacb-3de969248392/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/2f90776c-49cd-4aae-bacb-3de969248392/get_country_list?region=Sub-Saharan+Africa' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace wits-worldbank-org-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""Walkthrough: WITS Trade API — bounded, re-runnable; every call capped."""
from parse_apis.world_bank_wits_trade_api import WITS, Region, Year, CountryNotFound

client = WITS()

# List countries in Sub-Saharan Africa, capped at 5 items.
for country in client.countries.list(region=Region.SUB_SAHARAN_AFRICA, limit=5):
    print(country.name, country.iso3, country.region, country.income_group)

# Drill into one country's snapshot via .first()
country = client.countries.list(region=Region.SUB_SAHARAN_AFRICA, limit=1).first()
if country:
    snapshot = country.snapshot()
    print(snapshot.iso3, snapshot.summary_stats)

    # Get trade indicators for a specific year
    indicators = country.trade_indicators(year=Year._2021)
    print(indicators.iso3, indicators.year, indicators.indicators)

    # Get detailed trade summary tables
    summary = country.trade_summary(year=Year._2021)
    print(summary.iso3, summary.year, len(summary.tables))

    # List bilateral trade partners (sub-resource)
    for partner in country.partners.list(year=Year._2021, limit=3):
        print(partner.partner, partner.export_value, partner.import_value)

# Typed error handling for a country that doesn't exist
try:
    bad = client.countries.list(region="Nonexistent Region", limit=1).first()
    if bad:
        bad.snapshot()
except CountryNotFound as exc:
    print(f"Country not found: {exc.iso3}")

print("exercised: countries.list / snapshot / trade_indicators / trade_summary / partners.list")
All endpoints · 5 totalmissing one? ·

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. Each country includes its World Bank region classification and income group.

Input
ParamTypeDescription
regionstringRegion filter applied as a case-insensitive substring match on the region field. Accepted values include 'Sub-Saharan Africa', 'Europe & Central Asia', 'Middle East & North Africa', 'East Asia & Pacific', 'South Asia', 'Latin America & Caribbean', 'North America'. Omit to return all countries.
Response
{
  "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": "NGA",
          "name": "Nigeria",
          "region": "Sub-Saharan Africa",
          "income_group": "Lower middle income"
        }
      ]
    },
    "status": "success"
  }
}

About the World Bank API

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.

Reliability & maintenanceVerified

The World Bank API is a managed, monitored endpoint for wits.worldbank.org — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when wits.worldbank.org changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official wits.worldbank.org API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
6d ago
Latest check
5/5 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • 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_list to 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_summary tables
  • 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
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 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.

Frequently asked questions
Does WITS have an official developer API?+
Yes. The World Bank provides the WITS Developer API at https://wits.worldbank.org/witsapiintro.aspx, offering XML-based access to trade and tariff data. It requires registration and covers a narrower set of query patterns than this Parse 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?+
Not currently. Each of 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?+
Not at the individual HS code level. 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?+
Yes. WITS data depends on national statistical reporting to UN Comtrade and other source databases. Some countries have incomplete or delayed submissions, so certain country-year combinations may return sparse tables or missing indicator values. Querying get_country_list confirms which ISO3 codes exist, but it does not indicate which years have data for a given country.
Page content last updated . Spec covers 5 endpoints from wits.worldbank.org.
Related APIs in Government PublicSee all →
beta.trademap.org API
Analyze international trade patterns by accessing comprehensive goods and services trade statistics, time series data, and trade indicators across countries and product classifications. Track trade flows using standardized HS and EBOPS product codes to compare performance metrics and coverage across different markets and time periods.
trademap.org API
Access comprehensive global trade statistics including bilateral trade flows, product exports by country, and historical trade indicators to analyze international commerce trends. Monitor trade data availability and retrieve time series information to track how specific products and countries perform in the global market.
tradestat.commerce.gov.in API
Analyze India's trade patterns by searching export-import data across commodities, countries, and regions using HS codes and historical records. Track bilateral trade flows and commodity-wise statistics to understand market trends and make informed trade decisions.
worlddata.info API
Explore global statistics and compare countries across population, economy, demographics, quality of life, education, and health metrics. Search worldwide data on everything from life expectancy and languages to religions and regional breakdowns to gain comprehensive insights into how nations rank against each other.
trademo.com API
Access comprehensive global trade data to search companies, find manufacturers by country, and review detailed trade profiles, sanctions lists, and politically exposed persons (PEP) lists. Monitor global trade indices and build a complete directory of international trading partners and compliance information.
tradingeconomics.com API
Access real-time economic calendars, macroeconomic indicators, and commodity prices across global markets including G20 nations and emerging economies. Monitor historical charts, country-specific economic data, and the latest financial news to track economic trends and make informed investment decisions.
kita.net API
Access real-time Korean trade statistics, economic indicators, and market news from KITA to monitor trade volumes by product and country, track economic trends, and stay updated on the latest trade notices and announcements. Get comprehensive trade summaries and check data update status to ensure you're working with the most current information.
wcotradetools.org API
Quickly look up official HS 2022 product classifications, browse the complete hierarchy of sections, chapters, headings, and subheadings, and search for specific commodity codes used in international trade. Organize product data with standardized, normalized classification information perfect for inventory systems and customs documentation.