# World Bank Data Normalizer (`wakey7dev/world-bank-normalizer`) Actor

Fetch, normalize, and enrich World Bank development indicators — 29,500+ indicators across 295 countries with standardized names and formatted values. Perfect for economic research and data pipelines.

- **URL**: https://apify.com/wakey7dev/world-bank-normalizer.md
- **Developed by:** [Chris Wakefield](https://apify.com/wakey7dev) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

![Chris The Dev](https://raw.githubusercontent.com/chriswakefield87/appstore-screenshot-translator/main/assets/actor-banner.png)

## 🌍 World Bank Data Normalizer

Fetch, normalize, and enrich World Bank development indicators — 29,500+ indicators across 295 countries and regions.

This Actor queries the **World Bank API** (free, no key required) and returns **cleaned, normalized data** with standardized country names, indicator short names, and formatted values. Perfect for economic research, market analysis, and data pipelines.

### ✨ What Makes This Different

Unlike raw API scrapers, this Actor **normalizes and enriches** the data:

- **🇺🇳 Country name normalization** — "Russian Federation" → "Russia", "Korea, Rep." → "South Korea", "Iran, Islamic Rep." → "Iran"
- **📊 Indicator short names** — "NY.GDP.MKTP.CD" → "GDP (current USD)"
- **🏷️ Aggregate filtering** — Automatically skips regional/income aggregates (World, High income, etc.) when querying real countries
- **🔢 Smart value formatting** — 1,234,567,890 → "1.23B"
- **📋 Metadata enrichment** — Fetches indicator names, sources, and definitions from the World Bank API

### 📋 Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `indicators` | Array | ✅ Yes | World Bank indicator codes. See [all 29,544 indicators](https://api.worldbank.org/v2/indicator) |
| `countries` | Array | ✅ Yes | ISO country codes (US, GB, CN) or `"all"` for every country |
| `dateRange` | String | No | Year range as `start:end` (e.g. `2020:2023`). Empty = all available years |
| `maxResults` | Integer | No | Max data points per indicator (default: 500). 0 = unlimited |
| `enrichMetadata` | Boolean | No | Fetch indicator definitions from API (default: true) |

### 🚀 Popular Indicator Codes

| Code | Name |
|------|------|
| `NY.GDP.MKTP.CD` | GDP (current USD) |
| `NY.GDP.MKTP.KD.ZG` | GDP Growth (annual %) |
| `NY.GDP.PCAP.CD` | GDP per capita (current USD) |
| `SP.POP.TOTL` | Population, total |
| `FP.CPI.TOTL.ZG` | Inflation, CPI (annual %) |
| `SL.UEM.TOTL.ZS` | Unemployment (% of labor force) |
| `BX.KLT.DINV.WD.GD.ZS` | Foreign Direct Investment (% of GDP) |
| `SI.POV.GINI` | Gini Index |
| `SP.DYN.LE00.IN` | Life Expectancy (years) |
| `IT.NET.USER.ZS` | Internet Users (% of population) |
| `SH.XPD.CHEX.GD.ZS` | Health Expenditure (% of GDP) |
| `EN.ATM.CO2E.KT` | CO2 Emissions (kt) |
| `SE.XPD.TOTL.GD.ZS` | Education Expenditure (% of GDP) |
| `GC.DOD.TOTL.GD.ZS` | Government Debt (% of GDP) |

### 📥 Example Input

```json
{
  "indicators": ["NY.GDP.MKTP.CD", "SP.POP.TOTL", "FP.CPI.TOTL.ZG"],
  "countries": ["US", "GB", "CN", "DE", "JP", "IN", "BR"],
  "dateRange": "2020:2023",
  "maxResults": 500,
  "enrichMetadata": true
}
````

### 📤 Example Output (Dataset)

```json
{
  "countryName": "United States",
  "countryCode": "USA",
  "indicatorCode": "NY.GDP.MKTP.CD",
  "indicatorName": "GDP (current USD)",
  "indicatorFullName": "GDP (current US$)",
  "year": 2023,
  "value": 27360900000000,
  "formattedValue": "27.36T"
}
```

### 🎯 Use Cases

- **Economic Research** — Compare GDP, inflation, unemployment across countries
- **Market Analysis** — Identify emerging markets by growth indicators
- **Investment Research** — Track FDI, trade balances, government debt
- **Academic Work** — Pull clean time series for papers and dissertations
- **Dashboard Pipelines** — Feed normalized World Bank data into BI tools
- **AI/ML Training** — Clean, structured development data for models

### 📊 Output

| Key | Description |
|-----|------------|
| **Dataset** | All normalized data points (countryName, indicatorName, year, value, formattedValue) |
| **OUTPUT** | Human-readable summary table with top 50 rows |
| **STATS** | Machine-readable statistics (counts, year range, unique countries/indicators) |

### 📚 Data Source

Data sourced from the [World Bank API](https://data.worldbank.org/) (free, no registration required). Licensed under [Creative Commons Attribution 4.0 (CC-BY 4.0)](https://datacatalog.worldbank.org/public-licenses#cc-by).

# Actor input Schema

## `indicators` (type: `array`):

World Bank indicator codes. Common: NY.GDP.MKTP.CD (GDP), SP.POP.TOTL (Population), FP.CPI.TOTL (Inflation), SL.UEM.TOTL.ZS (Unemployment). Get all codes from https://api.worldbank.org/v2/indicator

## `countries` (type: `array`):

ISO 3166-1 alpha-2 or alpha-3 country codes. Use 'all' for all countries. Examples: US, GB, DE, CN, IN, BR, JP, FR.

## `dateRange` (type: `string`):

Year range as 'start:end' (e.g., '2020:2023'). Leave empty for all available years.

## `maxResults` (type: `integer`):

Maximum number of data points to return (applied per indicator). Set 0 for unlimited.

## `enrichMetadata` (type: `boolean`):

Fetch indicator names and definitions from the World Bank API. Speeds up runs when disabled.

## Actor input object example

```json
{
  "indicators": [
    "NY.GDP.MKTP.CD",
    "SP.POP.TOTL",
    "FP.CPI.TOTL.ZG"
  ],
  "countries": [
    "US",
    "GB",
    "CN",
    "DE",
    "JP"
  ],
  "dateRange": "2020:2023",
  "maxResults": 500,
  "enrichMetadata": true
}
```

# Actor output Schema

## `results` (type: `string`):

All normalized data points with country and indicator metadata.

## `summary` (type: `string`):

Human-readable summary table of results.

## `stats` (type: `string`):

Machine-readable statistics for this run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "indicators": [
        "NY.GDP.MKTP.CD",
        "SP.POP.TOTL",
        "FP.CPI.TOTL.ZG"
    ],
    "countries": [
        "US",
        "GB",
        "CN",
        "DE",
        "JP"
    ],
    "dateRange": "2020:2023",
    "maxResults": 500
};

// Run the Actor and wait for it to finish
const run = await client.actor("wakey7dev/world-bank-normalizer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "indicators": [
        "NY.GDP.MKTP.CD",
        "SP.POP.TOTL",
        "FP.CPI.TOTL.ZG",
    ],
    "countries": [
        "US",
        "GB",
        "CN",
        "DE",
        "JP",
    ],
    "dateRange": "2020:2023",
    "maxResults": 500,
}

# Run the Actor and wait for it to finish
run = client.actor("wakey7dev/world-bank-normalizer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "indicators": [
    "NY.GDP.MKTP.CD",
    "SP.POP.TOTL",
    "FP.CPI.TOTL.ZG"
  ],
  "countries": [
    "US",
    "GB",
    "CN",
    "DE",
    "JP"
  ],
  "dateRange": "2020:2023",
  "maxResults": 500
}' |
apify call wakey7dev/world-bank-normalizer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=wakey7dev/world-bank-normalizer",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "World Bank Data Normalizer",
        "description": "Fetch, normalize, and enrich World Bank development indicators — 29,500+ indicators across 295 countries with standardized names and formatted values. Perfect for economic research and data pipelines.",
        "version": "1.0",
        "x-build-id": "TnXkTLd3p7zG2S9pJ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/wakey7dev~world-bank-normalizer/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-wakey7dev-world-bank-normalizer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/wakey7dev~world-bank-normalizer/runs": {
            "post": {
                "operationId": "runs-sync-wakey7dev-world-bank-normalizer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/wakey7dev~world-bank-normalizer/run-sync": {
            "post": {
                "operationId": "run-sync-wakey7dev-world-bank-normalizer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "indicators",
                    "countries"
                ],
                "properties": {
                    "indicators": {
                        "title": "Indicator Codes",
                        "type": "array",
                        "description": "World Bank indicator codes. Common: NY.GDP.MKTP.CD (GDP), SP.POP.TOTL (Population), FP.CPI.TOTL (Inflation), SL.UEM.TOTL.ZS (Unemployment). Get all codes from https://api.worldbank.org/v2/indicator",
                        "items": {
                            "type": "string"
                        }
                    },
                    "countries": {
                        "title": "Country Codes",
                        "type": "array",
                        "description": "ISO 3166-1 alpha-2 or alpha-3 country codes. Use 'all' for all countries. Examples: US, GB, DE, CN, IN, BR, JP, FR.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "dateRange": {
                        "title": "Date Range",
                        "type": "string",
                        "description": "Year range as 'start:end' (e.g., '2020:2023'). Leave empty for all available years."
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "type": "integer",
                        "description": "Maximum number of data points to return (applied per indicator). Set 0 for unlimited.",
                        "default": 500
                    },
                    "enrichMetadata": {
                        "title": "Enrich with Metadata",
                        "type": "boolean",
                        "description": "Fetch indicator names and definitions from the World Bank API. Speeds up runs when disabled.",
                        "default": true
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
