View Source AlphaVantage.Forex (Alpha Vantage v0.3.0)

A set of functions for fetching forex (FX) rates from Alpha Vantage.

Summary

Functions

Returns the daily time series (timestamp, open, high, low, close) of the FX currency pair specified, updated realtime.

Returns the realtime exchange rate for any pair of digital currency (e.g., Bitcoin) and physical currency (e.g., USD). Data returned for physical currency (Forex) pairs also include realtime bid and ask prices.

Returns the intraday time series (timestamp, open, high, low, close) of the FX currency pair specified, updated realtime.

Returns the monthly time series (timestamp, open, high, low, close) of the FX currency pair specified, updated realtime. The latest data point is the prices information for the month (or partial month) containing the current trading day, updated realtime.

Returns the weekly time series (timestamp, open, high, low, close) of the FX currency pair specified, updated realtime. The latest data point is the prices information for the week (or partial week) containing the current trading day, updated realtime.

Functions

Link to this function

daily(from_symbol, to_symbol, opts \\ [])

View Source
@spec daily(String.t(), String.t(), Keyword.t()) :: AlphaVantage.Gateway.response()

Returns the daily time series (timestamp, open, high, low, close) of the FX currency pair specified, updated realtime.

Please reference https://www.alphavantage.co/documentation/#fx-daily for more detail.

Parameters

Required

  • :from_currency

    The currency you would like to get the exchange rate for. It can either be a physical currency or digital/crypto currency. For example: "USD", "EUR", or "BTC"

  • :to_currency

    The destination currency for the exchange rate. It can either be a physical currency or digital/crypto currency. For example: "USD", "EUR", or "BTC"

Optional (accepted as a keyword list)

  • :datatype

    • "map" returns a map (default);
    • "json" returns JSON format;
    • "csv" returns a CSV (comma separated value) file string.
  • :outputsize

    • "compact" returns only the latest 100 data points in the intraday time series (default);
    • "full" returns the full-length intraday time series.

    The "compact" option is recommended if you would like to reduce the data size of each API call.

Link to this function

exchange_rate(from_currency, to_currency, opts \\ [])

View Source
@spec exchange_rate(String.t(), String.t(), Keyword.t()) ::
  AlphaVantage.Gateway.response()

Returns the realtime exchange rate for any pair of digital currency (e.g., Bitcoin) and physical currency (e.g., USD). Data returned for physical currency (Forex) pairs also include realtime bid and ask prices.

Please reference https://www.alphavantage.co/documentation/#currency-exchange for more detail.

Parameters

Required

  • :from_currency

    The currency you would like to get the exchange rate for. It can either be a physical currency or digital/crypto currency. For example: "USD", "EUR", or "BTC"

  • :to_currency

    The destination currency for the exchange rate. It can either be a physical currency or digital/crypto currency. For example: "USD", "EUR", or "BTC"

Optional (accepted as a keyword list)

  • :datatype

    By default, datatype: "map". Strings "map" and "json" are accepted with the following specifications:

    • "map" returns a map (default);
    • "json" returns JSON format;

    *Please note that "csv" and is not yet supported by Alpha Vantage for this function.

Link to this function

intraday(from_symbol, to_symbol, interval, opts \\ [])

View Source
@spec intraday(String.t(), String.t(), String.t(), Keyword.t()) ::
  AlphaVantage.Gateway.response()

Returns the intraday time series (timestamp, open, high, low, close) of the FX currency pair specified, updated realtime.

Please reference https://www.alphavantage.co/documentation/#fx-intraday for more detail.

Parameters

Required

  • :from_symbol

    The currency you would like to get the exchange rate for. It can either be a physical currency or digital/crypto currency. For example: "USD", "EUR", or "BTC"

  • :to_symbol

    The destination currency for the exchange rate. It can either be a physical currency or digital/crypto currency. For example: "USD", "EUR", or "BTC"

  • :interval

    Time interval between two consecutive data points in the time series. The following values are supported and accepted as strings: "1min", "5min", "15min", "30min", "60min"

Optional (accepted as a keyword list)

  • :datatype

    • "map" returns a map (default);
    • "json" returns JSON format;
    • "csv" returns a CSV (comma separated value) file string.
  • :outputsize

    • "compact" returns only the latest 100 data points in the intraday time series (default);
    • "full" returns the full-length intraday time series.

    The "compact" option is recommended if you would like to reduce the data size of each API call.

Link to this function

monthly(from_symbol, to_symbol, opts \\ [])

View Source
@spec monthly(String.t(), String.t(), Keyword.t()) :: AlphaVantage.Gateway.response()

Returns the monthly time series (timestamp, open, high, low, close) of the FX currency pair specified, updated realtime. The latest data point is the prices information for the month (or partial month) containing the current trading day, updated realtime.

Please reference https://www.alphavantage.co/documentation/#fx-monthly for more detail.

Parameters

Required

  • :from_currency

    The currency you would like to get the exchange rate for. It can either be a physical currency or digital/crypto currency. For example: "USD", "EUR", or "BTC"

  • :to_currency

    The destination currency for the exchange rate. It can either be a physical currency or digital/crypto currency. For example: "USD", "EUR", or "BTC"

Optional (accepted as a keyword list)

  • :datatype
    • "map" returns a map (default);
    • "json" returns JSON format;
    • "csv" returns a CSV (comma separated value) file string.
Link to this function

weekly(from_symbol, to_symbol, opts \\ [])

View Source
@spec weekly(String.t(), String.t(), Keyword.t()) :: AlphaVantage.Gateway.response()

Returns the weekly time series (timestamp, open, high, low, close) of the FX currency pair specified, updated realtime. The latest data point is the prices information for the week (or partial week) containing the current trading day, updated realtime.

Please reference https://www.alphavantage.co/documentation/#fx-weekly for more detail.

Parameters

Required

  • :from_currency

    The currency you would like to get the exchange rate for. It can either be a physical currency or digital/crypto currency. For example: "USD", "EUR", or "BTC"

  • :to_currency

    The destination currency for the exchange rate. It can either be a physical currency or digital/crypto currency. For example: "USD", "EUR", or "BTC"

Optional (accepted as a keyword list)

  • :datatype
    • "map" returns a map (default);
    • "json" returns JSON format;
    • "csv" returns a CSV (comma separated value) file string.