World Bank API

Beginner's Pick Science & Math / No Auth Required Beginner HTTPS
Free to Use Varies (check documentation)
100 A+
Measured Score 0 50 100 Reachability 30/30 Speed 20/20 Security 15/15 Developer XP 20/20 Reliability 15/15 TESTED 2026-07-23

Overview

The World Bank API provides access to thousands of development indicators covering economics, education, health, and infrastructure for over 200 countries spanning decades. It is completely free with no authentication required, making it one of the best APIs for data science, economics research, and visualization projects. You can query individual indicators for specific countries or retrieve bulk data for cross-country comparisons.

Beginner Tip

Start by querying a single well-known indicator like NY.GDP.MKTP.CD for GDP in current USD for a specific country code — the response is straightforward and gives you a feel for the data structure. Use format=json in your URL to avoid getting XML by default.

Available Data

Use case: Integrate world data data into web and mobile applications
World Bank data via REST API

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from World Bank",
    "description": "World Data",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

[0].page Current page number in the paginated response.
[0].total Total number of records available across all pages.
[1] Array of data point objects containing indicator values by year and country.
[1][].country.value Full country name corresponding to the data point.
[1][].date Year for which this data point applies as a string.
[1][].value The indicator value for this country and year; null if data is unavailable.

Implementation Example

Request
const url = "https://datahelpdesk.worldbank.org/knowledgebase/topics/125589";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

XML response instead of JSON The format=json parameter was omitted from the URL.
Always append format=json to your request URL; the World Bank API returns XML by default.
Empty data array with valid response Data for the requested indicator or country may not be available for the specified year range.
Omit date filters first to see what years are available, then narrow your range. Some indicators only cover specific decades.
Indicator code not found World Bank indicator codes are case-sensitive and must match exactly.
Look up the exact indicator code at data.worldbank.org/indicator — codes like NY.GDP.MKTP.CD must be typed precisely including dots and uppercase.

Measured Score Breakdown

Live HTTP request to the API endpoint

Reachability 30/30
Speed 20/20
Security 15/15
Developer XP 20/20
Reliability 15/15
Endpoint Response Time 164ms

Fully tested on Jul 23, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS NO
Category Science & Math
Difficulty Beginner
Verified: 2026-04-04

Related Tags

Similar APIs

View All →