wb_document: World Bank document data

View source: R/documents.R

wb_documentR Documentation

World Bank document data

Description

Search the World Bank Documents & Reports archive from the Documents & Reports API.

Usage

wb_document(
  search = NULL,
  country = NULL,
  type = NULL,
  project = NULL,
  start_date = NULL,
  end_date = NULL,
  id = NULL,
  limit = NULL
)

Arguments

search

(NULL | character(1))
Free-text search term. Default NULL.

country

(NULL | character())
Two-character World Bank country code(s) to filter by, e.g. "BR" or c("BR", "IN"). Matching is case insensitive, and documents for any of the given codes are returned. Default NULL.

type

(NULL | character())
Document type(s) to filter by, e.g. "Report" or "Project Appraisal Document". Documents of any of the given types are returned. Default NULL.

project

(NULL | character())
Project ID(s) to filter by, e.g. "P180429". Documents for any of the given projects are returned. Default NULL.

start_date

(NULL | character(1))
Document start date in "YYYY-MM-DD" format. Default NULL.

end_date

(NULL | character(1))
Document end date in "YYYY-MM-DD" format. Default NULL.

id

(NULL | character())
Document ID(s) to filter by, as returned in the id column. Default NULL.

limit

(NULL | integer(1))
The maximum number of documents to return. Default NULL. If NULL, all matching documents are returned, which can take many requests for broad queries. Documents are returned in descending order of date, so the most recent documents come first.

Value

A data.frame() with World Bank document data. Since a document can have several types, countries, regions, and projects, type, major_type, country_code, country, region, and project_id hold all of them separated by ⁠;⁠, which never occurs within a value. Use strsplit(x, ";") to split them. The columns are:

  • id: The document ID.

  • title: The document title.

  • type: The document types.

  • major_type: The major document types.

  • country_code: The World Bank country codes.

  • country: The country names. They are not in the same order as country_code, and a code can have more than one name, so the two can't be matched by position.

  • region: The administrative region names.

  • language: The document language.

  • date: The document date.

  • report_number: The report number.

  • project_id: The IDs of the associated projects, or NA if there are none.

  • url: The document URL.

  • pdf_url: The PDF URL.

  • abstract: The abstract.

Source

https://search.worldbank.org/api/v3/wds

Examples



# project appraisal documents for Brazil published in 2024
wb_document(
  country = "BR",
  type = "Project Appraisal Document",
  start_date = "2024-01-01",
  end_date = "2024-12-31"
)

# all documents belonging to a project
wb_document(project = "P180429")

# the first 100 documents mentioning climate
docs <- wb_document(search = "climate", limit = 100)

# the ones covering more than one country
docs[grepl(";", docs$country_code), c("title", "country_code")]



worldbank documentation built on Nov. 17, 2026, 5:06 p.m.