Market Data

We’ve seen how the streamer can be used to get quotes continually throughout the day, which is very helpful. However, sometimes we just need to get data once, which makes setting up a streamer, subscribing to events, and listening for them more complex than need be.

Fortunately, Tastytrade has endpoints that make fetching data for one-time use a breeze:

from tastytrade.market_data import get_market_data
from tastytrade.order import InstrumentType

data = await get_market_data(session, "SPY", InstrumentType.EQUITY)
print(data)
>>> symbol='SPY' instrument_type=<InstrumentType.EQUITY: 'Equity'> updated_at=datetime.datetime(2025, 4, 28, 21, 46, 48, 84000, tzinfo=TzInfo(UTC)) bid_size=Decimal('2.0') ask_size=Decimal('4.0') mark=Decimal('549.96') close_price_type=<ClosePriceType.FINAL: 'Final'> prev_close=Decimal('550.64') prev_close_price_type=<ClosePriceType.FINAL: 'Final'> summary_date=datetime.date(2025, 4, 28) prev_close_date=datetime.date(2025, 4, 25) halt_start_time=-1 halt_end_time=-1 ask=Decimal('550.0') beta=Decimal('1.009463163') bid=Decimal('549.9') close=Decimal('550.85') day_high_price=Decimal('553.55') day_low_price=Decimal('545.02') dividend_amount=Decimal('1.695528') dividend_frequency=Decimal('4.0') high_limit_price=Decimal('606.41') last=Decimal('549.96') last_mkt=Decimal('550.85') low_limit_price=Decimal('496.16') mid=Decimal('549.95') open=Decimal('551.39') volume=Decimal('47417792.0') year_low_price=Decimal('481.8') year_high_price=Decimal('613.23')

You can also fetch data for multiple symbols at once:

from tastytrade.market_data import get_market_data_by_type

