OpenBB-finance/OpenBB · warning · EmptyDataError

No data found for the given symbol and dates.

Error message

No data found for the given symbol and dates.

What it means

EmptyDataError raised at the end of Deribit's get_ohlc_data when the symbol resolved and all chunk requests completed, but the aggregated `results` list is empty — i.e. the API returned no OHLC rows for any window. OpenBB maps EmptyDataError to an empty result/warning at the router level rather than a hard failure.

Source

Thrown at openbb_platform/providers/deribit/openbb_deribit/utils/helpers.py:327

                        "volume_notional",
                    ]
                ].to_dict(orient="records")
            )

    urls = generate_urls(symbol, start_date, end_date, new_interval)

    if len(urls) > 15:
        raise OpenBBError(
            "The request is too large. Break up the request into smaller chunks."
        )

    tasks = [get_one(url) for url in urls]

    await asyncio.gather(*tasks, return_exceptions=True)

    if results:
        return sorted(results, key=lambda x: x["date"])
    raise EmptyDataError("No data found for the given symbol and dates.")


async def check_ohlc_symbol(symbol: str) -> bool | str:
    """
    Check if the symbol has OHLC data.

    Parameters
    ----------
    symbol : str
        The symbol to check.

    Returns
    -------
    bool
        True if the symbol has OHLC data, False otherwise.
    """
    all_instruments = await get_instruments("all", None)
    all_symbols = {

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Verify the instrument exists and its creation date via Deribit's public/get_instruments, then clip your start_date to after creation.
  2. Use a currently listed or perpetual instrument (e.g. BTC-PERPETUAL) for long history.
  3. Widen or shift the date range so it overlaps a period with actual trades.
  4. Handle EmptyDataError as an empty result rather than crashing the pipeline.

Example fix

// before
data = obb.crypto.historical(symbol="BTC-27DEC24", start_date="2020-01-01", end_date="2024-12-27")

// after
try:
    data = obb.crypto.historical(symbol="BTC-PERPETUAL", start_date="2024-01-01", end_date="2024-06-01")
except Exception as e:
    if "No data found" in str(e):
        data = None  # empty window, skip
Defensive patterns

Strategy: try-catch

Validate before calling

import requests

def symbol_has_ohlc(symbol: str, start: str) -> bool:
    r = requests.get("https://www.deribit.com/api/v2/public/get_instruments", params={"currency": "all", "kind": "all"})
    created = {i["instrument_name"]: i["creation_timestamp"] for i in r.json()["result"]}
    ts = created.get(symbol)
    return ts is not None and float(start.replace("-", "")) >= str(ts)[:8].replace("-", "")[:8] or ts is not None

Try / catch

from openbb_core.provider.utils.errors import EmptyDataError
try:
    res = obb.crypto.historical(symbol=sym, start_date=s, end_date=e, provider="deribit")
except EmptyDataError:
    res = None  # no candles in window; treat as empty, not fatal

Prevention

When it happens

Trigger: Requesting dates entirely before the instrument's creation (e.g. a 2023 option/future with start_date in 2020), delisted or expired instrument names, a start==end window with no candles at that resolution, or all chunk requests returning empty `result` payloads without an error field.

Common situations: Historical backfills that assume instruments existed earlier than they did; hardcoded expired futures contract names (e.g. BTC-27DEC24 after expiry); typos in instrument names that still resolve via get_instruments; weekend/holiday windows with no trades on illiquid options.

Related errors


AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14). Data as JSON: /api/errors/dc685b1561ed0cbb. Report an issue: GitHub.