% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nob.R
\name{nob_data}
\alias{nob_data}
\title{Fetch Norges Bank (NoB) data}
\source{
\url{https://www.norges-bank.no/en/topics/Statistics/open-data/}
}
\usage{
nob_data(
  flow,
  key = NULL,
  start_period = NULL,
  end_period = NULL,
  first_n = NULL,
  last_n = NULL
)
}
\arguments{
\item{flow}{(\code{character(1)})\cr
The dataflow to query. See \code{\link[=nob_metadata]{nob_metadata()}} for available dataflows.}

\item{key}{(\code{NULL} | \code{character(1)})\cr
The series key to query using dot-separated dimension values
(e.g., \code{"B.USD.NOK.SP"}). Use \code{+} for multiple values in one dimension
(e.g., \code{"B.USD+EUR.NOK.SP"}). If \code{NULL}, all data for the flow is returned.
Default \code{NULL}.}

\item{start_period}{(\code{NULL} | \code{character(1)} | \code{integer(1)})\cr
Start date of the data (e.g., \code{"2024-01-01"} or \code{2024}). If \code{NULL}, no start date restriction
is applied. Default \code{NULL}.}

\item{end_period}{(\code{NULL} | \code{character(1)} | \code{integer(1)})\cr
End date of the data, in the same format as start_period. If \code{NULL}, no end date restriction is
applied. Default \code{NULL}.}

\item{first_n}{(\code{NULL} | \code{numeric(1)})\cr
Number of observations to retrieve from the start of the series. If \code{NULL}, no restriction is
applied. Default \code{NULL}.}

\item{last_n}{(\code{NULL} | \code{numeric(1)})\cr
Number of observations to retrieve from the end of the series. If \code{NULL}, no restriction is
applied. Default \code{NULL}.}
}
\value{
A \code{\link[data.table:data.table]{data.table::data.table()}} with the requested data.
}
\description{
Retrieve time series data from the Norges Bank SDMX Web Service.
}
\examples{
\dontshow{if (curl::has_internet()) withAutoprint(\{ # examplesIf}
\donttest{
# fetch USD/NOK exchange rate
nob_data("EXR", "B.USD.NOK.SP", last_n = 5L)

# fetch multiple exchange rates
nob_data("EXR", "B.USD+EUR+GBP.NOK.SP", start_period = "2024-01-01")

# fetch policy rate
nob_data("IR", last_n = 5L)
}
\dontshow{\}) # examplesIf}
}
\seealso{
Other data:
\code{\link[=bbk_data]{bbk_data()}},
\code{\link[=bbk_series]{bbk_series()}},
\code{\link[=bde_data]{bde_data()}},
\code{\link[=bde_latest]{bde_latest()}},
\code{\link[=bdf_codelist]{bdf_codelist()}},
\code{\link[=bdf_data]{bdf_data()}},
\code{\link[=bdf_dataset]{bdf_dataset()}},
\code{\link[=bdp_data]{bdp_data()}},
\code{\link[=bis_data]{bis_data()}},
\code{\link[=boc_data]{boc_data()}},
\code{\link[=boe_data]{boe_data()}},
\code{\link[=boj_data]{boj_data()}},
\code{\link[=ecb_data]{ecb_data()}},
\code{\link[=nbp_fx_rates]{nbp_fx_rates()}},
\code{\link[=nbp_gold]{nbp_gold()}},
\code{\link[=onb_data]{onb_data()}},
\code{\link[=snb_data]{snb_data()}},
\code{\link[=srb_cross_rates]{srb_cross_rates()}},
\code{\link[=srb_data]{srb_data()}}
}
\concept{data}
