get_public_instruments: Get instrument metadata

View source: R/wrappers_get_market.R

get_public_instrumentsR Documentation

Get instrument metadata

Description

Retrieve metadata for instruments of a given type.

Usage

get_public_instruments(
  inst_id = NULL,
  inst_type = "SWAP",
  config = NULL,
  tz = .okx_default_tz
)

Arguments

inst_id

Character or 'NULL'. Specific instrument ID to query. Use 'NULL' to fetch all instruments of 'inst_type'.

inst_type

Character. Instrument type. One of '"SPOT"', '"MARGIN"', '"SWAP"' (default), '"FUTURES"', '"OPTION"'.

config

Optional list. Public endpoint request options, such as 'timeout'; credentials are not required.

tz

Character. Time zone for parsing timestamps. Default '"Asia/Hong_Kong"'.

Details

Wraps '/api/v5/public/instruments'. Returns one row per instrument, including contract specifications, tick size, lot size, expiry, and state.

Value

A 'data.frame' with instrument metadata (e.g., 'instType', 'instId', 'uly', 'baseCcy', 'quoteCcy', 'settleCcy', 'ctVal', 'ctMult', 'tickSz', 'lotSz', 'minSz', 'expTime', 'lever', 'state', ...).

Note

Since okxr 0.1.2

See Also

[get_public_mark_price()]

Examples

## Not run: 
cfg <- list(api_key = "xxx", secret_key = "xxx", passphrase = "xxx")
# Get metadata for all SWAP instruments
df <- get_public_instruments(inst_type = "SWAP", config = cfg)

# Get metadata for one instrument
get_public_instruments("ETH-USDT-SWAP", inst_type = "SWAP", config = cfg)

## End(Not run)


okxr documentation built on May 8, 2026, 5:09 p.m.