GET /v1/time_series
GET /v1/time_series
Returns historical OHLCV bars for a single symbol. Supports intraday and daily-or-coarser intervals. Adjusted for splits by default.
Request
GET /v1/time_series?symbol=AAPL&interval=1day&outputsize=30 HTTP/1.1Host: api.oneapi.financeAuthorization: Bearer oa_live_<your_key>Query parameters
| Param | Type | Required | Notes |
|---|---|---|---|
symbol | string | yes | Single symbol. Batched mode is not supported here. |
interval | enum | yes | One of 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month. |
outputsize | int | no | Default 30 for intraday, 365 for daily and coarser. Cap 5,000. |
start_date | ISO | no | Inclusive lower bound. |
end_date | ISO | no | Inclusive upper bound. Default now. |
exchange | string | no | Disambiguate cross-listed tickers. |
adjust | enum | no | split (default) | none | total_return. |
format | enum | no | json (default) | csv. |
Intraday intervals support up to 60 days of history. Daily and coarser intervals support 20+ years for major tickers. See pagination for the windowing convention.
Response
{ "symbol": "AAPL", "interval": "1day", "currency": "USD", "exchange": "NASDAQ", "values": [ { "datetime": "2026-05-02T00:00:00Z", "open": 174.0, "high": 176.1, "low": 173.8, "close": 175.43, "volume": 52000000 }, { "datetime": "2026-05-01T00:00:00Z", "open": 173.2, "high": 174.7, "low": 172.9, "close": 174.5, "volume": 48000000 } ]}Response shape
| Field | Type | Notes |
|---|---|---|
symbol | string | Echo of the requested symbol, normalized. |
interval | string | Echo of the requested interval. |
currency | string | null | ISO 4217, possibly a sub-unit. |
exchange | string | null | Canonical exchange code. |
values | array | Bars in descending chronological order. |
values[].datetime | string | ISO 8601 UTC. For daily and coarser, T00:00:00Z. For intraday, the bar’s start time. |
values[].open | number | null | |
values[].high | number | null | |
values[].low | number | null | |
values[].close | number | null | Adjusted per the adjust parameter. |
values[].volume | integer | null | Adjusted inversely to splits when adjust=split. |
The wire-format model is oneapi_core.responses.time_series.TimeSeriesResponse.
CSV format
Pass format=csv to receive a CSV body suitable for pandas.read_csv. The
header row is fixed:
datetime,open,high,low,close,volume2026-05-02T00:00:00Z,174.0,176.1,173.8,175.43,520000002026-05-01T00:00:00Z,173.2,174.7,172.9,174.5,48000000Examples
# 30 days of daily barscurl -H "Authorization: Bearer oa_live_..." \ "https://api.oneapi.finance/v1/time_series?symbol=AAPL&interval=1day&outputsize=30"
# 5-minute bars for last weekcurl -H "Authorization: Bearer oa_live_..." \ "https://api.oneapi.finance/v1/time_series?symbol=AAPL&interval=5min&start_date=2026-04-27&end_date=2026-05-04"
# Total-return adjustedcurl -H "Authorization: Bearer oa_live_..." \ "https://api.oneapi.finance/v1/time_series?symbol=KO&interval=1day&outputsize=2520&adjust=total_return"
# CSVcurl -H "Authorization: Bearer oa_live_..." \ "https://api.oneapi.finance/v1/time_series?symbol=AAPL&interval=1day&outputsize=30&format=csv"import osimport httpximport pandas as pdfrom io import StringIO
API_KEY = os.environ["ONEAPI_KEY"]HEADERS = {"Authorization": f"Bearer {API_KEY}"}BASE = "https://api.oneapi.finance/v1/time_series"
def history_json(symbol: str, interval: str = "1day", days: int = 365): r = httpx.get( BASE, params={"symbol": symbol, "interval": interval, "outputsize": days}, headers=HEADERS, timeout=30.0, ) r.raise_for_status() return r.json()["values"]
def history_df(symbol: str, interval: str = "1day", days: int = 365): r = httpx.get( BASE, params={ "symbol": symbol, "interval": interval, "outputsize": days, "format": "csv", }, headers=HEADERS, timeout=30.0, ) r.raise_for_status() df = pd.read_csv(StringIO(r.text), parse_dates=["datetime"]) return df.set_index("datetime").sort_index()const API_KEY = process.env.ONEAPI_KEY;
async function history(symbol, interval = "1day", outputsize = 365) { const params = new URLSearchParams({ symbol, interval, outputsize: String(outputsize) }); const r = await fetch( `https://api.oneapi.finance/v1/time_series?${params}`, { headers: { Authorization: `Bearer ${API_KEY}` } }, ); if (!r.ok) throw new Error(`HTTP ${r.status}`); const body = await r.json(); // Sort ascending chronological for plotting return body.values.slice().sort((a, b) => a.datetime.localeCompare(b.datetime));}Errors
| Status | code | When |
|---|---|---|
| 400 | bad_request | Unknown interval, malformed date, outputsize over 5,000. |
| 401 | unauthenticated | Missing or invalid API key. |
| 404 | not_found | Symbol unknown, or no bars in the requested window. |
| 429 | rate_limit | See rate limits. |
| 502 | upstream_failure | All sources failed. |
See also
- Pagination — windowing rules.
- Corporate actions — split and dividend adjustment semantics.
GET /v1/splits— raw split events.