World Bank API
api.worldbank.org · Government
Access World Bank development data — GDP, poverty rates, health indicators, education statistics, and thousands of other metrics across 200+ countries. Free, no API key required.
Authentication
Sample Requests
Get the last 5 years of US GDP data.
Hover any highlighted part to learn what it does
curl -X GET "https://api.worldbank.org/v2/country/US/indicator/NY.GDP.MKTP.CD?mrv=5&format=json"
import requests
params = {
"mrv": "5",
"format": "json"
}
response = requests.get(
"https://api.worldbank.org/v2/country/US/indicator/NY.GDP.MKTP.CD",
params=params,
)
print(response.json())const url = new URL('https://api.worldbank.org/v2/country/US/indicator/NY.GDP.MKTP.CD');
url.searchParams.set('mrv', '5');
url.searchParams.set('format', 'json');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.worldbank.org/v2/country/US/indicator/NY.GDP.MKTP.CD")
q := baseURL.Query()
q.Set("mrv", "5")
q.Set("format", "json")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.worldbank.org/v2/country/US/indicator/NY.GDP.MKTP.CD")
uri.query = URI.encode_www_form({
"mrv" => "5",
"format" => "json"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.worldbank.org/v2/country/US/indicator/NY.GDP.MKTP.CD?" . http_build_query([
"mrv" => "5",
"format" => "json"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Search available World Development Indicators.
Hover any highlighted part to learn what it does
curl -X GET "https://api.worldbank.org/v2/indicator?q=poverty&format=json&source=2&per_page=5"
import requests
params = {
"q": "poverty",
"format": "json",
"source": "2",
"per_page": "5"
}
response = requests.get(
"https://api.worldbank.org/v2/indicator",
params=params,
)
print(response.json())const url = new URL('https://api.worldbank.org/v2/indicator');
url.searchParams.set('q', 'poverty');
url.searchParams.set('format', 'json');
url.searchParams.set('source', '2');
url.searchParams.set('per_page', '5');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.worldbank.org/v2/indicator")
q := baseURL.Query()
q.Set("q", "poverty")
q.Set("format", "json")
q.Set("source", "2")
q.Set("per_page", "5")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.worldbank.org/v2/indicator")
uri.query = URI.encode_www_form({
"q" => "poverty",
"format" => "json",
"source" => "2",
"per_page" => "5"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.worldbank.org/v2/indicator?" . http_build_query([
"q" => "poverty",
"format" => "json",
"source" => "2",
"per_page" => "5"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No API key needed
- Always add ?format=json to get JSON instead of XML
- Try GET https://api.worldbank.org/v2/country/GB/indicator/SP.POP.TOTL?format=json&mrv=5
- Replace GB with any ISO 2-letter country code
- indicator codes: NY.GDP.MKTP.CD (GDP), SP.POP.TOTL (population), SI.POV.NAHC (poverty rate)
What can you build with World Bank API?
World Bank API is a Government API. Developers commonly use government APIs for:
- surfacing public datasets in citizen-facing apps
- building transparency and civic engagement tools
- accessing legislation, court records, and official data
- powering research and journalism tools
- creating compliance and regulatory monitoring dashboards
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. World Bank API is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide