Market Data¶
Market Data Resource¶
composer.resources.market_data.MarketData
¶
Resource for market data endpoints.
Source code in composer/resources/market_data.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | |
get_custom_bars(symbol, range_date_from=None, range_date_to=None, range_preset=None)
¶
Get custom bars market data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
The symbol to get bars for (e.g., "AAPL", "BTC-USD") |
required |
range_date_from
|
str | None
|
Start date (YYYY-MM-DD format) |
None
|
range_date_to
|
str | None
|
End date (YYYY-MM-DD format) |
None
|
range_preset
|
str | None
|
Preset range (e.g., "1M", "3M", "1Y", "5Y") |
None
|
Returns¶
CustomBars with OHLCV data
Source code in composer/resources/market_data.py
get_market_overview(symbol)
¶
Get an overview of reference data for a symbol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
The symbol to get overview for (e.g., "AAPL", "BTC-USD") |
required |
Returns¶
MarketOverview with company info, market cap, etc.
Source code in composer/resources/market_data.py
get_options_chain(underlying, next_cursor=None, strike_price=None, expiry=None, contract_type=None, order=SortOrder.ASC, limit=None, sort_by=OptionSortBy.SYMBOL)
¶
Get options chain for a specific underlying asset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
underlying
|
str
|
The underlying asset symbol (e.g., "AAPL") |
required |
next_cursor
|
str | None
|
Pagination cursor for fetching the next page |
None
|
strike_price
|
float | None
|
Filter by specific strike price |
None
|
expiry
|
str | None
|
Filter by expiration date (YYYY-MM-DD format) |
None
|
contract_type
|
ContractType | None
|
Filter by option type (CALL or PUT) |
None
|
order
|
SortOrder
|
Sort order for results |
ASC
|
limit
|
int | None
|
Maximum number of results to return (max 250) |
None
|
sort_by
|
OptionSortBy
|
Field to sort results by |
SYMBOL
|
Returns¶
OptionsChainResponse with list of options contracts
Source code in composer/resources/market_data.py
get_options_contract(symbol)
¶
Get market data for a specific options contract.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
The options contract symbol (e.g., "OPTIONS::AAPL250718C00210000//USD") |
required |
Returns¶
OptionsContractResponse with contract market data
Source code in composer/resources/market_data.py
get_options_overview(symbol)
¶
Get an overview of options data for a given ticker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
The underlying asset symbol (e.g., "AAPL") |
required |
Returns¶
OptionsOverview with available expiration dates
Source code in composer/resources/market_data.py
get_snapshot(symbol)
¶
Get a snapshot of live market data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
The symbol to get snapshot for (e.g., "AAPL", "BTC-USD") |
required |
Returns¶
MarketSnapshot with bid, ask, last trade, and change data
Source code in composer/resources/market_data.py
Quotes Resource¶
composer.resources.quotes.Quotes
¶
Resource for quote endpoints.
Source code in composer/resources/quotes.py
get_quotes(tickers)
¶
Get realtime crypto and (15-minute delayed) equity quotes.
If equity markets are closed, returns the last close price.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tickers
|
list[str]
|
List of tickers to get quotes for (e.g., ["AAPL", "CRYPTO::BTC//USD"]) |
required |
Returns¶
Dict mapping ticker to QuoteResult