# World Bank Global Economic Indicators & Macro Trends Scraper (`slavako/world-bank-economic-indicators`) Actor

Extract official World Bank macroeconomic data: GDP, GDP growth, inflation, population, unemployment, and trade indicators across 200+ countries.

- **URL**: https://apify.com/slavako/world-bank-economic-indicators.md
- **Developed by:** [Sviatoslav](https://apify.com/slavako) (community)
- **Categories:** Business, Developer tools, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 country economic records

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## World Bank Global Economic Indicators & Macro Trends Scraper

Extract official macroeconomic indicators and historical time series across 200+ countries directly from the World Bank Open Data platform with **100% zero API key requirements**.

***

### 🌟 Key Features

- **200+ Countries & Aggregates**: Query any ISO-2 or ISO-3 country code (e.g. `USA`, `DEU`, `GBR`, `JPN`, `NOR`, `CHN`, `IND`) or regional aggregates (`WLD` for World, `EUU` for European Union).
- **Core Macroeconomic Indicators**: Pre-configured support for GDP (current US$), GDP Growth (%), Inflation (CPI %), Population, Unemployment Rate (%), Foreign Direct Investment (FDI), and Central Government Debt (% of GDP).
- **Custom Indicators**: Pass any valid World Bank indicator code from their catalog of 16,000+ indicators.
- **Historical Time Horizon**: Filter by start year and end year (from 1960 up to current year).
- **Rich Structured JSON**: Outputs cleanly organized per-country documents with instant latest-year snapshots and full historical annual data arrays.
- **Pay-Per-Event Ultra-Low Pricing**: 128 MB RAM execution, zero proxy overhead, high reliability.

***

### 📥 Input Configuration

| Parameter | Type | Default | Description |
|---|---|---|---|
| `countries` | Array | `["USA", "DEU", "GBR", "JPN", "NOR"]` | List of ISO country codes to scrape. |
| `indicators` | Array | Core 5 indicators | World Bank indicator codes to retrieve. |
| `startYear` | Integer | `2015` | Earliest year of data to include. |
| `endYear` | Integer | `2025` | Latest year of data to include. |

#### Example Input

```json
{
  "countries": [
    "USA",
    "DEU",
    "NOR"
  ],
  "indicators": [
    "NY.GDP.MKTP.CD",
    "FP.CPI.TOTL.ZG",
    "SL.UEM.TOTL.ZS"
  ],
  "startYear": 2018,
  "endYear": 2024
}
```

***

### 📤 Output Format

Each record in the dataset contains macroeconomic metrics for one country:

```json
{
  "countryQuery": "USA",
  "countryName": "United States",
  "countryIso3": "USA",
  "timeRange": "2018-2024",
  "latestSummary": {
    "NY.GDP.MKTP.CD": {
      "indicatorName": "GDP (current US$)",
      "latestYear": 2024,
      "latestValue": 28781083000000
    },
    "FP.CPI.TOTL.ZG": {
      "indicatorName": "Inflation, consumer prices (annual %)",
      "latestYear": 2024,
      "latestValue": 2.95
    }
  },
  "indicators": {
    "NY.GDP.MKTP.CD": {
      "indicatorId": "NY.GDP.MKTP.CD",
      "indicatorName": "GDP (current US$)",
      "series": [
        { "year": 2024, "value": 28781083000000 },
        { "year": 2023, "value": 27360935000000 }
      ]
    }
  },
  "scrapedAt": "2026-11-22T06:08:00.000Z",
  "dataSource": "World Bank Open Data API (CC BY 4.0)"
}
```

***

### 💡 Use Cases

- **Financial Analytics & Hedge Funds**: Automate macroeconomic risk modeling and sovereign analysis.
- **Academic & Policy Research**: Ingest verified multi-decade economic series for cross-country econometric analysis.
- **Market Expansion Planning**: Benchmark consumer inflation, GDP growth, and labor force dynamics before launching into new markets.

# Actor input Schema

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

List of country codes to scrape (e.g. USA, GBR, DEU, JPN, NOR, IND). Use 'WLD' for World aggregate.

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

List of World Bank indicator IDs to fetch (e.g. NY.GDP.MKTP.CD for GDP, FP.CPI.TOTL.ZG for Inflation, SP.POP.TOTL for Population, SL.UEM.TOTL.ZS for Unemployment).

## `startYear` (type: `integer`):

Earliest year of data to retrieve (e.g. 2015).

## `endYear` (type: `integer`):

Latest year of data to retrieve (e.g. 2025).

## Actor input object example

```json
{
  "countries": [
    "USA",
    "DEU",
    "GBR",
    "JPN",
    "NOR"
  ],
  "indicators": [
    "NY.GDP.MKTP.CD",
    "NY.GDP.MKTP.KD.ZG",
    "FP.CPI.TOTL.ZG",
    "SP.POP.TOTL",
    "SL.UEM.TOTL.ZS"
  ],
  "startYear": 2015,
  "endYear": 2025
}
```

# Actor output Schema

## `dataset` (type: `string`):

Macroeconomic indicator time series, GDP, inflation, population, and unemployment data by country.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("slavako/world-bank-economic-indicators").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 = {}

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

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

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

```

## CLI example

```bash
echo '{}' |
apify call slavako/world-bank-economic-indicators --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,slavako/world-bank-economic-indicators"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/9Q4QCK6MhHrV5V6oF/builds/M9QiL2OmuF18cf3qZ/openapi.json
