wb_search: Search World Bank indicators

View source: R/indicators.R

wb_searchR Documentation

Description

Search the indicator catalog returned by wb_indicator() for a regular expression pattern across one or more text fields. By default the match is case insensitive.

Usage

wb_search(
  pattern,
  fields = c("id", "name", "source_note"),
  catalog = NULL,
  lang = "en",
  ignore.case = TRUE,
  ...
)

Arguments

pattern

(character(1))
Regular expression to match.

fields

(character())
Columns of the indicator catalog to search. Default c("id", "name", "source_note").

catalog

(NULL | data.frame())
Optional pre-fetched indicator catalog. If NULL (default), wb_indicator() is called.

lang

(character(1))
Language to query. Only used when catalog is NULL. Default "en".

ignore.case

(logical(1))
Whether the match should be case insensitive. Default TRUE.

...

(any)
Additional arguments passed to grepl().

Value

A data.frame() with the matching rows of the indicator catalog.

Source

https://api.worldbank.org/v2/indicator

See Also

Other indicators data: wb_bulk(), wb_country(), wb_data(), wb_income_level(), wb_indicator(), wb_language(), wb_lending_type(), wb_region(), wb_source(), wb_topic()

Examples



# search for indicators related to GDP
wb_search("GDP")

# restrict the search to the indicator name
wb_search("unemployment", fields = "name")

# case-sensitive fixed-string match
wb_search("GDP", ignore.case = FALSE, fixed = TRUE)



worldbank documentation built on June 29, 2026, 9:07 a.m.