# Wits Worldbank — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access comprehensive trade statistics, tariffs, and development indicators for countries worldwide through the World Bank's WITS platform. Look up country trade profiles, compare bilateral trade relationships between partners, and analyze key metrics including export/import volumes, tariff rates, GDP, and FDI. Ideal for researching international commerce, trade policy, and economic indicators across any country or region.

**Category:** Government & Public Data | **Website:** [wits.worldbank.org/](https://wits.worldbank.org/) | **Docs:** [parse.bot/marketplace/3417cc21-5ec2-4b5f-a843-f5291933715d/wits-worldbank-org-api](https://parse.bot/marketplace/3417cc21-5ec2-4b5f-a843-f5291933715d/wits-worldbank-org-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-wits-worldbank-org-api-3417cc21/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_country_list

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.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `region` | string | No | 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. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-wits-worldbank-org-api-3417cc21/get_country_list \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"region":"<string>"}'
```

### get_country_snapshot

Retrieve the 'At a Glance' snapshot for a country showing overall trade summary statistics including exports, imports, FDI, tariffs, GDP, and top trading partners. The summary_stats object contains key indicators as label-value pairs. The top_partners object groups partner arrays by category heading (e.g. 'Top 5 Export Markets').

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `iso3` | string | Yes | ISO3 country code (e.g. 'NGA' for Nigeria, 'ZAF' for South Africa, 'USA' for United States). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-wits-worldbank-org-api-3417cc21/get_country_snapshot \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"iso3":"<string>"}'
```

### get_trade_by_partner

Retrieve bilateral trade data for a country and year using the WITS Chord API. Returns partner-level import/export values and metadata including number of products traded, partner share percentages, and trade balance. The data array contains per-partner trade flows; the MetaData array contains aggregate country-level trade values.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `iso3` | string | Yes | ISO3 country code of the reporting country (e.g. 'USA' for United States, 'DEU' for Germany). |
| `limit` | integer | No | Maximum number of partner records to return. |
| `year` | string | Yes | Four-digit year for trade data (e.g. '2021'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-wits-worldbank-org-api-3417cc21/get_trade_by_partner \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"iso3":"<string>","limit":"<integer>","year":"<string>"}'
```

### get_trade_indicators

Retrieve trade and development indicator data for a country and year. Returns a comprehensive set of World Bank indicators including GDP, trade percentages, import/export volumes, service trade, merchandise trade breakdowns, tax data, and GNI figures. Each indicator is a key-value pair in the indicators object.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `iso3` | string | Yes | ISO3 country code (e.g. 'NGA' for Nigeria, 'ZAF' for South Africa). |
| `year` | string | Yes | Four-digit year for indicator data (e.g. '2021'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-wits-worldbank-org-api-3417cc21/get_trade_indicators \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"iso3":"<string>","year":"<string>"}'
```

### get_trade_summary

Retrieve detailed annual trade summary for a country and year. Returns multiple tables covering exports, imports, top products, top export markets, top import sources, product category breakdown, market concentration indexes, tariff data, and GDP indicators. Each table is an array of row objects with column-header keys.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `iso3` | string | Yes | ISO3 country code (e.g. 'NGA' for Nigeria, 'ZAF' for South Africa). |
| `year` | string | Yes | Four-digit year for trade data (e.g. '2021'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-wits-worldbank-org-api-3417cc21/get_trade_summary \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"iso3":"<string>","year":"<string>"}'
```
