wb_indicator: World Bank indicator data

View source: R/indicators.R

wb_indicatorR Documentation

World Bank indicator data

Description

List all indicators supported by the World Bank API.

Usage

wb_indicator(indicator = NULL, lang = "en", source = NULL)

Arguments

indicator

(NULL | character(1))
Indicator to query. Default NULL. If NULL, all indicators are returned.

lang

(character(1))
Language to query. Default "en".

source

(NULL | integer(1))
ID of the source to query, as listed by wb_source(). Default NULL, which uses the API default.

Value

A data.frame() with the available indicators. Since an indicator can have several topics, topic_id and topic_value hold all of them separated by ⁠;⁠, which never occurs within a value, or NA if there are none. Use strsplit(x, ";") to split them, or a pattern such as "(^|;)Health(;|$)" to match a single topic exactly. The columns are:

  • id: The indicator ID.

  • name: The indicator name.

  • unit: The indicator unit.

  • source_id: The source ID.

  • source_value: The source value.

  • source_note: The source note.

  • source_organization: The source organization.

  • topic_id: The topic IDs, as listed by wb_topic().

  • topic_value: The topic names, in the same order as topic_id.

Source

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

See Also

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

Examples



wb_indicator("NY.GDP.MKTP.CD")

# an indicator can have several topics, separated by `;`
ind <- wb_indicator("SE.ENR.PRSC.FM.ZS")
ind[c("topic_id", "topic_value")]
strsplit(ind$topic_value, ";")



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