GET: GET-requests

View source: R/utils.R

GETR Documentation

GET-requests

Description

GET-requests

Usage

GET(url, endpoint = NULL, query = NULL, path = NULL)

Arguments

url

character of length 1. The baseurl

endpoint

character of length 1. The API endpoint

query

A named list of queries.

path

A list of paths.

Value

A list crated by jsonlite::fromJSON()

See Also

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

Examples

## Not run: 
  # script start;

  exchange <- "bybit"
  futures  <- FALSE

  # 1) define baseurl
  base_url <- cryptoQuotes:::baseUrl(
    source  = exchange,
    futures = futures
  )

  # 2) define endpoint
  end_point <- cryptoQuotes:::endPoint(
    source  = "bybit",
    futures = futures,
    type    = "ohlc"
  )

  # 2) define actual
  # parameters based on
  # API docs
  queries <- list(
    symbol   = "BTCUSDT",
    category = "spot",
    limit    = 100,
    interval = "D"
  )

  # 3) perform GET request
  cryptoQuotes:::GET(
    url      = base_url,
    endpoint = end_point,
    query    = queries
  )

  # script end;

## End(Not run)

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