% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/projects.R
\name{wb_project}
\alias{wb_project}
\title{World Bank project data}
\source{
\url{https://search.worldbank.org/api/v2/projects}
}
\usage{
wb_project(
  id = NULL,
  country = NULL,
  status = NULL,
  region = NULL,
  search = NULL,
  start_date = NULL,
  end_date = NULL
)
}
\arguments{
\item{id}{(\code{NULL} | \code{character()})\cr
Project ID(s) to query, e.g. \code{"P163868"} or \code{c("P163868", "P180429")}. Default \code{NULL}.
If provided, other filters are ignored.}

\item{country}{(\code{NULL} | \code{character()})\cr
Two-character World Bank country code(s) to filter by, e.g. \code{"BR"} or \code{c("BR", "IN")}.
Regional aggregates such as \code{"1W"} (World) or \code{"3A"} (Africa) are also accepted. Matching is
case insensitive, and projects for any of the given codes are returned. Default \code{NULL}.}

\item{status}{(\code{NULL} | \code{character()})\cr
Project status(es) to filter by, each one of \code{"active"}, \code{"closed"}, \code{"dropped"}, or
\code{"pipeline"}. Projects with any of the given statuses are returned. Default \code{NULL}.}

\item{region}{(\code{NULL} | \code{character()})\cr
Region name(s) to filter by, e.g. \code{"South Asia"}. Matching is case insensitive and by
substring, so \code{"Africa"} also matches \code{"Eastern and Southern Africa"} and
\code{"Middle East and North Africa"}. Projects matching any of the given names are returned.
Default \code{NULL}.}

\item{search}{(\code{NULL} | \code{character(1)})\cr
Free-text search term. Default \code{NULL}.}

\item{start_date}{(\code{NULL} | \code{character(1)})\cr
Board approval start date in \code{"YYYY-MM-DD"} format. Default \code{NULL}.}

\item{end_date}{(\code{NULL} | \code{character(1)})\cr
Board approval end date in \code{"YYYY-MM-DD"} format. Default \code{NULL}.}
}
\value{
A \code{data.frame()} with World Bank project data. The columns are:
\itemize{
\item \code{id}: The project ID.
\item \code{project_name}: The project name.
\item \code{status}: The project status.
\item \code{approval_date}: The board approval date.
\item \code{closing_date}: The closing date.
\item \code{country_code}: The ISO country code.
\item \code{country}: The country name.
\item \code{region}: The region name.
\item \code{total_commitment}: The total commitment amount in millions USD.
\item \code{ibrd_commitment}: The IBRD commitment amount in millions USD.
\item \code{ida_commitment}: The IDA commitment amount in millions USD.
\item \code{lending_instrument}: The lending instrument type.
\item \code{borrower}: The borrower name.
\item \code{implementing_agency}: The implementing agency name.
\item \code{url}: The project URL.
}
}
\description{
Query World Bank project data from the Projects API.
}
\examples{
\dontshow{if (httr2::is_online()) withAutoprint(\{ # examplesIf}
\donttest{
# active projects in Brazil related to education
wb_project(country = "BR", status = "active", search = "education")

# active or pipeline projects across two countries
wb_project(country = c("BR", "IN"), status = c("active", "pipeline"))

# look up specific projects
wb_project(id = c("P163868", "P180429"))
}
\dontshow{\}) # examplesIf}
}
\concept{projects data}
