Python function: getLatestPrice()
| Specification | Value |
|---|
| Delivery Frequency | continuous |
| Data Frequency | real-time snapshot |
| Reporting Lag | Real-time (with fallback to previous close) |
| Coverage | All asset classes: equities, indices, crypto, forex, options, tokenized assets |
| Availability | Free |
Product Overview
Overview
Latest Price Snapshot provides a single unified function to retrieve the most recent price for any supported asset class — equities, ETFs, indices, cryptocurrencies, forex, options, and tokenized assets. It returns one row per ticker with the price and a timestamp indicating when that price was observed.
This is the simplest way to get a current price quote across Scalar Field’s full asset universe.
Data Pipeline
The function automatically routes each ticker to the appropriate real-time data source based on its asset class:
| Asset Class | Routing | Source |
|---|
Equities/ETFs (e.g., AAPL, SPY) | Real-time snapshot API | Consolidated exchange feed snapshot |
Indices (e.g., I:SPX, I:VIX) | Real-time snapshot API | Exchange-disseminated index values |
Crypto (e.g., X:BTCUSD) | Real-time snapshot API | Multi-exchange aggregated prices |
Forex (e.g., C:EURUSD) | Real-time snapshot API | Institutional BBO quotes |
Options (e.g., AAPL260213C00280000) | Live options quote | 1-minute strike-level options data; price is the theoretical mid-value |
Tokenized assets (e.g., T:AAPLx, T:SPACEX) | Jupiter Price API | Real-time on-chain prices from Jupiter, the primary Solana DEX aggregator |
Fallback Behavior
If the real-time snapshot is unavailable for a ticker (e.g., outside of market hours), the system falls back to the most recent previous close.
Coverage
- Equities/ETFs: 10,000+ U.S.-listed symbols.
- Indices: Major U.S. indices (
I:SPX, I:DJI, I:VIX, etc.).
- Crypto: All major cryptocurrency pairs (
X:BTCUSD, X:ETHUSD, etc.).
- Forex: 1,750+ currency pairs (
C:EURUSD, C:GBPUSD, etc.).
- Options: Any valid OPRA symbol.
- Tokenized assets: 74 tokens (
T:AAPLx, T:SPACEX, etc.).
Querying the Data
Basic Usage
from scalarlib import getLatestPrice
# Single equity
prices = getLatestPrice(tickers=['AAPL'])
print(prices['AAPL'])
# Cross-asset snapshot
prices = getLatestPrice(tickers=[
'AAPL', # equity
'I:SPX', # index
'X:BTCUSD', # crypto
'C:EURUSD', # forex
'AAPL260919C00250000', # option
'T:NVDAx', # tokenized equity
'T:OPENAI', # tokenized pre-IPO
])
for ticker, df in prices.items():
if not df.empty:
print(f"{ticker}: ${df['price'].iloc[0]:.2f} at {df['ts_recv'].iloc[0]}")
Parameters
| Parameter | Type | Required | Description |
|---|
tickers | list of str | Yes | Any combination of ticker types. The function auto-detects asset class from the ticker format. |
Column Definitions
Latest Price Schema
| Column | Type | Description |
|---|
ticker | string | The ticker symbol as provided (e.g., AAPL, I:SPX, X:BTCUSD). |
price | float64 | The most recent price. For options, this is the theoretical mid-value from the latest 1-minute snapshot. |
ts_recv | datetime64[ns] | Timestamp of the price observation (New York time for all asset classes). |