APIs / Finance / World Bank

1 credit per call3 endpoints5 datapoints

World Bank API

World Bank API for World Development Indicators: GDP, population and other development series by country and year, as JSON. 1 credit per successful call.

World Bank
GET/v1/world-bank/indicator-data?country=US%2CCN&indicator=NY.GDP.MKTP.CD&most_recent=5
{
  "success": true,
  "data": {
    "indicator": {
      "id": "NY.GDP.MKTP.CD",
      "name": "GDP (current US$)",
      "source_organization": "Country official statistics, National Statistical Organizations and/or Central Banks;\nNational Accounts data files, Organisation for Economic Co-operation and Development (OECD);\nStaff estimates, World Bank (WB)"
    },
    "last_updated": "2026-11-11",
    "total": 10,
    "page": 1,
    "has_more": false,
    "count": 10,
    "items": [
      {
        "country_code": "CHN",
        "country": "China",
        "year": 2025,
        "value": 19498039388042.6,
        "decimals": 0
      },
      {
        "country_code": "CHN",
        "country": "China",
        "year": 2024,
        "value": 18729668435848,
        "decimals": 0
      },
      {
        "country_code": "CHN",
        "country": "China",
        "year": 2023,
        "value": 18270356654533.2,
        "decimals": 0
      }
    ],
    "notice": "The World Bank: World Development Indicators: Country official statistics, National Statistical Organizations and/or Central Banks;\nNational Accounts data files, Organisation for Economic Co-operation and Development (OECD);\nStaff estimates…"
  },
  "meta": {
    "request_id": "req_bdcd50236b7348c2b8e3ef9b568db8f3",
    "credits_charged": 1,
    "credits_remaining": 432
  }
}
200 OKJSONX-Credits-Used: 1
Recorded from our API and shortened.

Sample data

What one call returns

A recorded run of indicator-data: the fields and shapes you will get, shortened to 3 items.

#country_codestringcountrystringyearintegervaluenumberdecimalsinteger
1CHNChina202519498039388042.60
2CHNChina2024187296684358480
3CHNChina202318270356654533.20

Recorded from our API · 3 items shown · 5 datapoints per itemGET /v1/world-bank/indicator-data?country=US%2CCN&indicator=NY.GDP.MKTP.CD&most_recent=5

5 datapoints

Location

  • country_codestring
  • countrystring

Other

  • yearinteger
  • valuenumber
  • decimalsinteger

Playground

Run this API

cURLshell
curl "https://api.perceptlayer.com/v1/world-bank/indicator-data?country=US%2CCN&indicator=NY.GDP.MKTP.CD&most_recent=5" \
  -H "X-API-Key: $API_KEY"

World Bank · 3 endpoints

Endpoints

Every endpoint takes the same key. Open one for its parameters, the fields it returns and an example request.

EndpointRequired parametersReturnsCost
GET/v1/world-bank/countries
none+3 optional
codeiso2_codenameaggregateregionincome_level+4 more
1 credit
GET/v1/world-bank/indicator-data
countryindicator+5 optional
indicatorlast_updateditemsnotice
1 credit
GET/v1/world-bank/indicators-search
query+3 optional
idnametopicssource_organizationdescription
1 credit

Overview

About the World Bank API

What you can get

The World Bank API returns World Development Indicators (WDI) data as JSON through 3 endpoints.

  • Indicator data: indicator-data takes an indicator id and up to 10 country codes (or all), with start_year and end_year or most_recent, and page and per_page. Each item has country_code, country, year, value and decimals, and the answer names the indicator with its source_organization and last_updated date.
  • Indicator search: indicators-search finds indicators by words in their id or name, with an optional topic. Each has id, name, topics, source_organization and a description.
  • Countries: countries lists countries with region, income_level, lending_type, capital_city, latitude and longitude. Filter by region or income_level; regional aggregates are left out unless include_aggregates=true.

The recorded call for GDP (current US$), NY.GDP.MKTP.CD, for the US and China with most_recent=5 reported a total of 10 values, last updated 2026-11-11; China's 2025 value was 19498039388042.6. A search for "gdp per capita" reported a total of 25 indicators, led by NY.GDP.PCAP.CD, and the Sub-Saharan Africa region (SSF) listed 48 countries.

How a call works

Find an indicator, then read it: GET /v1/world-bank/indicators-search?query=gdp+per+capita, then GET /v1/world-bank/indicator-data?country=US,CN&indicator=NY.GDP.MKTP.CD&most_recent=5 with your key in the X-API-Key header. Answers come from a cache for up to a day. Every successful call costs 1 credit; failed calls cost nothing.

FinanceJSONRESTMCP

More finance APIs

Use cases

Pull GDP, population or inflation series for a set of countries into a model

Use the World Bank API to pull GDP, population or inflation series for a set of countries into a model

Let a research agent find the right indicator id from plain words

Use the World Bank API to let a research agent find the right indicator id from plain words

Compare countries by income level or region

Use the World Bank API to compare countries by income level or region

Build country profiles with capital, region and lending type

Use the World Bank API to build country profiles with capital, region and lending type

FAQ

Questions

What licence is the data under, and how should I credit it?

World Development Indicators are published under the Creative Commons Attribution 4.0 licence (CC BY 4.0). Credit the source in the form every response gives in `notice`: "The World Bank: World Development Indicators: <source organisation>". The World Bank does not endorse Perceptlayer or this API.

Why does an indicator return not found?

This API serves World Development Indicators only. Indicators from the World Bank's other databases carry other licences, so they answer 404.

Is this the official World Bank API?

No. Perceptlayer is not affiliated with the World Bank. The World Bank's own API is free. This API calls it on your behalf and adds one key for every source on Perceptlayer, a simpler response shape, a text search over indicators, a cache of up to a day, and no charge for failed calls.

How much does the World Bank API cost?

Each successful call costs one credit. New accounts get free credits to start, and credit packs bring the price down as you scale.

Should I build a World Bank scraper instead?

You can, but a World Bank scraper is code you maintain: page changes break it, requests get blocked, and World Bank's terms govern how you collect data. The World Bank API gives you 3 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first.

Try the World Bank API with 100 free credits

No credit card. Failed calls are never billed.