Learn R Programming

cryptoQuotes (version 1.3.0)

GET: GET-requests

Description

GET-requests

Usage

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

Value

A list crated by jsonlite::fromJSON()

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.

See Also

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

Examples

Run this code
# script: scr_GET
# date: 2024-02-28
# author: Serkan Korkmaz, serkor1@duck.com
# objective: An example on how to use the GET-function
# mostly for internal purposes
# script start;

if (FALSE) {
  exchange <- "bybit"
  futures  <- FALSE

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

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


  # 2) define parameters
  # that are passed into
  # GET
  queries <- list(
    symbol   = "BTCUSDT",
    category = "spot",
    limit    = 100,
    interval = "D"
  )


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

# script end;

Run the code above in your browser using DataLab