fetch: Fetch time-based API-endpoint responses

View source: R/utils.R

fetchR Documentation

Fetch time-based API-endpoint responses

Description

[Experimental]

This function is a high-level wrapper around the development tools available and should reduce the amount of coding.

Usage

fetch(ticker, source, futures, interval, type, to, from, ...)

Arguments

ticker

A character-vector of length 1. See available_tickers() for available tickers.

source

A character-vector of length 1. binance by default. See available_exchanges() for available exchanges.

futures

A logical-vector of length 1. TRUE by default. Returns futures market if TRUE, spot market otherwise.

interval

A character-vector of length 1. ⁠1d⁠ by default. See available_intervals() for available intervals.

type

character-vector of length 1. One of,

  • "ohlc" - Available exchanges for Open, High, Low, Close and Volume market data. See the get_quote()-function.

  • "lsratio" - Available exchanges for Long-Short ratios. See the get_lsratio()-function.

  • "fundingrate" - Available exchanges for Funding rates. See the get_fundingrate()-function.

  • "interest" - Available exchanges for Open interest on perpetual contracts on both sides. See the get_openinterest()-function.

to

An optional character-, date- or POSIXct-vector of length 1. NULL by default.

from

An optional character-, date- or POSIXct-vector of length 1. NULL by default.

...

additional parameters passed down the endpoint

Details

This function can only be used to fetch time-based objects, and can therefore not be used to get, for example, available_tickers().

Value

It returns an xts::xts-object from the desired endpoint.

Author(s)

Serkan Korkmaz

See Also

Other development tools: GET(), chart_layout(), convert_date(), default_dates(), flatten(), is.date()


cryptoQuotes documentation built on April 4, 2025, 2:33 a.m.