# World Bank API — $0.0002 per datapoint

> World Bank API: Development indicators per country and year — GDP, population. $0.0002 per delivered datapoint, nothing delivered means nothing charged.

[Home](https://quanticdata.io/)/[Collectors](https://quanticdata.io/collectors/)/*World Bank API*

# World Bank API

A World Bank API call takes one indicator code and a set of countries and returns a clean panel: one row per country-year with the numeric value, the ISO3 code and the indicator's label. `NY.GDP.MKTP.CD` makes it a GDP API, `SP.POP.TOTL` a population series, `FP.CPI.TOTL.ZG` an inflation feed — the Bank's roughly 16,000 indicator codes all answer in the same shape, keyless.

[Get my free API key](https://app.quanticdata.io/register) [See the request](/collectors/world-bank-api/#integration)

$0.0002 per delivered datapoint · $2 free every month · Failed runs never billed

POST /v1/scraper/collectors/world_bank/run

```
$ curl $QD/world_bank/run \
    -H "Authorization: Bearer $QD_API_KEY" \
    -d '{}'
{ "status": "done", "count": 10,
  "results": [
    {
      "country": "…",
      "country_code": "…",
      "year": "…",
      "value": … } ],
  "cost": 0.002 }
# 10 datapoints × $0.0002 · nothing delivered, nothing charged
```

**$0.0002 / datapoint**10,000 datapoints on the free $2 every month

**Semantic input**indicator, countries, year_from — no URL lists

**Up to 200**datapoints per run, pagination handled for you

**No browser**read over HTTP/TLS — cheaper and faster than rendering

On this page: [What it is](/collectors/world-bank-api/#what) [Output fields](/collectors/world-bank-api/#output) [Inputs](/collectors/world-bank-api/#input) [Pricing](/collectors/world-bank-api/#pricing) [Integration](/collectors/world-bank-api/#integration) [Use cases](/collectors/world-bank-api/#use-cases) [Versus the alternatives](/collectors/world-bank-api/#compare) [FAQ](/collectors/world-bank-api/#faq)

## What a World Bank API does

The World Bank indicators API is open and official, but it answers in paged JSON with a metadata envelope in front of the data. Here the panel arrives already long-format — country, year, value — which is the layout a pivot, a regression or a database table accepts without reshaping, joined on `country_code` plus `year`.

Years the Bank holds no figure for are skipped by default, so the series you store is dense rather than padded with nulls; set `include_empty` when the gaps need to stay visible. Up to 30 countries ride in one call, ISO2 or ISO3, and aggregate codes like `WLD` pass through the same way — a country data API that also covers the world total.

Input is meaning, not a URL *indicator* *countries* *year_from* *year_to* *include_empty*

## What one datapoint looks like

Every delivered datapoint carries these fields. Nullable means the source did not publish it — the field stays empty instead of being guessed.

| Field | Type | What it holds |
| --- | --- | --- |
| `rank` | integer | 1-based position. |
| `country` | string · nullable | Country name. |
| `country_code` | string · nullable | ISO3 code. |
| `year` | string · nullable | Year. |
| `value` | number · nullable | Indicator value. |
| `indicator` | string | Indicator code. |
| `indicator_name` | string · nullable | Indicator label. |

## Inputs

The whole request. Anything you leave out falls back to the default shown in the catalog.

| Input | Type | Required | What it does |
| --- | --- | --- | --- |
| `indicator` | string | yes | World Bank indicator code. |
| `countries` | array | yes | ISO2/ISO3 country codes. |
| `year_from` | integer | no | First year (default: all). |
| `year_to` | integer | no | Last year (default: latest). |
| `include_empty` | boolean | no | Keep rows whose value is null. |
| `max_results` | integer | no | How many datapoints to deliver at most (1–200). You pay only for delivered datapoints. |

Pricing

## World Bank API pricing

$0.0002 per delivered datapoint. A run that delivers nothing costs nothing: blocked pages, challenges and retries are on us, and the $2 monthly allowance covers about 10,000 datapoints before you spend anything.

**$0.0002**per delivered datapoint*$0.2 per 1,000 delivered datapoints*

**10,000 datapoints**on the free allowance*$2 every month, no card*

**Zero rows**zero charge*blocks, captchas and retries are on us*

**−30%**on volume tiers*the catalog returns your key's price*

### Pay as you go

$0/mo

- $2 free credit / month

- 60 requests / min

- List unit prices

### Starter

$19/mo

- $15 free credit / month

- 300 requests / min

- 10% off unit prices

Most popular

### Growth

$79/mo

- $50 free credit / month

- 600 requests / min

- 20% off unit prices

### Scale

$299/mo

- $250 free credit / month

- 1,200 requests / min

- 30% off unit prices

Same wallet, same key and same $2 monthly allowance as every other [Data API](https://quanticdata.io/web-data-api-for-ai/). Prices are launch pricing read live from the billing config — `GET /v1/scraper/collectors` returns the price your key actually pays.

Integration

## One POST, typed rows

Base URL `https://api.quanticdata.io/v1`, Bearer auth, the same key as every other Data API. Endpoint: `POST /v1/scraper/collectors/world_bank/run`.

```
curl -X POST https://api.quanticdata.io/v1/scraper/collectors/world_bank/run \
  -H "Authorization: Bearer $QD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

```
import requests

r = requests.post(
    "https://api.quanticdata.io/v1/scraper/collectors/world_bank/run",
    headers={"Authorization": f"Bearer {QD_API_KEY}"},
    json={},
    timeout=120,
)
for row in r.json()["payload"]["results"]:
    print(row)
```

```
const res = await fetch(
  "https://api.quanticdata.io/v1/scraper/collectors/world_bank/run",
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.QD_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
);
const { payload } = await res.json();
console.table(payload.results);
```

```
claude mcp add quantumproxies \
  -e QUANTUMPROXIES_API_KEY=qd_live_your_key_here \
  -- npx -y quantumproxies-mcp

# then, in the chat:
> run the world_bank collector with
```

## What people build with the World Bank API

Three shapes of work this endpoint was designed around.

### Macro feature panels

Pull GDP, inflation or population per country-year and join them onto your observations as model features keyed by country code and year.

### Country enrichment joins

A market-sizing or lead table with a country column picks up population and income columns from one indicator call each.

### Long-run trend series

`year_from` reaches back toward 1960, so a single request returns decades of one indicator for charting or back-testing.

## World Bank API versus rolling your own

The differences that actually cost time when you build this in-house.

|  | DIY scraper | This collector |
| --- | --- | --- |
| Panel shape | Paged JSON behind a metadata envelope | Long-format rows: country, year, value |
| Missing years | Nulls scattered through the series | Skipped by default, kept only on request |
| Batching countries | A request loop over country codes | Up to 30 countries in a single call |

## FAQ

Questions we get about the World Bank API.

[Something else? Ask us →](mailto:hello@quanticdata.io)

### Which indicator codes does the World Bank API accept?

Any code from the Bank's catalog of roughly 16,000 — `NY.GDP.MKTP.CD` for GDP in current US dollars, `SP.POP.TOTL` for population, `FP.CPI.TOTL.ZG` for CPI inflation — one indicator per call, across the countries you list.

### Why are some years missing from the series?

Because the Bank publishes no figure for them. Null-value years are dropped so the panel stays dense; pass `include_empty` as true and they come back as rows with a null value instead.

### Can I query world or regional aggregates?

Yes — aggregate codes such as `WLD` for the world total travel through the countries list exactly like ISO codes, so a global series and a country comparison come from the same call shape.

### Is there a free World Bank API?

Every account gets $2 of credit every month with no card, which is about 10,000 delivered datapoints on this endpoint at $0.0002 each. It renews monthly, and a run that delivers nothing is never billed — so a failed or blocked attempt does not eat the allowance.

### How much does one run cost?

Multiply the rows you actually receive by $0.0002. A run capped at 200 datapoints — the maximum for this collector — costs $0.04 if every row comes back, and less when the source has fewer. Volume tiers take up to 30% off, and `GET /v1/scraper/collectors` returns the price your key actually pays.

## Run the World Bank API now

$2 of free credit every month, no card. Your key returns its own prices from `GET /v1/scraper/collectors`.

[Get my free API key](https://app.quanticdata.io/register)

Related: [All 74 collectors](https://quanticdata.io/collectors/) [Exchange rate API](https://quanticdata.io/collectors/exchange-rate-api/) [Stock Data API](https://quanticdata.io/collectors/stock-data-api/) [Wikidata API](https://quanticdata.io/collectors/wikidata-api/) [Documentation](https://quanticdata.io/docs/)

---

Source: https://quanticdata.io/collectors/world-bank-api/ · Site index for AI: https://quanticdata.io/llms.txt
