% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/indicators.R
\name{wb_search}
\alias{wb_search}
\title{Search World Bank indicators}
\source{
\url{https://api.worldbank.org/v2/indicator}
}
\usage{
wb_search(
  pattern,
  fields = c("id", "name", "source_note"),
  catalog = NULL,
  lang = "en",
  ignore.case = TRUE,
  ...
)
}
\arguments{
\item{pattern}{(\code{character(1)})\cr
Regular expression to match.}

\item{fields}{(\code{character()})\cr
Columns of the indicator catalog to search. Default \code{c("id", "name", "source_note")}.}

\item{catalog}{(\code{NULL} | \code{data.frame()})\cr
Optional pre-fetched indicator catalog. If \code{NULL} (default), \code{\link[=wb_indicator]{wb_indicator()}} is called.}

\item{lang}{(\code{character(1)})\cr
Language to query. Only used when \code{catalog} is \code{NULL}. Default \code{"en"}.}

\item{ignore.case}{(\code{logical(1)})\cr
Whether the match should be case insensitive. Default \code{TRUE}.}

\item{...}{(\code{any})\cr
Additional arguments passed to \code{\link[=grepl]{grepl()}}.}
}
\value{
A \code{data.frame()} with the matching rows of the indicator catalog.
}
\description{
Search the indicator catalog returned by \code{\link[=wb_indicator]{wb_indicator()}} for a regular expression
pattern across one or more text fields. By default the match is case insensitive.
}
\examples{
\dontshow{if (httr2::is_online()) withAutoprint(\{ # examplesIf}
\donttest{
# 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)
}
\dontshow{\}) # examplesIf}
}
\seealso{
Other indicators data:
\code{\link[=wb_bulk]{wb_bulk()}},
\code{\link[=wb_country]{wb_country()}},
\code{\link[=wb_data]{wb_data()}},
\code{\link[=wb_income_level]{wb_income_level()}},
\code{\link[=wb_indicator]{wb_indicator()}},
\code{\link[=wb_language]{wb_language()}},
\code{\link[=wb_lending_type]{wb_lending_type()}},
\code{\link[=wb_region]{wb_region()}},
\code{\link[=wb_source]{wb_source()}},
\code{\link[=wb_topic]{wb_topic()}}
}
\concept{indicators data}
