# World Bank — GDP & Economic Indicators (`moving_beacon-owner1/my-actor-86`) Actor

This tool extracts Gross Domestic Product (GDP) data along with over 30 additional economic indicators directly from the World Bank Open Data API version 2. It operates without the need for an API key, making it accessible and easy to use for anyone interested in economic analysis.

- **URL**: https://apify.com/moving\_beacon-owner1/my-actor-86.md
- **Developed by:** [Jamshaid Arif](https://apify.com/moving_beacon-owner1) (community)
- **Categories:** Developer tools, Other
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

## 🏦 World Bank — GDP & Economic Indicators — Apify Actor

Scrapes **GDP and 30+ economic indicators** from the [World Bank Open Data API v2](https://datahelpdesk.worldbank.org/knowledgebase/articles/898581). No API key required.

### Features

- **32 built-in indicators** — GDP, GNI, inflation, unemployment, trade, debt, population, CO2, internet penetration, poverty, GINI, and more.
- **Flexible country selection** — specific ISO codes, entire World Bank regions, or income-level groups.
- **Date ranges** — any span from 1960 to present.
- **3 output shapes** — long (tidy), wide-by-year, or wide-by-indicator.
- **Auto-pagination** — fetches all pages from the World Bank API automatically.
- **Human-readable formatting** — values are formatted (e.g. `$21.43T`, `6.12%`) alongside raw numbers.

### Input Example

```json
{
    "indicators": ["NY.GDP.MKTP.CD", "NY.GDP.MKTP.KD.ZG", "FP.CPI.TOTL.ZG"],
    "countries": "US;CN;IN;DE;JP;PK",
    "dateRange": "2010:2023",
    "regionFilter": "none",
    "incomeLevelFilter": "none",
    "skipEmptyValues": true,
    "sortBy": "year_desc",
    "outputFormat": "long",
    "maxResults": 0
}
````

### Available Indicators

| Code | Indicator |
|---|---|
| `NY.GDP.MKTP.CD` | GDP (current US$) |
| `NY.GDP.MKTP.KD.ZG` | GDP Growth (annual %) |
| `NY.GDP.PCAP.CD` | GDP Per Capita (current US$) |
| `NY.GDP.PCAP.PP.CD` | GDP Per Capita, PPP |
| `FP.CPI.TOTL.ZG` | Inflation, CPI (annual %) |
| `SL.UEM.TOTL.ZS` | Unemployment (% — ILO) |
| `NE.EXP.GNFS.ZS` | Exports (% of GDP) |
| `NE.IMP.GNFS.ZS` | Imports (% of GDP) |
| `GC.DOD.TOTL.GD.ZS` | Central Govt Debt (% of GDP) |
| `BX.KLT.DINV.CD.WD` | FDI Net Inflows (US$) |
| `PA.NUS.FCRF` | Exchange Rate (LCU per US$) |
| `SP.POP.TOTL` | Population, Total |
| `SP.DYN.LE00.IN` | Life Expectancy (years) |
| `EN.ATM.CO2E.KT` | CO2 Emissions (kt) |
| `IT.NET.USER.ZS` | Internet Users (%) |
| `SI.POV.GINI` | GINI Index |
| ... | *32 indicators total — see input UI* |

### Output Fields (Long Format)

| Field | Description |
|---|---|
| `indicator_id` | World Bank indicator code |
| `indicator_name` | Human-readable indicator name |
| `country_code` | ISO 3166-1 alpha-3 code |
| `country_code_2` | ISO alpha-2 code |
| `country_name` | Full country name |
| `year` | Data year |
| `value` | Raw numeric value |
| `value_formatted` | Formatted string (e.g. `$21.43T`, `3.20%`) |
| `unit` | Unit of measurement |
| `scale` | Scale factor |
| `source_id` | World Bank source ID |
| `source_name` | Data source name |

### Output Shapes

#### Long (default)

One row per country × year × indicator. Best for databases, charts, and further processing.

#### Wide by Year

One row per country × indicator with year columns (`y2020`, `y2021`, `y2022`…). Good for spreadsheet comparison across time.

#### Wide by Indicator

One row per country × year with indicator columns. Good for comparing multiple indicators side-by-side.

### Region & Income Filters

**Regions:** East Asia & Pacific, Europe & Central Asia, Latin America & Caribbean, Middle East & North Africa, North America, South Asia, Sub-Saharan Africa.

**Income Levels:** High Income, Upper Middle Income, Lower Middle Income, Low Income.

When a region or income filter is set, it overrides the country list.

### Data Source

All data from the World Bank Open Data API:
`https://api.worldbank.org/v2/`

No API key required. Data spans 1960–present for most indicators.

# Actor input Schema

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

Select one or more World Bank indicators to fetch.

## `countries` (type: `string`):

Comma-separated ISO 3166-1 alpha-2 or alpha-3 country codes (e.g. US,CN,IN,DE,PK). Use 'all' for all countries.

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

Year range in YYYY:YYYY format (e.g. 2000:2023). Use a single year like 2023 for one year only.

## `regionFilter` (type: `string`):

Optionally limit to a World Bank region (overrides country list if set).

## `incomeLevelFilter` (type: `string`):

Optionally filter countries by World Bank income classification.

## `skipEmptyValues` (type: `boolean`):

If checked, rows where the indicator value is null/missing are excluded.

## `sortBy` (type: `string`):

How to sort the output records.

## `outputFormat` (type: `string`):

How to structure the dataset rows.

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

Limit the number of records saved. 0 = no limit.

## Actor input object example

```json
{
  "indicators": [
    "NY.GDP.MKTP.CD"
  ],
  "countries": "US;CN;IN;DE;JP;GB;FR;BR;PK",
  "dateRange": "2015:2023",
  "regionFilter": "none",
  "incomeLevelFilter": "none",
  "skipEmptyValues": true,
  "sortBy": "year_desc",
  "outputFormat": "long",
  "maxResults": 0
}
```

# 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("moving_beacon-owner1/my-actor-86").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("moving_beacon-owner1/my-actor-86").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 '{}' |
apify call moving_beacon-owner1/my-actor-86 --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=moving_beacon-owner1/my-actor-86",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "World Bank — GDP & Economic Indicators",
        "description": "This tool extracts Gross Domestic Product (GDP) data along with over 30 additional economic indicators directly from the World Bank Open Data API version 2. It operates without the need for an API key, making it accessible and easy to use for anyone interested in economic analysis.",
        "version": "0.0",
        "x-build-id": "B4vrc66GbWyb6357Q"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/moving_beacon-owner1~my-actor-86/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-moving_beacon-owner1-my-actor-86",
                "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/moving_beacon-owner1~my-actor-86/runs": {
            "post": {
                "operationId": "runs-sync-moving_beacon-owner1-my-actor-86",
                "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/moving_beacon-owner1~my-actor-86/run-sync": {
            "post": {
                "operationId": "run-sync-moving_beacon-owner1-my-actor-86",
                "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",
                    "dateRange"
                ],
                "properties": {
                    "indicators": {
                        "title": "Economic Indicators",
                        "type": "array",
                        "description": "Select one or more World Bank indicators to fetch.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "NY.GDP.MKTP.CD",
                                "NY.GDP.MKTP.KD.ZG",
                                "NY.GDP.PCAP.CD",
                                "NY.GDP.PCAP.PP.CD",
                                "NY.GNP.MKTP.CD",
                                "NY.GNP.PCAP.CD",
                                "FP.CPI.TOTL.ZG",
                                "SL.UEM.TOTL.ZS",
                                "SL.UEM.TOTL.NE.ZS",
                                "NE.EXP.GNFS.ZS",
                                "NE.IMP.GNFS.ZS",
                                "BN.CAB.XOKA.CD",
                                "GC.DOD.TOTL.GD.ZS",
                                "GC.REV.XGRT.GD.ZS",
                                "GC.XPN.TOTL.GD.ZS",
                                "BX.KLT.DINV.CD.WD",
                                "DT.DOD.DECT.CD",
                                "PA.NUS.FCRF",
                                "FI.RES.TOTL.CD",
                                "BX.TRF.PWKR.CD.DT",
                                "SP.POP.TOTL",
                                "SP.POP.GROW",
                                "SP.DYN.LE00.IN",
                                "SE.ADT.LITR.ZS",
                                "SP.DYN.TFRT.IN",
                                "EN.ATM.CO2E.KT",
                                "EG.USE.ELEC.KH.PC",
                                "IT.NET.USER.ZS",
                                "IT.CEL.SETS.P2",
                                "SI.POV.DDAY",
                                "SI.DST.FRST.20",
                                "SI.POV.GINI"
                            ],
                            "enumTitles": [
                                "GDP (current US$)",
                                "GDP Growth (annual %)",
                                "GDP Per Capita (current US$)",
                                "GDP Per Capita, PPP (current intl $)",
                                "GNI (current US$)",
                                "GNI Per Capita (current US$)",
                                "Inflation, CPI (annual %)",
                                "Unemployment (% of total labor — ILO)",
                                "Unemployment (% of total labor — national)",
                                "Exports of Goods & Services (% of GDP)",
                                "Imports of Goods & Services (% of GDP)",
                                "Current Account Balance (US$)",
                                "Central Govt Debt (% of GDP)",
                                "Government Revenue (% of GDP)",
                                "Government Expenditure (% of GDP)",
                                "Foreign Direct Investment, net inflows (US$)",
                                "External Debt (current US$)",
                                "Official Exchange Rate (LCU per US$)",
                                "Total Reserves incl. Gold (US$)",
                                "Personal Remittances Received (US$)",
                                "Population, Total",
                                "Population Growth (annual %)",
                                "Life Expectancy at Birth (years)",
                                "Adult Literacy Rate (%)",
                                "Fertility Rate (births per woman)",
                                "CO2 Emissions (kt)",
                                "Electric Power Consumption (kWh per capita)",
                                "Internet Users (% of population)",
                                "Mobile Subscriptions (per 100 people)",
                                "Poverty Headcount at $2.15/day (%)",
                                "Income Share — Lowest 20%",
                                "GINI Index"
                            ]
                        },
                        "default": [
                            "NY.GDP.MKTP.CD"
                        ]
                    },
                    "countries": {
                        "title": "Countries (ISO codes)",
                        "type": "string",
                        "description": "Comma-separated ISO 3166-1 alpha-2 or alpha-3 country codes (e.g. US,CN,IN,DE,PK). Use 'all' for all countries.",
                        "default": "US;CN;IN;DE;JP;GB;FR;BR;PK"
                    },
                    "dateRange": {
                        "title": "Date Range (Years)",
                        "type": "string",
                        "description": "Year range in YYYY:YYYY format (e.g. 2000:2023). Use a single year like 2023 for one year only.",
                        "default": "2015:2023"
                    },
                    "regionFilter": {
                        "title": "Region Filter",
                        "enum": [
                            "none",
                            "EAS",
                            "ECS",
                            "LCN",
                            "MEA",
                            "NAC",
                            "SAS",
                            "SSF"
                        ],
                        "type": "string",
                        "description": "Optionally limit to a World Bank region (overrides country list if set).",
                        "default": "none"
                    },
                    "incomeLevelFilter": {
                        "title": "Income Level Filter",
                        "enum": [
                            "none",
                            "HIC",
                            "UMC",
                            "LMC",
                            "LIC"
                        ],
                        "type": "string",
                        "description": "Optionally filter countries by World Bank income classification.",
                        "default": "none"
                    },
                    "skipEmptyValues": {
                        "title": "Skip Empty Values",
                        "type": "boolean",
                        "description": "If checked, rows where the indicator value is null/missing are excluded.",
                        "default": true
                    },
                    "sortBy": {
                        "title": "Sort By",
                        "enum": [
                            "year_desc",
                            "year_asc",
                            "country_asc",
                            "value_desc",
                            "value_asc"
                        ],
                        "type": "string",
                        "description": "How to sort the output records.",
                        "default": "year_desc"
                    },
                    "outputFormat": {
                        "title": "Output Shape",
                        "enum": [
                            "long",
                            "wide_by_year",
                            "wide_by_indicator"
                        ],
                        "type": "string",
                        "description": "How to structure the dataset rows.",
                        "default": "long"
                    },
                    "maxResults": {
                        "title": "Maximum Results",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Limit the number of records saved. 0 = no limit.",
                        "default": 0
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
