View Source NBP (nbp v0.1.0)

Link to this section Summary

Types

Three-letter currency code, as in ISO 4217. This is not case sensitive.

Currency table number. Daily currency rate tables receive unique numbers once they are published.

A currency table identifier. Currency rates are split between three tables, A, B and C and you have to pass appropriate table identifier for a given currency. This is not case sensitive.

Functions

Returns the exchange rate for given date, currency table and currency code or no data if no currency rates were published for given date. The oldest data available is from 2 Jan 2022.

Returns last count of exchange rates for given currency table and currency code.

Returns exchange rates for date range for given currency table and currency code or no data if no currency rates were published for given range. The maximum range is 93 days.

Returns the most recent exchange rate for given currency table and currency code.

Returns the exchange rate for today for given currency table and currency code or no data if no currency rate was published for today.

Link to this section Types

@type currency_code_t() :: charlist()

Three-letter currency code, as in ISO 4217. This is not case sensitive.

@type currency_table_no_t() :: String.t()

Currency table number. Daily currency rate tables receive unique numbers once they are published.

@type currency_table_t() :: 'A' | 'B' | 'C' | 'a' | 'b' | 'c'

A currency table identifier. Currency rates are split between three tables, A, B and C and you have to pass appropriate table identifier for a given currency. This is not case sensitive.

Link to this section Functions

Link to this function

exchange_rate_date(currency_table, currency_code, date)

View Source
@spec exchange_rate_date(currency_table_t(), currency_code_t(), Date.t()) ::
  {:ok, NBP.Tyles.ExchangeRatesSeries.t()} | {:error, any()}

Returns the exchange rate for given date, currency table and currency code or no data if no currency rates were published for given date. The oldest data available is from 2 Jan 2022.

Link to this function

exchange_rate_last(currency_table, currency_code, count)

View Source
@spec exchange_rate_last(currency_table_t(), currency_code_t(), pos_integer()) ::
  {:ok, NBP.Tyles.ExchangeRatesSeries.t()} | {:error, any()}

Returns last count of exchange rates for given currency table and currency code.

Link to this function

exchange_rate_range(currency_table, currency_code, start_date, end_date)

View Source
@spec exchange_rate_range(currency_table_t(), currency_code_t(), Date.t(), Date.t()) ::
  {:ok, NBP.Tyles.ExchangeRatesSeries.t()} | {:error, any()}

Returns exchange rates for date range for given currency table and currency code or no data if no currency rates were published for given range. The maximum range is 93 days.

Link to this function

exchange_rate_recent(currency_table, currency_code)

View Source
@spec exchange_rate_recent(currency_table_t(), currency_code_t()) ::
  {:ok, NBP.Tyles.ExchangeRatesSeries.t()} | {:error, any()}

Returns the most recent exchange rate for given currency table and currency code.

Link to this function

exchange_rate_today(currency_table, currency_code)

View Source
@spec exchange_rate_today(currency_table_t(), currency_code_t()) ::
  {:ok, NBP.Tyles.ExchangeRatesSeries.t()} | {:error, any()}

Returns the exchange rate for today for given currency table and currency code or no data if no currency rate was published for today.