% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gho.R
\name{gho_data}
\alias{gho_data}
\title{Fetch GHO Data}
\usage{
gho_data(
  indicator,
  spatial_type = NULL,
  area = NULL,
  year_from = NULL,
  year_to = NULL
)
}
\arguments{
\item{indicator}{Character scalar. The indicator code
(e.g. \code{"NCDMORT3070"}). Use \code{\link[=gho_indicators]{gho_indicators()}} to find codes.}

\item{spatial_type}{Character. Spatial dimension to filter on:
one of \code{"country"}, \code{"region"}, \code{"global"}, or \code{NULL} (all
levels, the default).}

\item{area}{Character vector of country or region codes
(e.g. \code{c("FRA", "DEU")}). Default \code{NULL} returns all areas.}

\item{year_from}{Numeric. Start year filter (inclusive).
Default \code{NULL}.}

\item{year_to}{Numeric. End year filter (inclusive).
Default \code{NULL}.}
}
\value{
A \link[tibble:tibble]{tibble} of indicator observations, or
an empty tibble when the service is unreachable.
}
\description{
Retrieves observations for a specific indicator from the WHO GHO
OData API, with optional filters by spatial level, country /
region and year range.
}
\examples{
\donttest{
# Country-level data for one indicator
gho_data("NCDMORT3070", spatial_type = "country")

# Specific countries and years
gho_data("WHOSIS_000001", area = c("FRA", "DEU"), year_from = 2015)
}
}
\seealso{
\code{\link[=gho_indicators]{gho_indicators()}}, \code{\link[=gho_dimensions]{gho_dimensions()}}.
}
