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.
{
"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
}
}Sample data
What one call returns
A recorded run of indicator-data: the fields and shapes you will get, shortened to 3 items.
| # | country_codestring | countrystring | yearinteger | valuenumber | decimalsinteger |
|---|---|---|---|---|---|
| 1 | CHN | China | 2025 | 19498039388042.6 | 0 |
| 2 | CHN | China | 2024 | 18729668435848 | 0 |
| 3 | CHN | China | 2023 | 18270356654533.2 | 0 |
[
{
"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
}
]country_code,country,year,value,decimals CHN,China,2025,19498039388042.6,0 CHN,China,2024,18729668435848,0 CHN,China,2023,18270356654533.2,0
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
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.
| Endpoint | Required parameters | Returns | Cost |
|---|---|---|---|
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-datatakes anindicatorid and up to 10countrycodes (orall), withstart_yearandend_yearormost_recent, andpageandper_page. Each item hascountry_code,country,year,valueanddecimals, and the answer names theindicatorwith itssource_organizationandlast_updateddate. - Indicator search:
indicators-searchfinds indicators by words in their id or name, with an optionaltopic. Each hasid,name,topics,source_organizationand adescription. - Countries:
countrieslists countries withregion,income_level,lending_type,capital_city,latitudeandlongitude. Filter byregionorincome_level; regional aggregates are left out unlessinclude_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.
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 modelLet 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 wordsCompare countries by income level or region
Use the World Bank API to compare countries by income level or regionBuild country profiles with capital, region and lending type
Use the World Bank API to build country profiles with capital, region and lending typeFAQ
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.