% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nbp.R
\name{nbp_fx_rates}
\alias{nbp_fx_rates}
\title{Fetch National Bank of Poland (NBP) exchange rates}
\source{
\url{https://api.nbp.pl/en.html}
}
\usage{
nbp_fx_rates(
  table,
  code = NULL,
  start_date = NULL,
  end_date = NULL,
  last_n = NULL
)
}
\arguments{
\item{table}{(\code{character(1)})\cr
Table type: \code{"a"} (mid rates, major currencies), \code{"b"} (mid rates, less common currencies),
or \code{"c"} (bid/ask rates).}

\item{code}{(\code{NULL} | \code{character(1)})\cr
ISO 4217 currency code (e.g. \code{"usd"}, \code{"eur"}). If \code{NULL}, returns all currencies.}

\item{start_date}{(\code{NULL} | \code{character(1)} | \code{Date(1)})\cr
Start date of the data.}

\item{end_date}{(\code{NULL} | \code{character(1)} | \code{Date(1)})\cr
End date of the data.}

\item{last_n}{(\code{NULL} | \code{integer(1)})\cr
Return only the last \code{n} quotations.}
}
\value{
A \code{\link[data.table:data.table]{data.table::data.table()}} with exchange rates.
}
\description{
Retrieve foreign currency exchange rates from the NBP Web API.
}
\examples{
\dontshow{if (curl::has_internet()) withAutoprint(\{ # examplesIf}
\donttest{
nbp_fx_rates("a", "eur")
}
\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_gold]{nbp_gold()}},
\code{\link[=nob_data]{nob_data()}},
\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}
