# World Bank Indicators Scraper (`solidcode/world-bank-indicators-scraper`) Actor

\[💰 $1.6 / 1K] Extract World Bank Open Data statistics — GDP, population, inflation, health, education, climate and 29,000+ more indicators — for 200+ countries from 1960 to today. Search indicators by name or code, pick countries, regions or income groups, set any year range.

- **URL**: https://apify.com/solidcode/world-bank-indicators-scraper.md
- **Developed by:** [SolidCode](https://apify.com/solidcode) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 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.
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.

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

## World Bank Indicators Scraper

Pull development statistics from World Bank Open Data at scale — GDP, population, inflation, life expectancy, school enrolment, CO2 emissions, trade, poverty, energy and 29,000 more indicators, for all 295 countries and regional groupings the World Bank tracks, with history back to 1960 and projections out to 2050. Every figure arrives with its official definition, unit, source database and country classification attached. Built for economists, data journalists, NGO analysts, and dashboard teams who need a clean, ready-to-chart panel dataset without hand-assembling one indicator page at a time.

### Why This Scraper?

- **All 29,544 World Bank indicators, searchable by name — plus a one-click picklist of 11 headline statistics** — type "life expectancy", "CO2 emissions" or "unemployment female" and every match is pulled in, or simply choose GDP, GDP per capita, population, inflation, life expectancy, unemployment, CO2 emissions, under-5 mortality, internet users, education spending or poverty headcount from the dropdown. You never need to know an indicator code.
- **21 subject areas to browse** — Economy & Growth, Health, Education, Climate Change, Poverty, Gender, Energy & Mining, Trade, External Debt and 12 more, so you can explore a whole field instead of guessing codes.
- **Many indicators in one run** — put GDP, population and inflation side by side in a single dataset. No separate runs, no manual join in a spreadsheet afterwards.
- **Whole regions and income groups in one click** — 7 World Bank regions (East Asia & Pacific, Sub-Saharan Africa, and 5 more) and 6 income groups (High income through Low income) expand automatically into their member countries.
- **Aggregates kept separate from countries** — "World", "Euro area" and "High income" are 78 of the 295 entities the World Bank publishes. Every row carries an `isAggregate` flag and aggregates are excluded by default, so your cross-country averages are not silently corrupted.
- **Official definitions and units on every row** — the World Bank's own methodology note, unit of measurement, source database and originating organisation (UN Population Division, IEA, WHO and others) ship alongside each figure.
- **Country context built in** — region, income group, capital city, and latitude/longitude of the capital, ready for grouping and mapping without a second lookup table.
- **Two output layouts** — a flat row per country/indicator/year for pivoting and charting, or one compact row per time series with a year-to-value map, `firstYear`, `lastYear`, `latestValue` and `observationCount`. The compact layout returns the same history in roughly 1/60th of the rows.
- **History back to 1960, projections to 2050, and no 10,000-row ceiling** — up to 500,000 rows in a single run (34,980 rows verified in one pull).

### Use Cases

**Economic Research & Forecasting**
- Build multi-country GDP, inflation and trade panels for regression models
- Compare growth trajectories across income groups over 60 years
- Track debt, reserves and current account balances for sovereign risk work
- Assemble baseline series for macroeconomic forecasting

**Development & NGO Analysis**
- Monitor poverty headcount, child mortality and school enrolment by region
- Benchmark a programme country against its income group peers
- Track progress on health, water and sanitation indicators year by year
- Build grant and impact reports with citable official definitions attached

**Climate & Energy Reporting**
- Pull CO2 emissions, renewable energy share and energy use per capita
- Compare emissions intensity across the 7 World Bank regions
- Chart the energy transition for a country group over three decades
- Combine climate indicators with GDP for intensity ratios

**Data Journalism & Visualisation**
- Produce ready-to-chart country league tables with `latestValueOnly`
- Map any indicator using the built-in capital-city coordinates
- Fact-check claims against the official source and revision date
- Feed choropleth maps and interactive explainers with fresh figures

**Dashboards & Data Pipelines**
- Refresh a business intelligence dashboard with current country statistics
- Enrich an internal country database with region and income classifications
- Power market-sizing tools with population and income data
- Schedule recurring pulls so your warehouse always holds the latest vintage

### Getting Started

#### Just Two Indicators for Five Countries

```json
{
    "indicatorCodes": ["NY.GDP.MKTP.CD", "SP.POP.TOTL"],
    "countries": ["US", "CN", "DE", "JP", "GB"],
    "yearFrom": 2000
}
````

#### Find Indicators by Name

Don't know the code? Describe the indicator instead:

```json
{
    "indicatorSearch": "life expectancy",
    "maxIndicators": 3,
    "countries": ["BR", "IN", "NG", "ZA"],
    "yearFrom": 1990,
    "yearTo": 2024
}
```

#### A Whole Region, Latest Value Only

Perfect for a country league table or a map:

```json
{
    "indicatorCodes": ["SP.DYN.LE00.IN"],
    "region": "SSF",
    "latestValueOnly": true,
    "maxResults": 100
}
```

#### Browse a Subject Area

```json
{
    "topic": "19",
    "indicatorSearch": "CO2 emissions",
    "maxIndicators": 4,
    "incomeLevel": "HIC",
    "yearFrom": 2010,
    "maxResults": 2000
}
```

#### Full-History Time Series, Compact Layout

```json
{
    "indicatorCodes": ["NY.GDP.MKTP.CD", "SP.POP.TOTL", "FP.CPI.TOTL.ZG"],
    "countries": ["all"],
    "includeAggregates": false,
    "outputFormat": "series",
    "skipEmptyValues": true,
    "includeIndicatorDetails": true,
    "includeCountryDetails": true,
    "maxResults": 5000
}
```

### Input Reference

#### Which Indicators?

Pick the statistics you want. Enter exact codes, search by name, or browse a subject area — you can combine all three.

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `indicatorCodes` | string\[] | `["NY.GDP.MKTP.CD", "SP.POP.TOTL"]` | The exact World Bank indicator codes you want, for example `NY.GDP.MKTP.CD` (GDP in current US$) or `SP.POP.TOTL` (total population). Leave empty and use the search box instead if you don't know the codes. |
| `commonIndicator` | select | `No pick — use the codes and search above` | One-click picklist of headline statistics, added to whatever is in `indicatorCodes`: No pick — use the codes and search above, GDP (current US$), GDP per capita (current US$), Population, total, Inflation, consumer prices (annual %), Life expectancy at birth (years), Unemployment rate (% of labour force), CO2 emissions, total (Mt CO2e), Under-5 mortality rate (per 1,000 live births), Individuals using the Internet (% of population), Government spending on education (% of GDP), or Poverty headcount ratio (% of population). |
| `indicatorSearch` | string | `""` | Words that appear in the indicator name, such as "life expectancy", "CO2 emissions" or "unemployment female". Every matching indicator is added, up to the limit below. |
| `topic` | select | `All subject areas` | Restrict to one World Bank subject area: All subject areas, Economy & Growth, Health, Education, Environment, Climate Change, Social Protection & Labor, Trade, Poverty, Gender, Energy & Mining, Financial Sector, Agriculture & Rural Development, Infrastructure, Private Sector, Public Sector, Science & Technology, Social Development, Urban Development, External Debt, Aid Effectiveness, or Millennium Development Goals. |
| `maxIndicators` | integer | `5` | Safety limit (1–100) on how many indicators the search box and subject area may add. Codes you typed yourself are always kept and do not count against this limit. |

#### Which Countries?

List countries individually, or select a whole region or income group and let the scraper fill in the members.

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `countries` | string\[] | `["US", "CN", "DE", "JP", "GB"]` | Country codes, 2-letter or 3-letter (`US` or `USA`, `DE` or `DEU`). A pasted list such as `US, CN, DE` is accepted too. Enter `all` on its own to cover every country the World Bank tracks. |
| `region` | select | `No region filter` | Add every country in one World Bank region. Options are "No region filter", "East Asia & Pacific", "Europe & Central Asia", "Latin America & Caribbean", "Middle East, North Africa, Afghanistan & Pakistan", "North America", "South Asia" and "Sub-Saharan Africa". |
| `incomeLevel` | select | `No income filter` | Add every country in one income group: No income filter, High income, Upper middle income, Middle income, Lower middle income, Low & middle income, or Low income. |
| `includeAggregates` | boolean | `false` | Also return World Bank aggregate rows such as "World", "Euro area", "Sub-Saharan Africa" and "High income". Off by default so you get individual countries only. |

#### Which Years?

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `yearFrom` | integer | `2000` | Earliest year to include (1960–2100). World Bank data generally starts in 1960, though many indicators only begin in the 1990s or 2000s. Leave blank for no lower limit. |
| `yearTo` | integer | *(blank)* | Latest year to include (1960–2100). Leave blank to run through to the most recent year published — including the World Bank's projection datasets, which already publish figures out to 2050. |
| `latestValueOnly` | boolean | `false` | Return just the single most recent reported value for each country and indicator instead of a full time series. When switched on, the year range is ignored. |

#### Output Options

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `outputFormat` | select | `One row per year (flat table)` | Choose "One row per year (flat table)" for a long, easy-to-pivot table, or "One row per time series (compact)" to pack all years for a country and indicator into a single row. |
| `skipEmptyValues` | boolean | `true` | Leave out rows where the World Bank has no figure for that country and year. Coverage is patchy for many indicators, so this usually removes a lot of blank rows. |
| `includeIndicatorDetails` | boolean | `true` | Add the official definition, unit of measurement, source organisation and subject areas for each indicator. |
| `includeCountryDetails` | boolean | `true` | Add each country's region, income group, capital city and coordinates alongside the figures. |
| `maxResults` | integer | `1000` | Stop after this many rows (0 = no limit, maximum 500,000). One indicator across every country and every year is roughly 17,000 rows, and that multiplies by the number of indicators. See the note below on how the limit behaves. |

**How `maxResults` behaves.** Because you are charged for every row that is saved, it is worth being precise about this:

- It is a **stopping point, not a hard ceiling**. Once the limit is reached no new batches are requested, but the batches already being fetched are finished and their rows are saved — so a flat-table run can return more rows than you asked for. Typically that is **5–20% more**, and in the worst case (a wide country list spread over several batches) it can reach **roughly double**. Those extra rows are charged for, so set the limit a little below your true budget.
- The **smallest batch** the World Bank serves here is **50 rows**, so a limit below 50 can still return up to 50 results.
- The compact **"One row per time series" layout is the exception** — it is trimmed to your limit exactly.
- The final run message always tells you how many rows were actually saved.

### Output

#### One Row Per Year (flat table)

```json
{
    "recordType": "observation",
    "countryCode": "DE",
    "countryName": "Germany",
    "countryIso3": "DEU",
    "isAggregate": false,
    "indicatorCode": "NY.GDP.MKTP.CD",
    "indicatorName": "GDP (current US$)",
    "year": 2023,
    "value": 4525703927389.13,
    "unit": "current US$",
    "obsStatus": "",
    "dataLastUpdated": "2026-07-13",
    "scrapedAt": "2026-07-25T09:14:02.318Z",
    "indicatorDefinition": "GDP at purchaser's prices is the sum of gross value added by all resident producers in the economy plus any product taxes and minus any subsidies not included in the value of the products.",
    "indicatorSource": "World Development Indicators",
    "indicatorSourceOrganization": "World Bank national accounts data, and OECD National Accounts data files.",
    "indicatorTopics": ["Economy & Growth"],
    "countryRegion": "Europe & Central Asia",
    "countryIncomeLevel": "High income",
    "countryCapitalCity": "Berlin",
    "countryLatitude": 52.5235,
    "countryLongitude": 13.4115
}
```

##### Core Fields

| Field | Type | Description |
|-------|------|-------------|
| `recordType` | string | `observation` for flat rows, `series` for compact rows — so mixed exports are easy to split |
| `countryCode` | string | ISO 3166-1 alpha-2 country code (`DE`) |
| `countryName` | string | Full country or aggregate name |
| `countryIso3` | string | ISO 3166-1 alpha-3 country code (`DEU`) |
| `isAggregate` | boolean | `true` for World Bank groupings such as "World" or "Euro area" |
| `indicatorCode` | string | World Bank indicator code (`NY.GDP.MKTP.CD`) |
| `indicatorName` | string | Human-readable indicator name |
| `year` | integer | Four-digit year of the observation |
| `value` | number | null | The reported figure |
| `unit` | string | Unit of measurement (`current US$`, `years`, `% of total`) |
| `obsStatus` | string | Observation status flag published with the figure |
| `dataLastUpdated` | string | Date the World Bank last revised this dataset |
| `scrapedAt` | string | ISO 8601 timestamp of the extraction |

##### Indicator Metadata

Included when `includeIndicatorDetails` is on.

| Field | Type | Description |
|-------|------|-------------|
| `indicatorDefinition` | string | The World Bank's official methodology note for the indicator |
| `indicatorSource` | string | Database the figure comes from (e.g. World Development Indicators) |
| `indicatorSourceOrganization` | string | Originating organisation (e.g. UN Population Division) |
| `indicatorTopics` | string\[] | Subject areas the indicator belongs to |

##### Country Metadata

Included when `includeCountryDetails` is on.

| Field | Type | Description |
|-------|------|-------------|
| `countryRegion` | string | World Bank region name |
| `countryIncomeLevel` | string | World Bank income group name |
| `countryCapitalCity` | string | Capital city |
| `countryLatitude` | number | null | Latitude of the capital |
| `countryLongitude` | number | null | Longitude of the capital |

#### One Row Per Time Series (compact)

```json
{
    "recordType": "series",
    "countryCode": "BR",
    "countryName": "Brazil",
    "countryIso3": "BRA",
    "isAggregate": false,
    "indicatorCode": "SP.DYN.LE00.IN",
    "indicatorName": "Life expectancy at birth, total (years)",
    "values": { "2020": 74.01, "2021": 72.75, "2022": 75.36, "2023": 75.85 },
    "firstYear": 2020,
    "lastYear": 2023,
    "latestValue": 75.85,
    "observationCount": 4,
    "unit": "years",
    "dataLastUpdated": "2026-07-13",
    "scrapedAt": "2026-07-25T09:14:02.318Z",
    "indicatorSource": "World Development Indicators",
    "countryRegion": "Latin America & Caribbean",
    "countryIncomeLevel": "Upper middle income"
}
```

##### Time Series Fields

| Field | Type | Description |
|-------|------|-------------|
| `values` | object | Year-to-value map for the whole series, e.g. `{"2022": 75.36}` |
| `firstYear` | integer | Earliest year with a reported value |
| `lastYear` | integer | Latest year with a reported value |
| `latestValue` | number | null | The value at `lastYear` |
| `observationCount` | integer | Number of years carrying a value |

The `recordType` field, the country fields (`countryCode`, `countryName`, `countryIso3`, `isAggregate`), indicator fields (`indicatorCode`, `indicatorName`, `unit`, `dataLastUpdated`, `scrapedAt`) and both metadata blocks above appear on time series rows exactly as they do on flat rows.

### Tips for Best Results

- **Start with a small `maxResults`, and set it slightly under your budget** — row counts multiply as indicators × countries × years. Run 500 rows first to confirm the shape is what you want, then raise the limit. Remember that a flat-table run finishes the batches already in flight, so it can return more rows than the limit — see the note under the input reference.
- **Leave `yearTo` blank to pick up projections** — several World Bank datasets publish estimates well past today (population projections already run to 2050). A blank "To Year" keeps them; setting an explicit end year cuts them off.
- **Switch to the compact layout for long histories** — "One row per time series" returns the same 1960-to-present data in roughly 1/60th of the rows, which is dramatically cheaper for full-history pulls across many countries.
- **Leave `includeAggregates` off for any average or ranking** — the World Bank publishes "World", "Euro area", "High income" and 75 other groupings in the same list as real countries. Including them and then averaging double-counts entire continents.
- **Use `latestValueOnly` for league tables and maps** — it returns the most recent reported year per country automatically, which is not the same year for every country when coverage is uneven.
- **Combine `topic` with `indicatorSearch`** — searching "emissions" inside Climate Change finds what you want far faster than searching the full 29,544-indicator catalogue, and the shortest, most headline indicators rank first.
- **Keep `skipEmptyValues` on for sparse indicators** — poverty, gender and governance series often report only every three to five years, so most country-year cells are genuinely blank.
- **Watch out for archived indicator codes** — a handful of older codes live in World Bank archive databases that cannot serve figures. The run tells you by name which codes returned nothing, so you can look up the current replacement on data.worldbank.org.

### Pricing

**From $1.60 per 1,000 results** — 20% below the nearest comparable actor, with no 10,000-row ceiling. Bronze, Silver, and Gold subscribers pay progressively less; the table below shows total cost at each discount tier.

| Results | No discount | Bronze | Silver | Gold |
|---------|-------------|--------|--------|------|
| 100 | $0.19 | $0.18 | $0.17 | $0.16 |
| 1,000 | $1.90 | $1.80 | $1.70 | $1.60 |
| 10,000 | $19.00 | $18.00 | $17.00 | $16.00 |
| 100,000 | $190.00 | $180.00 | $170.00 | $160.00 |

A "result" is one row in the output dataset — one country/indicator/year observation in the flat layout, or one complete time series in the compact layout. No compute or time-based charges — you pay per result, plus a small fixed per-run start fee.

### Integrations

Export data in JSON, CSV, Excel, XML, or RSS. Connect to 1,500+ apps via:

- **Zapier** / **Make** / **n8n** — Workflow automation
- **Google Sheets** — Direct spreadsheet export
- **Slack** / **Email** — Notifications on new results
- **Webhooks** — Trigger custom integrations on run completion
- **Apify API** — Full programmatic access

### Legal & Ethical Use

This actor collects publicly published statistics from World Bank Open Data. Most World Bank datasets, including the World Development Indicators, are released under the Creative Commons Attribution 4.0 International licence (CC BY 4.0), which permits reuse and redistribution provided the World Bank is credited as the source. A small number of datasets carry additional third-party restrictions — check the terms attached to an individual indicator before republishing it commercially.

Please credit the World Bank when you publish figures collected here, keep the `dataLastUpdated` value alongside the numbers so readers know the vintage, and comply with the World Bank's Terms of Use and any applicable laws in your jurisdiction. The dataset contains country-level statistics only and no personal data.

# Actor input Schema

## `indicatorCodes` (type: `array`):

The exact World Bank indicator codes you want, for example 'NY.GDP.MKTP.CD' (GDP in current US$) or 'SP.POP.TOTL' (total population). You can find codes on data.worldbank.org. Leave this empty and use the search box below if you don't know the codes.

## `commonIndicator` (type: `string`):

Don't know any codes and don't want to search? Pick one of the most-requested World Bank statistics here and it is added to whatever is in the box above.

## `indicatorSearch` (type: `string`):

Don't know the code? Type words that appear in the indicator name, such as 'life expectancy', 'CO2 emissions' or 'unemployment female'. Every matching indicator is added, up to the limit set below.

## `topic` (type: `string`):

Only use indicators from this World Bank subject area. Great for browsing — combine it with the search box above to narrow things down. Leave blank to search across all subject areas.

## `maxIndicators` (type: `integer`):

Safety limit on how many indicators the search box and subject area can add. A broad search like 'population' matches hundreds of indicators, and every extra indicator multiplies the number of rows you get. Codes you typed in yourself are always kept and do not count against this limit.

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

Country codes, either 2-letter or 3-letter (US or USA, DE or DEU, BR or BRA). Enter 'all' on its own to cover every country the World Bank tracks. Leave empty to use the region or income group filters below instead.

## `region` (type: `string`):

Add every country in this World Bank region. Combines with anything you typed in the Countries box above.

## `incomeLevel` (type: `string`):

Add every country in this World Bank income group. Useful for comparing rich and poor economies side by side.

## `includeAggregates` (type: `boolean`):

Also return World Bank aggregate rows such as 'World', 'Euro area', 'Sub-Saharan Africa' and 'High income'. Turn this off if you only want individual countries — the World Bank mixes aggregates in with countries by default.

## `yearFrom` (type: `integer`):

Earliest year to include. World Bank data generally starts in 1960, though many indicators only begin in the 1990s or 2000s. Leave blank for no lower limit.

## `yearTo` (type: `integer`):

Latest year to include. Leave blank to run through to the most recent year published — including the World Bank's projection datasets, which already publish figures out to 2050.

## `latestValueOnly` (type: `boolean`):

Return just the single most recent reported value for each country and indicator instead of a full time series. Perfect for country league tables and dashboards. When switched on, the year range above is ignored.

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

'One row per year' gives you a long, flat table that is easy to pivot or chart — one row for each country, indicator and year. 'One row per time series' packs all the years for a country and indicator into a single row, which is far more compact for long histories.

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

Leave out rows where the World Bank has no figure for that country and year. Coverage is patchy for many indicators, so keeping this on usually removes a lot of blank rows.

## `includeIndicatorDetails` (type: `boolean`):

Add the official definition, unit of measurement, source organisation and subject areas for each indicator, so anyone reading your spreadsheet knows exactly what the numbers mean.

## `includeCountryDetails` (type: `boolean`):

Add each country's region, income group, capital city and coordinates alongside the figures. Handy for grouping and mapping.

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

Stop after this many rows. Set to 0 for no limit — be careful, a single indicator across every country and every year returns roughly 17,000 rows, and that multiplies by the number of indicators you selected. Two things to know, because you are charged for every row that is saved: (1) this is a stopping point rather than a hard ceiling — once it is reached no new batches are requested, but the batches already being fetched are finished and saved, so a flat-table run can return more rows than you asked for, typically 5-20% more and up to roughly double in the worst case; (2) the smallest batch the World Bank serves here is 50 rows, so any limit below 50 can still return up to 50 results. The compact 'One row per time series' layout is the exception — it is trimmed to your limit exactly. Set the limit a little below your true budget.

## Actor input object example

```json
{
  "indicatorCodes": [
    "NY.GDP.MKTP.CD",
    "SP.POP.TOTL"
  ],
  "maxIndicators": 5,
  "countries": [
    "US",
    "CN",
    "DE",
    "JP",
    "GB"
  ],
  "yearFrom": 2000,
  "outputFormat": "observation",
  "skipEmptyValues": true,
  "includeIndicatorDetails": true,
  "includeCountryDetails": true,
  "maxResults": 1000
}
```

# Actor output Schema

## `overview` (type: `string`):

Table of country, indicator, year and value — the core figures.

## `detail` (type: `string`):

Same figures plus the official indicator definition, unit, source organisation and country classifications.

## `series` (type: `string`):

One row per country and indicator, with every year packed into a single value map. Populated when the output layout is set to 'One row per time series'.

# 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 = {
    "indicatorCodes": [
        "NY.GDP.MKTP.CD",
        "SP.POP.TOTL"
    ],
    "commonIndicator": "",
    "indicatorSearch": "",
    "topic": "",
    "maxIndicators": 5,
    "countries": [
        "US",
        "CN",
        "DE",
        "JP",
        "GB"
    ],
    "region": "",
    "incomeLevel": "",
    "includeAggregates": false,
    "yearFrom": 2000,
    "latestValueOnly": false,
    "outputFormat": "observation",
    "skipEmptyValues": true,
    "includeIndicatorDetails": true,
    "includeCountryDetails": true,
    "maxResults": 1000
};

// Run the Actor and wait for it to finish
const run = await client.actor("solidcode/world-bank-indicators-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 = {
    "indicatorCodes": [
        "NY.GDP.MKTP.CD",
        "SP.POP.TOTL",
    ],
    "commonIndicator": "",
    "indicatorSearch": "",
    "topic": "",
    "maxIndicators": 5,
    "countries": [
        "US",
        "CN",
        "DE",
        "JP",
        "GB",
    ],
    "region": "",
    "incomeLevel": "",
    "includeAggregates": False,
    "yearFrom": 2000,
    "latestValueOnly": False,
    "outputFormat": "observation",
    "skipEmptyValues": True,
    "includeIndicatorDetails": True,
    "includeCountryDetails": True,
    "maxResults": 1000,
}

# Run the Actor and wait for it to finish
run = client.actor("solidcode/world-bank-indicators-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 '{
  "indicatorCodes": [
    "NY.GDP.MKTP.CD",
    "SP.POP.TOTL"
  ],
  "commonIndicator": "",
  "indicatorSearch": "",
  "topic": "",
  "maxIndicators": 5,
  "countries": [
    "US",
    "CN",
    "DE",
    "JP",
    "GB"
  ],
  "region": "",
  "incomeLevel": "",
  "includeAggregates": false,
  "yearFrom": 2000,
  "latestValueOnly": false,
  "outputFormat": "observation",
  "skipEmptyValues": true,
  "includeIndicatorDetails": true,
  "includeCountryDetails": true,
  "maxResults": 1000
}' |
apify call solidcode/world-bank-indicators-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "World Bank Indicators Scraper",
        "description": "[💰 $1.6 / 1K] Extract World Bank Open Data statistics — GDP, population, inflation, health, education, climate and 29,000+ more indicators — for 200+ countries from 1960 to today. Search indicators by name or code, pick countries, regions or income groups, set any year range.",
        "version": "1.0",
        "x-build-id": "8LcuGOieJsBanU5wL"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/solidcode~world-bank-indicators-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-solidcode-world-bank-indicators-scraper",
                "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/solidcode~world-bank-indicators-scraper/runs": {
            "post": {
                "operationId": "runs-sync-solidcode-world-bank-indicators-scraper",
                "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/solidcode~world-bank-indicators-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-solidcode-world-bank-indicators-scraper",
                "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",
                "properties": {
                    "indicatorCodes": {
                        "title": "Indicator Codes",
                        "type": "array",
                        "description": "The exact World Bank indicator codes you want, for example 'NY.GDP.MKTP.CD' (GDP in current US$) or 'SP.POP.TOTL' (total population). You can find codes on data.worldbank.org. Leave this empty and use the search box below if you don't know the codes.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "commonIndicator": {
                        "title": "Or Pick A Common Indicator",
                        "enum": [
                            "",
                            "NY.GDP.MKTP.CD",
                            "NY.GDP.PCAP.CD",
                            "SP.POP.TOTL",
                            "FP.CPI.TOTL.ZG",
                            "SP.DYN.LE00.IN",
                            "SL.UEM.TOTL.ZS",
                            "EN.GHG.CO2.MT.CE.AR5",
                            "SH.DYN.MORT",
                            "IT.NET.USER.ZS",
                            "SE.XPD.TOTL.GD.ZS",
                            "SI.POV.DDAY"
                        ],
                        "type": "string",
                        "description": "Don't know any codes and don't want to search? Pick one of the most-requested World Bank statistics here and it is added to whatever is in the box above."
                    },
                    "indicatorSearch": {
                        "title": "Search Indicators By Name",
                        "type": "string",
                        "description": "Don't know the code? Type words that appear in the indicator name, such as 'life expectancy', 'CO2 emissions' or 'unemployment female'. Every matching indicator is added, up to the limit set below."
                    },
                    "topic": {
                        "title": "Subject Area",
                        "enum": [
                            "",
                            "3",
                            "8",
                            "4",
                            "6",
                            "19",
                            "10",
                            "21",
                            "11",
                            "17",
                            "5",
                            "7",
                            "1",
                            "9",
                            "12",
                            "13",
                            "14",
                            "15",
                            "16",
                            "20",
                            "2",
                            "18"
                        ],
                        "type": "string",
                        "description": "Only use indicators from this World Bank subject area. Great for browsing — combine it with the search box above to narrow things down. Leave blank to search across all subject areas."
                    },
                    "maxIndicators": {
                        "title": "Maximum Indicators",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Safety limit on how many indicators the search box and subject area can add. A broad search like 'population' matches hundreds of indicators, and every extra indicator multiplies the number of rows you get. Codes you typed in yourself are always kept and do not count against this limit."
                    },
                    "countries": {
                        "title": "Countries",
                        "type": "array",
                        "description": "Country codes, either 2-letter or 3-letter (US or USA, DE or DEU, BR or BRA). Enter 'all' on its own to cover every country the World Bank tracks. Leave empty to use the region or income group filters below instead.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "region": {
                        "title": "World Region",
                        "enum": [
                            "",
                            "EAS",
                            "ECS",
                            "LCN",
                            "MEA",
                            "NAC",
                            "SAS",
                            "SSF"
                        ],
                        "type": "string",
                        "description": "Add every country in this World Bank region. Combines with anything you typed in the Countries box above."
                    },
                    "incomeLevel": {
                        "title": "Income Group",
                        "enum": [
                            "",
                            "HIC",
                            "UMC",
                            "MIC",
                            "LMC",
                            "LMY",
                            "LIC"
                        ],
                        "type": "string",
                        "description": "Add every country in this World Bank income group. Useful for comparing rich and poor economies side by side."
                    },
                    "includeAggregates": {
                        "title": "Include Regional & Group Totals",
                        "type": "boolean",
                        "description": "Also return World Bank aggregate rows such as 'World', 'Euro area', 'Sub-Saharan Africa' and 'High income'. Turn this off if you only want individual countries — the World Bank mixes aggregates in with countries by default."
                    },
                    "yearFrom": {
                        "title": "From Year",
                        "minimum": 1960,
                        "maximum": 2100,
                        "type": "integer",
                        "description": "Earliest year to include. World Bank data generally starts in 1960, though many indicators only begin in the 1990s or 2000s. Leave blank for no lower limit."
                    },
                    "yearTo": {
                        "title": "To Year",
                        "minimum": 1960,
                        "maximum": 2100,
                        "type": "integer",
                        "description": "Latest year to include. Leave blank to run through to the most recent year published — including the World Bank's projection datasets, which already publish figures out to 2050."
                    },
                    "latestValueOnly": {
                        "title": "Latest Value Only",
                        "type": "boolean",
                        "description": "Return just the single most recent reported value for each country and indicator instead of a full time series. Perfect for country league tables and dashboards. When switched on, the year range above is ignored."
                    },
                    "outputFormat": {
                        "title": "Output Layout",
                        "enum": [
                            "observation",
                            "series"
                        ],
                        "type": "string",
                        "description": "'One row per year' gives you a long, flat table that is easy to pivot or chart — one row for each country, indicator and year. 'One row per time series' packs all the years for a country and indicator into a single row, which is far more compact for long histories."
                    },
                    "skipEmptyValues": {
                        "title": "Skip Years With No Data",
                        "type": "boolean",
                        "description": "Leave out rows where the World Bank has no figure for that country and year. Coverage is patchy for many indicators, so keeping this on usually removes a lot of blank rows."
                    },
                    "includeIndicatorDetails": {
                        "title": "Include Indicator Descriptions",
                        "type": "boolean",
                        "description": "Add the official definition, unit of measurement, source organisation and subject areas for each indicator, so anyone reading your spreadsheet knows exactly what the numbers mean."
                    },
                    "includeCountryDetails": {
                        "title": "Include Country Details",
                        "type": "boolean",
                        "description": "Add each country's region, income group, capital city and coordinates alongside the figures. Handy for grouping and mapping."
                    },
                    "maxResults": {
                        "title": "Maximum Results",
                        "minimum": 0,
                        "maximum": 500000,
                        "type": "integer",
                        "description": "Stop after this many rows. Set to 0 for no limit — be careful, a single indicator across every country and every year returns roughly 17,000 rows, and that multiplies by the number of indicators you selected. Two things to know, because you are charged for every row that is saved: (1) this is a stopping point rather than a hard ceiling — once it is reached no new batches are requested, but the batches already being fetched are finished and saved, so a flat-table run can return more rows than you asked for, typically 5-20% more and up to roughly double in the worst case; (2) the smallest batch the World Bank serves here is 50 rows, so any limit below 50 can still return up to 50 results. The compact 'One row per time series' layout is the exception — it is trimmed to your limit exactly. Set the limit a little below your true budget."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
