← Back to all sparks
W

worldbank

ANALYTICS
Velocity0.0

R package worldbank by m-muecke — release notes from GitHub.

A World Bank data wrapper that keeps finding the places its own API can't reach.

world-bankdevelopment-datar-packageapi-wrapperopen-datacaching
Current state
worldbank provides R access to the World Bank's public data: World Development Indicators, the Poverty and Inequality Platform, project records, and the Finances One datasets. It settled its type contract early — always a data.frame, never a conditional tibble — and has since layered on opt-in request caching, multi-indicator queries, and query conveniences like most-recent-values and gap filling. The most recent addition sidesteps the API entirely, pulling the full WDI archive as a zip.
Where it's heading
Two threads run through the log. The first is query ergonomics: multiple indicators per call, mrv and gapfill parameters, regex search across the indicator catalog, a shorter wb_data() name that has since become the primary entry point. The second is coverage of things the standard API handles poorly — bulk download reaches footnote and series-time metadata the endpoints never expose, and PIP nowcasts and project records extend past the indicator tables most users start with. The maintainer runs the same infrastructure across their other data packages, and the caching design here is identical to what bbk and treasury received.
Prediction
Expect the remaining rough edges of the World Bank's own API — inconsistent empty responses, metadata only available in bulk files — to keep driving releases, rather than a push into new data providers.

Recent moves

  1. 1mo ago

    Empty queries return an empty frame instead of erroring

    A small fix in service of a long-standing goal: since 0.4.0 this package has been explicit about type stability, and a query with no observations erroring rather than returning an empty data frame broke that contract. Minor in code, but it is the difference between a loop over countries completing and dying on the first sparse series.

    View source ↗
  2. 3mo ago

    Bulk WDI download reaches metadata the API never exposes

    wb_bulk() bypasses the API to fetch the entire World Development Indicators dataset as a zip, returning its six CSVs — including footnote and series-time metadata the endpoints do not serve. Paired with wb_search() for regex queries against the indicator catalog, this is the package acknowledging that discovery and completeness are both easier outside the per-request API.

    View source ↗
  3. 5mo ago

    Most-recent-values and gap filling, plus project records

    mrv and gapfill move common post-processing into the query itself, which is the shape most of this package's ergonomic work takes. wb_project() and pip_cp() widen the data surface past indicators into project records and PIP country profiles, and the nowcast parameter admits estimates alongside measured values.

    View source ↗
  4. 8mo ago

    Test suite stops caching queries for CRAN compliance

    A packaging fix with no user-facing effect, disabling cache use inside tests to satisfy CRAN policy. Ordinary cost of shipping an HTTP client through a strict repository.

    View source ↗
  5. 9mo ago

    Opt-in request caching with a one-day default

    Caching arrives as an option rather than a default, with helpers to locate and clear the cache — the same design the maintainer shipped to their central bank and Treasury packages. For repeated indicator pulls in reports and teaching material, it removes the main reason to hand-roll a local copy.

    View source ↗
  6. 1y ago

    wb_data() added as an alias for wb_country_indicator()

    A one-line alias, though a consequential one in retrospect: every later release documents the short name, which has effectively become the package's primary entry point.

    View source ↗