data = await get_market_data_by_type(
     session,
     indices=["SPX", "VIX"],
     cryptocurrencies=["ETH/USD", "BTC/USD"],
     equities=["SPLG", "SPY"],
     futures=["/MCLG6", "/MCLF6"],
     future_options=["./MCLM5MW2K5 250509C62.5", "./MCLM5MW2K5 250509P65.75"],
     options=["SPLG  250516C00048000", "SPLG  250516P00054000"],
)
print(data)
>>> [MarketData(symbol='SPLG  250516C00048000' instrument_type=<InstrumentType.EQUITY_OPTION: 'Equity Option'> updated_at=datetime.datetime(2025, 4, 28, 21, 30, 5, 358000, tzinfo=TzInfo(UTC)) bid_size=Decimal('28.0') ask_size=Decimal('62.0') mark=Decimal('16.8') close_price_type=<ClosePriceType.REGULAR: 'Regular'> prev_close=Decimal('12.3') prev_close_price_type=<ClosePriceType.REGULAR: 'Regular'> summary_date=datetime.date(2025, 4, 28) prev_close_date=datetime.date(2025, 4, 21) halt_start_time=-1 halt_end_time=-1 ask=Decimal('17.4') bid=Decimal('16.2') day_high_price=Decimal('12.99') day_low_price=Decimal('12.3') last=Decimal('12.3') last_mkt=Decimal('12.3') mid=Decimal('16.8') open=Decimal('12.99') volume=Decimal('4.0')), MarketData(symbol='BTC/USD' instrument_type=<InstrumentType.CRYPTOCURRENCY: 'Cryptocurrency'> updated_at=datetime.datetime(2025, 4, 28, 21, 46, 15, 630000, tzinfo=TzInfo(UTC)) bid_size=Decimal('0.222') mark=Decimal('94370.795') close_price_type=<ClosePriceType.REGULAR: 'Regular'> prev_close=Decimal('93797.555') prev_close_price_type=<ClosePriceType.REGULAR: 'Regular'> summary_date=datetime.date(2025, 4, 28) prev_close_date=datetime.date(2025, 4, 27) halt_start_time=-1 halt_end_time=-1 ask=Decimal('94848.23') bid=Decimal('93893.36') day_high_price=Decimal('95581.855') day_low_price=Decimal('93476.925') last=Decimal('94388.57') last_mkt=Decimal('94370.8') mid=Decimal('94370.795') open=Decimal('93795.825') year_low_price=Decimal('49149.415') year_high_price=Decimal('109558.42')), MarketData(symbol='ETH/USD' instrument_type=<InstrumentType.CRYPTOCURRENCY: 'Cryptocurrency'> updated_at=datetime.datetime(2025, 4, 28, 21, 46, 40, 633000, tzinfo=TzInfo(UTC)) bid_size=Decimal('11.09900497') ask_size=Decimal('11.0') mark=Decimal('1786.455') close_price_type=<ClosePriceType.REGULAR: 'Regular'> prev_close=Decimal('1788.33') prev_close_price_type=<ClosePriceType.REGULAR: 'Regular'> summary_date=datetime.date(2025, 4, 28) prev_close_date=datetime.date(2025, 4, 27) halt_start_time=-1 halt_end_time=-1 ask=Decimal('1795.59') bid=Decimal('1777.32') day_high_price=Decimal('1828.26') day_low_price=Decimal('1745.165') last=Decimal('1786.46') last_mkt=Decimal('1786.46') mid=Decimal('1786.455') open=Decimal('1788.345') year_low_price=Decimal('1384.31') year_high_price=Decimal('4109.98')), MarketData(symbol='VIX' instrument_type=<InstrumentType.EQUITY: 'Equity'> updated_at=datetime.datetime(2025, 4, 28, 20, 15, 1, 568000, tzinfo=TzInfo(UTC)) mark=Decimal('25.15') close_price_type=<ClosePriceType.REGULAR: 'Regular'> prev_close=Decimal('24.84') prev_close_price_type=<ClosePriceType.REGULAR: 'Regular'> summary_date=datetime.date(2025, 4, 28) prev_close_date=datetime.date(2025, 4, 25) halt_start_time=-1 halt_end_time=-1 beta=Decimal('-6.538134414') day_high_price=Decimal('26.93') day_low_price=Decimal('24.7') last=Decimal('25.15') last_mkt=Decimal('25.15') open=Decimal('25.75') year_low_price=Decimal('10.62') year_high_price=Decimal('65.73')), MarketData(symbol='/MCLG6' instrument_type=<InstrumentType.FUTURE: 'Future'> updated_at=datetime.datetime(2025, 4, 28, 21, 40, 0, 903000, tzinfo=TzInfo(UTC)) mark=Decimal('59.44') close_price_type=<ClosePriceType.REGULAR: 'Regular'> prev_close=Decimal('59.87') prev_close_price_type=<ClosePriceType.PRELIMINARY: 'Preliminary'> summary_date=datetime.date(2025, 4, 29) prev_close_date=datetime.date(2025, 4, 28) halt_start_time=-1 halt_end_time=-1 ask=Decimal('60.08') bid=Decimal('59.3') day_high_price=Decimal('60.3') day_low_price=Decimal('59.44') last=Decimal('59.44') last_mkt=Decimal('59.44') mid=Decimal('59.69') open=Decimal('60.3') volume=Decimal('5.0')), MarketData(symbol='/MCLF6' instrument_type=<InstrumentType.FUTURE: 'Future'> updated_at=datetime.datetime(2025, 4, 28, 21, 40, 0, 905000, tzinfo=TzInfo(UTC)) bid_size=Decimal('1.0') ask_size=Decimal('1.0') mark=Decimal('60.5') close_price_type=<ClosePriceType.REGULAR: 'Regular'> prev_close=Decimal('59.87') prev_close_price_type=<ClosePriceType.PRELIMINARY: 'Preliminary'> summary_date=datetime.date(2025, 4, 29) prev_close_date=datetime.date(2025, 4, 28) halt_start_time=-1 halt_end_time=-1 ask=Decimal('62.18') bid=Decimal('57.0') day_high_price=Decimal('60.5') day_low_price=Decimal('59.9') last=Decimal('60.5') last_mkt=Decimal('60.5') mid=Decimal('59.59') open=Decimal('59.9') volume=Decimal('2.0')), MarketData(symbol='./MCLM5MW2K5 250509C62.5' instrument_type=<InstrumentType.FUTURE_OPTION: 'Future Option'> updated_at=datetime.datetime(2025, 4, 28, 21, 30, 2, 211000, tzinfo=TzInfo(UTC)) mark=Decimal('1.479701886') close_price_type=<ClosePriceType.REGULAR: 'Regular'> prev_close_price_type=<ClosePriceType.INDICATIVE: 'Indicative'> summary_date=datetime.date(2025, 4, 29) prev_close_date=datetime.date(2025, 4, 25) halt_start_time=-1 halt_end_time=-1 ask=Decimal('2.19') bid=Decimal('0.91') mid=Decimal('1.55')), MarketData(symbol='SPX' instrument_type=<InstrumentType.INDEX: 'Index'> updated_at=datetime.datetime(2025, 4, 28, 20, 53, 27, 551000, tzinfo=TzInfo(UTC)) mark=Decimal('5509.565') close_price_type=<ClosePriceType.REGULAR: 'Regular'> prev_close=Decimal('5525.21') prev_close_price_type=<ClosePriceType.REGULAR: 'Regular'> summary_date=datetime.date(2025, 4, 28) prev_close_date=datetime.date(2025, 4, 25) halt_start_time=-1 halt_end_time=-1 ask=Decimal('5576.76') beta=Decimal('1.0') bid=Decimal('5442.37') day_high_price=Decimal('5553.66') day_low_price=Decimal('5468.64') last=Decimal('5528.75') last_mkt=Decimal('5528.75') mid=Decimal('5509.565') open=Decimal('5529.22') year_low_price=Decimal('4835.04') year_high_price=Decimal('6147.43')), MarketData(symbol='SPLG  250516P00054000' instrument_type=<InstrumentType.EQUITY_OPTION: 'Equity Option'> updated_at=datetime.datetime(2025, 4, 28, 21, 31, 33, 779000, tzinfo=TzInfo(UTC)) bid_size=Decimal('1.0') ask_size=Decimal('11.0') mark=Decimal('0.075') close_price_type=<ClosePriceType.REGULAR: 'Regular'> prev_close=Decimal('0.1') prev_close_price_type=<ClosePriceType.REGULAR: 'Regular'> summary_date=datetime.date(2025, 4, 28) prev_close_date=datetime.date(2025, 4, 25) halt_start_time=-1 halt_end_time=-1 ask=Decimal('0.1') bid=Decimal('0.05') close=Decimal('0.05') day_high_price=Decimal('0.1') day_low_price=Decimal('0.05') last=Decimal('0.05') last_mkt=Decimal('0.05') mid=Decimal('0.075') open=Decimal('0.1') volume=Decimal('2.0')), MarketData(symbol='SPY' instrument_type=<InstrumentType.EQUITY: 'Equity'> updated_at=datetime.datetime(2025, 4, 28, 21, 46, 48, 84000, tzinfo=TzInfo(UTC)) bid_size=Decimal('2.0') ask_size=Decimal('4.0') mark=Decimal('549.96') close_price_type=<ClosePriceType.FINAL: 'Final'> prev_close=Decimal('550.64') prev_close_price_type=<ClosePriceType.FINAL: 'Final'> summary_date=datetime.date(2025, 4, 28) prev_close_date=datetime.date(2025, 4, 25) halt_start_time=-1 halt_end_time=-1 ask=Decimal('550.0') beta=Decimal('1.009463163') bid=Decimal('549.9') close=Decimal('550.85') day_high_price=Decimal('553.55') day_low_price=Decimal('545.02') dividend_amount=Decimal('1.695528') dividend_frequency=Decimal('4.0') high_limit_price=Decimal('606.41') last=Decimal('549.96') last_mkt=Decimal('550.85') low_limit_price=Decimal('496.16') mid=Decimal('549.95') open=Decimal('551.39') volume=Decimal('47417792.0') year_low_price=Decimal('481.8') year_high_price=Decimal('613.23')), MarketData(symbol='SPLG' instrument_type=<InstrumentType.EQUITY: 'Equity'> updated_at=datetime.datetime(2025, 4, 28, 21, 46, 25, 333000, tzinfo=TzInfo(UTC)) bid_size=Decimal('1.0') ask_size=Decimal('1.0') mark=Decimal('64.73') close_price_type=<ClosePriceType.FINAL: 'Final'> prev_close=Decimal('64.74') prev_close_price_type=<ClosePriceType.FINAL: 'Final'> summary_date=datetime.date(2025, 4, 28) prev_close_date=datetime.date(2025, 4, 25) halt_start_time=-1 halt_end_time=-1 ask=Decimal('64.75') beta=Decimal('1.008512722') bid=Decimal('64.68') close=Decimal('64.8') day_high_price=Decimal('65.1') day_low_price=Decimal('64.11') dividend_amount=Decimal('0.217412') dividend_frequency=Decimal('4.0') high_limit_price=Decimal('71.34') last=Decimal('64.73') last_mkt=Decimal('64.8') low_limit_price=Decimal('58.37') mid=Decimal('64.715') open=Decimal('64.86') volume=Decimal('7159762.0') year_low_price=Decimal('56.6699') year_high_price=Decimal('72.14')), MarketData(symbol='./MCLM5MW2K5 250509P65.75' instrument_type=<InstrumentType.FUTURE_OPTION: 'Future Option'> updated_at=datetime.datetime(2025, 4, 28, 21, 30, 2, 58000, tzinfo=TzInfo(UTC)) mark=Decimal('4.26456101') close_price_type=<ClosePriceType.REGULAR: 'Regular'> prev_close_price_type=<ClosePriceType.INDICATIVE: 'Indicative'> summary_date=datetime.date(2025, 4, 29) prev_close_date=datetime.date(2025, 4, 25) halt_start_time=-1 halt_end_time=-1 ask=Decimal('4.62') bid=Decimal('3.7') mid=Decimal('4.16'))]