# 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
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 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/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 — 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(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 moving_beacon-owner1/my-actor-86 --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,moving_beacon-owner1/my-actor-86"
        }
    }
}
```

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/njmgPZFehYYbDXoTQ/builds/txRm4dnawQQzVUOMM/openapi.json
