# World Bank Data Scraper: Economic Indicators (`glitchbound/worldbank-scraper`) Actor

Pull World Bank development indicators as a flat table: GDP, GDP per capita, growth, inflation, unemployment, population, life expectancy, debt, FDI and any other indicator code. Any set of countries, any year range. Free official API, no key.

- **URL**: https://apify.com/glitchbound/worldbank-scraper.md
- **Developed by:** [Daniel Meshulam](https://apify.com/glitchbound) (community)
- **Categories:** Automation, News, SEO tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 observations

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Data Scraper: Economic Indicators

World Bank development indicators as a flat table you can pivot, not nested JSON
you have to unpack.

```json
{
  "indicators": ["NY.GDP.MKTP.CD", "FP.CPI.TOTL.ZG"],
  "countries": ["IL", "US", "DE"],
  "dateRange": "2015:2024"
}
```

One row per **country × indicator × year**. No API key.

### The two things that break naive World Bank clients

**The response is a two-element envelope.** Every World Bank reply is
`[metadata, rows]`, not a list of rows. Code that treats it as a plain array
either crashes or silently reads the pagination metadata as if it were data. An
error comes back as a *one*-element list holding a message, which is why that
case is checked rather than assumed.

**Most cells are genuinely empty.** Ask for 200 countries × 3 indicators × 20
years and the World Bank returns 12,000 rows, of which a large share have
`value: null`, that country simply never reported that number. Emitting those
would bill you for the absence of data. They are dropped by default, and
`skipEmptyValues: false` is there when you need the complete grid including gaps.

### Indicators

Fourteen of the most-requested ones are a dropdown, GDP, GDP per capita, GDP
growth, inflation, unemployment, population, life expectancy, education and
health spending, CO2 per capita, internet penetration, FDI, exports, government
debt.

Anything else goes in `customIndicators` as a code, e.g. `SI.POV.GINI`. The full
catalogue is at [data.worldbank.org/indicator](https://data.worldbank.org/indicator).

### Countries

ISO 2- or 3-letter codes. Leave `countries` empty to get every country **plus**
the World Bank's regional and income-group aggregates (`WLD`, `EUU`, `OED`,
`LIC`…), which is usually what you want for a benchmark chart.

Country and indicator codes are semicolon-joined into a single request, so a
200-country × 3-indicator pull is a handful of calls, not 600.

### Use cases

- **Macro dashboards**: one call feeds a whole country comparison
- **Market sizing**: GDP per capita and population, filtered to your target markets
- **Investment research**: inflation, debt and FDI series without a Bloomberg terminal
- **Academic work**: reproducible, citable, with the World Bank's own `lastUpdated` stamp on every row
- **Risk models**: sovereign indicators as a scheduled feed

### Pricing

Charged per observation returned. An unknown indicator code or a request the
World Bank has no data for produces an `error` row and costs **$0.00**.

### Do you need an API key? No. Is there a free tier? Yes.

The two things people search for in this category, measured, are **free** and
**API key**: `world bank api key`.

So, plainly:

- **No API key.** Nothing to register for, nothing to rotate, no key to leak in
  a repo. The source is a public API published deliberately by its owner.
- **No proxy setup.** The source does not bot-wall datacenter addresses, so the
  default works.
- **Pay per result, not per month.** There is no subscription and no minimum.
  Rows that error or that your filters drop are **not charged**.
- **Free to try.** Run it with the prefilled input and see real rows before
  deciding anything.

### Notes

- Values are exactly as the World Bank publishes them, no interpolation, no filling forward. A gap in the data is reported as a gap.
- `lastUpdated` is the World Bank's own database refresh date, carried on every row so you can tell how current a series is.
- Data is licensed CC BY 4.0 by the World Bank; attribution is your responsibility when republishing.

### FAQ

#### Do I need a World Bank API key?

No. The World Bank's indicator API is open and key-free, and there is no quota to
manage.

#### Where do I find indicator codes?

Fourteen of the most-requested indicators are a dropdown. Anything else goes in
`customIndicators` as its code, such as `SI.POV.GINI` for the Gini index.
The full catalogue is at
[data.worldbank.org/indicator](https://data.worldbank.org/indicator).

#### Why are some country-year values missing?

Because the country never reported that figure. The World Bank publishes those
cells as null, and they are dropped by default so you are not billed for absence
of data. Set `skipEmptyValues: false` when you want the complete grid including
the gaps, for example when you need to show coverage rather than values.

#### Can I get regions and income groups, not just countries?

Yes. Leave `countries` empty and you get every country plus the World Bank's own
aggregates: `WLD` for world, `EUU` for the EU, `OED` for the OECD, `LIC` for low
income. Those are usually what a benchmark chart actually needs.

#### How current is the data?

Every row carries `lastUpdated`, the World Bank's own database refresh date, so
you can tell how stale a series is without guessing. Indicators update on
different schedules, and annual national accounts lag by roughly a year.

#### Can I use this in a published paper or product?

The data is licensed CC BY 4.0 by the World Bank. Attribution is your
responsibility when republishing.

# Actor input Schema

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

Pick the World Bank indicators to pull. Each one returns a value per country per year.

## `customIndicators` (type: `array`):

Any World Bank indicator code not in the list above, e.g. SI.POV.GINI. Codes are listed at data.worldbank.org/indicator.

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

ISO codes, 2 or 3 letter, e.g. IL, US, DEU. Leave empty for every country plus the World Bank's regional and income aggregates.

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

A single year or a range: 2023 or 2010:2024. Leave empty for the full history the World Bank holds.

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

Most country/indicator/year cells are genuinely empty. On by default so you are not charged for rows that carry no value. Turn it off if you need a complete grid including the gaps.

## `maxRows` (type: `integer`):

Cap for the whole run. The form is prefilled with 50 so a first run costs cents; the cap when this field is left out entirely is 5000.

## `proxyConfiguration` (type: `object`):

Proxy settings.

## `maxItems` (type: `integer`):

A hard ceiling on rows for the entire run, across every target. The per-target limits above cap each one separately, so fifty targets at twenty each is still a thousand rows; this caps the total. The run stops cleanly when it is reached and nothing beyond that point is fetched or charged. Leave empty for no ceiling.

## Actor input object example

```json
{
  "indicators": [
    "NY.GDP.MKTP.CD"
  ],
  "countries": [
    "IL",
    "US"
  ],
  "dateRange": "2015:2024",
  "skipEmptyValues": true,
  "maxRows": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Country, indicator, year and value, flat and ready to pivot.

# 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"
    ],
    "countries": [
        "IL",
        "US"
    ],
    "dateRange": "2015:2024",
    "maxRows": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("glitchbound/worldbank-scraper").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"],
    "countries": [
        "IL",
        "US",
    ],
    "dateRange": "2015:2024",
    "maxRows": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("glitchbound/worldbank-scraper").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"
  ],
  "countries": [
    "IL",
    "US"
  ],
  "dateRange": "2015:2024",
  "maxRows": 50
}' |
apify call glitchbound/worldbank-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/wPKzshiCREGoB7Cyt/builds/UlnXcldRGQxhPJapg/openapi.json
