wbgapi
wbgapi provides a comprehensive interface to the World Bank's data and metadata APIs
What it is and what it does
WBGAPI is a Python wrapper around the World Bank's data APIs that lets you query development indicators, economic statistics, and metadata across multiple World Bank databases. It abstracts away API complexity by organizing data into logical sub-packages (series for indicators, economy for countries, time for periods, source for databases, and others) and providing consistent methods like `list()`, `get()`, `info()`, and `Series()` across each. The package queries databases individually by default, which avoids confusion when the same indicator appears in multiple databases or when databases have different dimensions or time coverage.
You can fetch data as dictionaries or pandas DataFrames, filter by keywords, combine multiple series and countries in a single request, and select specific years or most-recent values. The API is designed to feel natural in Python—using generators, ranges, and sets—and includes extensive docstrings with examples. Optional pandas support lets you work with the results as structured tables with multi-indexing.
Use it for:
- Retrieve population, GDP, or other development indicators for countries over time for economic analysis
- Build datasets combining multiple indicators across regions for research or visualization
- Search World Bank metadata to discover available indicators by keyword or topic
- Automate data collection from World Bank databases for dashboards or reporting pipelines
- Explore World Bank data interactively in Jupyter notebooks using the `info()` functions
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
WBGAPI provides a Python interface to query World Bank data and metadata APIs, supporting multiple databases, indicators, countries, and time periods with optional pandas integration.
Yes. WBGAPI is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It fills a clear need for programmatic access to World Bank data with a well-designed, pythonic API. Install it if you need to work with World Bank indicators, development data, or metadata in Python.
Install
wbgapi on PyPI
pip
pip install wbgapiuv
uv add wbgapipoetry
poetry add wbgapiInstalling wbgapi
Before you install
Low install friction with three lightweight runtime dependencies (requests, PyYAML, tabulate). Active maintenance with recent commits and a stable release history since 2020.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely provided you include the license notice.
Quickstart
pip install wbgapi
import wbgapi as wb
# List available databases
wb.source.info()
# Fetch population data for USA
for row in wb.data.fetch('SP.POP.TOTL', 'USA'):
print(row)
Verify before relying
- Whether pandas integration is optional or required for full functionality
- Performance characteristics when querying large datasets or many indicators simultaneously
- Rate limiting or throttling behavior from the World Bank API
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — requests, PyYAML, tabulate |
| Maintenance | actively maintained — 168 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 86,027/month — #13,889 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: wbgapi-1.0.14-py3-none-any.whl
Tags
More Information Analysis packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyarrowpyarrow provides Python bindings to Apache…
permissive · top 100 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
snowflake-snowpark-pythonSnowpark Python provides APIs to query and…
permissive · top 1,000 on PyPI
wbdataWbdata provides a Python interface to query and…
copyleft · top 5,000 on PyPI
openbb-economyProvides access to global macroeconomic data…
agpl · top 15,000 on PyPI
fredapifredapi wraps the FRED web service to fetch…
unclear · top 5,000 on PyPI
pandas-datareaderFetches macroeconomic and factor data from…
permissive · top 5,000 on PyPI
beaapibeaapi retrieves and processes economic data…
permissive · top 15,000 on PyPI
imfpDownloads economic data from the International…
permissive · top 15,000 on PyPI
openbb-imfProvides a provider extension for the OpenBB…
agpl · top 15,000 on PyPI
tradingeconomicsProvides Python access to over 300,000 economic…
permissive · top 15,000 on PyPI
pycountryProvides programmatic access to ISO standard…
copyleft · top 1,000 on PyPI
python-bcbStructured Python interface to fetch Brazilian…
unclear · top 15,000 on PyPI