Data API¶
The Data API provides access to market data for signal engines, backtests, and analytics. Data is loaded from files (CSV, Parquet, DataFrame, or dicts) using the load_bars method.
Loading Data (Local Mode)¶
load_bars¶
Loads bar data from a file, DataFrame, or list of dicts. Accepts CSV, Parquet, pandas DataFrame, or a list of dictionaries.
from meridian import SignalEngine
engine = SignalEngine()
# From CSV
engine.load_bars("AAPL", source="data/aapl_daily.csv")
# From Parquet
engine.load_bars("AAPL", source="data/aapl_daily.parquet")
# From pandas DataFrame
import pandas as pd
df = pd.read_csv("data/aapl_daily.csv")
engine.load_bars("AAPL", source=df)
# From list of dicts
engine.load_bars("AAPL", source=[
{"date": "2026-03-25", "open": 148.50, "high": 151.20, "low": 148.10, "close": 150.80, "volume": 52_000_000},
{"date": "2026-03-26", "open": 150.80, "high": 152.40, "low": 149.90, "close": 151.50, "volume": 48_000_000},
{"date": "2026-03-27", "open": 151.50, "high": 153.00, "low": 150.70, "close": 152.30, "volume": 55_000_000},
])
Column Name Flexibility¶
Column names are matched flexibly. The loader recognizes common variations and maps them to canonical fields.
| Canonical Field | Accepted Names |
|---|---|
date |
date, timestamp, ts, datetime, time |
open |
open, o, Open |
high |
high, h, High |
low |
low, l, Low |
close |
close, c, Close, adj_close |
volume |
volume, vol, v, Volume |
Canonical output fields are always: open, high, low, close, volume.
Querying Data¶
history¶
Returns historical bars for a symbol over a date range.
# Returns a pandas DataFrame by default
bars = engine.history("AAPL", start="2026-01-01", end="2026-03-27", interval="1d")
# Returns a list of Bar objects
bars = engine.history("AAPL", start="2026-01-01", end="2026-03-27", interval="1d", as_list=True)
for bar in bars:
print(bar.date, bar.close, bar.volume)
bars, err := client.Data.History(ctx, &data.HistoryRequest{
Symbol: "AAPL",
Start: time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC),
End: time.Date(2026, 3, 27, 0, 0, 0, 0, time.UTC),
Interval: data.IntervalDay1,
})
Supported intervals: tick, 1s, 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w, 1M.
available¶
Discovers loaded symbols and their bar counts.
# List all loaded symbols
symbols = engine.available()
# [{"symbol": "AAPL", "bars": 252, "start": "2025-03-28", "end": "2026-03-27"}, ...]
# Check a specific symbol
info = engine.available("AAPL")
# {"symbol": "AAPL", "bars": 252, "start": "2025-03-28", "end": "2026-03-27"}
resolve¶
Resolves a symbol through the symbology chain. In local mode, checks loaded data. When deployed, resolves through the platform's identifier cross-reference.
result = engine.resolve("AAPL")
# result.canonical_id -> "INS-01936d8a-7c1e-7b2a-8f3d-4e5a6b7c8d9e"
# result.display_name -> "Apple Inc Common Stock"
# result.asset_class -> "EQUITY"
# result.exchange_mic -> "XNAS"
The resolution chain:
- Is it a canonical ID (matches
PREFIX-UUIDpattern)? Direct lookup. - Is it a current ticker in the security master? Resolve to canonical ID.
- Is it a known external ID (FIGI, ISIN, CUSIP)? Cross-reference lookup.
- Ambiguous (same ticker, multiple exchanges)? Use deployment default market, or error.
- Not found? Return
NOT_FOUNDwith fuzzy-match suggestions.
Connected Mode¶
Connected mode (real-time data and live execution) is coming in a future release. When available, the Data API will query live data from DGM plugins through the sidecar, with vendor priority resolution, bitemporal queries, and real-time subscriptions.