Skip to main content

Historical Ingestion API Reference

The Historical API provides methods to ingest, backfill, and query historical daily OHLCV bar data into TimescaleDB storage.


POST /historical/ingest

Trigger a single-asset historical ingestion or backfill.

Request Body

{
"ticker": "BNP.PA",
"resolution": "d",
"from_date": "2020-01-01",
"to_date": "2026-08-01",
"force": false
}

Parameters

ParameterTypeRequiredDefaultDescription
tickerstringTicker symbol to ingest
resolutionstringdCandle resolution (d, w, m)
from_datestringStart date (YYYY-MM-DD)
to_datestringEnd date (YYYY-MM-DD)
forcebooleanfalseRe-download and overwrite existing database records

Response Example

{
"status": "success",
"ticker": "BNP.PA",
"records_added": 1650,
"source": "YahooFinance",
"duration_ms": 1240
}

POST /historical/ingest/bulk

Trigger bulk ingestion across multiple tickers with concurrency controls.

Request Body

{
"tickers": ["AIR.PA", "BNP.PA", "TTE.PA", "MC.PA"],
"resolution": "d",
"concurrency": 4
}

Response Example

{
"total": 4,
"successful": 4,
"failed": 0,
"details": [
{ "ticker": "AIR.PA", "status": "success", "records_added": 250 },
{ "ticker": "BNP.PA", "status": "success", "records_added": 250 }
]
}

GET /ticker/{symbol}/history

Query historical OHLCV candles from the prices_eod table. Automatically ingests missing data if auto_ingest=true.

Parameters

ParameterTypeRequiredDefaultDescription
symbolstringInstrument symbol
resolutionstringdResolution (d, w, m)
limitinteger500Number of historical bars
auto_ingestbooleantrueAutomatically backfill missing bars from yfinance

Examples

cURL

curl -s "http://localhost:5000/ticker/AAPL/history?limit=10"

Python

import requests

resp = requests.get("http://localhost:5000/ticker/AAPL/history", params={"limit": 10})
bars = resp.json()["data"]
print("Fetched bars:", len(bars))