# World Bank API
> Economic and development data for every country, drawn from the World Bank Open Data catalogue. Pull a clean time series for any of roughly 1,500 indicators — GDP, population, inflation, life expectancy, CO₂ emissions, internet use and far more — for a chosen country and year range; list and filter countries by region or income level with capital and coordinates; look up a single country; and search the indicator catalogue to discover the codes you need. Authoritative open data returned as tidy JSON through a fast, reliable API. Ideal for fintech and research, economic dashboards and BI tools, data journalism, education and development analytics.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/worldbank-api/..."
```

## Pricing
- **Free** (Free) — 1,500 calls/Mo, 2 req/s
- **Basic** ($6/Mo) — 40,000 calls/Mo, 5 req/s
- **Pro** ($17/Mo) — 250,000 calls/Mo, 12 req/s
- **Mega** ($42/Mo) — 1,500,000 calls/Mo, 30 req/s

## Endpoints

### World Bank

#### `GET /v1/countries` — List / filter countries

**Parameters:**
- `region` (query, optional, string) — Region filter Example: `Europe`
- `income` (query, optional, string) — Income level filter
- `search` (query, optional, string) — Name search
- `page` (query, optional, string) — 1-50 Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/worldbank-api/v1/countries?region=Europe&page=1"
```

**Response:**
```json
{
    "data": {
        "total": 296,
        "returned": 58,
        "countries": [
            {
                "id": "ALB",
                "iso2": "AL",
                "name": "Albania",
                "region": "Europe & Central Asia",
                "capital": "Tirane",
                "latitude": 41.3317,
                "longitude": 19.8172,
                "income_level": "Upper middle income",
                "lending_type": "IBRD"
            },
            {
                "id": "AND",
                "iso2": "AD",
                "name": "Andorra",
                "region": "Europe & Central Asia",
                "capital": "Andorra la Vella",
                "latitude": 42.5075,
                "longitude": 1.5218,
                "income_level": "High income",
                "lending_type": "Not classified"
            },
            {
                "id": "ARM",
                "iso2": "AM",
                "name": "Armenia",
                "region": "Europe & Central Asia",
                "capital": "Yerevan",
                "latitude": 40.1596,
                "longitude": 44.509,
                "income_level": "Upper middle income",
                "lending_type": "IBRD"
            },
            {
                "id": "AUT",
                "iso2": "AT",
                "name": "Austria",
                "region": "Europe & Central Asia",
                "capital": "Vienna",
                "latitude": 48.2201,
                "longitude": 16
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/country` — Single country

**Parameters:**
- `code` (query, required, string) — 2- or 3-letter country code Example: `DE`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/worldbank-api/v1/country?code=DE"
```

**Response:**
```json
{
    "data": {
        "id": "DEU",
        "iso2": "DE",
        "name": "Germany",
        "region": "Europe & Central Asia",
        "capital": "Berlin",
        "latitude": 52.5235,
        "longitude": 13.4115,
        "income_level": "High income",
        "lending_type": "Not classified"
    },
    "meta": {
        "timestamp": "2026-05-30T18:16:59.883Z",
        "request_id": "f79d4a09-7603-4076-8752-32271cb9dd4d"
    },
    "status": "ok",
    "message": "Country retrieved",
    "success": true
}
```

#### `GET /v1/indicator` — Indicator time series

**Parameters:**
- `country` (query, required, string) — 2- or 3-letter country code Example: `US`
- `indicator` (query, required, string) — World Bank indicator code Example: `NY.GDP.MKTP.CD`
- `start` (query, optional, string) — Start year Example: `2018`
- `end` (query, optional, string) — End year Example: `2022`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/worldbank-api/v1/indicator?country=US&indicator=NY.GDP.MKTP.CD&start=2018&end=2022"
```

**Response:**
```json
{
    "data": {
        "unit": null,
        "count": 5,
        "series": [
            {
                "date": "2022",
                "value": 25604848907611
            },
            {
                "date": "2021",
                "value": 23315080560000
            },
            {
                "date": "2020",
                "value": 21060473613000
            },
            {
                "date": "2019",
                "value": 21380976119000
            },
            {
                "date": "2018",
                "value": 20533057312000
            }
        ],
        "country": {
            "id": "USA",
            "name": "United States"
        },
        "indicator": {
            "id": "NY.GDP.MKTP.CD",
            "name": "GDP (current US$)"
        },
        "last_updated": "2026-04-08"
    },
    "meta": {
        "timestamp": "2026-05-30T18:17:00.394Z",
        "request_id": "2667764d-97d7-4851-9159-d0a4ffc5cf69"
    },
    "status": "ok",
    "message": "Indicator series retrieved",
    "success": true
}
```

#### `GET /v1/indicators` — Search indicator catalogue

**Parameters:**
- `search` (query, optional, string) — Search by name or code Example: `GDP`
- `page` (query, optional, string) — 1-50 Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/worldbank-api/v1/indicators?search=GDP&page=1"
```

**Response:**
```json
{
    "data": {
        "page": 1,
        "pages": 8,
        "total": 1486,
        "returned": 7,
        "indicators": [
            {
                "id": "BG.GSR.NFSV.GD.ZS",
                "name": "Trade in services (% of GDP)",
                "source": "World Development Indicators",
                "topics": [
                    "Economy & Growth",
                    "Private Sector",
                    "Trade"
                ]
            },
            {
                "id": "BM.KLT.DINV.WD.GD.ZS",
                "name": "Foreign direct investment, net outflows (% of GDP)",
                "source": "World Development Indicators",
                "topics": [
                    "Economy & Growth",
                    "Financial Sector "
                ]
            },
            {
                "id": "BN.CAB.XOKA.GD.ZS",
                "name": "Current account balance (% of GDP)",
                "source": "World Development Indicators",
                "topics": [
                    "Economy & Growth"
                ]
            },
            {
                "id": "BX.KLT.DINV.WD.GD.ZS",
                "name": "Foreign direct investment, net inflows (% of GDP)",
                "source": "World Development Indicators",
                "topics": [
                    "Economy & Growth",
                    "Financial Sector ",
                    "Climate Change"
                ]
            },
            {
                "id": "BX.TRF.PWKR.
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/worldbank-api
OpenAPI spec: https://www.oanor.com/api/worldbank-api/openapi.json
