{"record":{"id":"55016a339c61b72d","repo":"OpenBB-finance/OpenBB","slug":"the-request-is-too-large-break-up-the-request-int","errorCode":null,"errorMessage":"The request is too large. Break up the request into smaller chunks.","messagePattern":"The request is too large\\. Break up the request into smaller chunks\\.","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/deribit/openbb_deribit/utils/helpers.py","lineNumber":317,"sourceCode":"            results.extend(\n                df[\n                    [\n                        \"date\",\n                        \"symbol\",\n                        \"open\",\n                        \"high\",\n                        \"low\",\n                        \"close\",\n                        \"volume\",\n                        \"volume_notional\",\n                    ]\n                ].to_dict(orient=\"records\")\n            )\n\n    urls = generate_urls(symbol, start_date, end_date, new_interval)\n\n    if len(urls) > 15:\n        raise OpenBBError(\n            \"The request is too large. Break up the request into smaller chunks.\"\n        )\n\n    tasks = [get_one(url) for url in urls]\n\n    await asyncio.gather(*tasks, return_exceptions=True)\n\n    if results:\n        return sorted(results, key=lambda x: x[\"date\"])\n    raise EmptyDataError(\"No data found for the given symbol and dates.\")\n\n\nasync def check_ohlc_symbol(symbol: str) -> bool | str:\n    \"\"\"\n    Check if the symbol has OHLC data.\n\n    Parameters\n    ----------","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/deribit/openbb_deribit/utils/helpers.py#L299-L335","documentation":"Thrown by the Deribit provider's get_ohlc_data when the requested date range and interval expand to more than 15 HTTP requests. Each request covers at most 5000 candles (window_size=5000 in generate_urls), so the provider refuses ranges that would need >15 chunks instead of hammering the public get_tradingview_chart_data endpoint. It is a client-side guard, not an API response.","triggerScenarios":"Calling crypto/historical (Deribit OHLC) with a fine interval over a long span, e.g. 1min candles for 2+ years (1min * 5000 = ~3.5 days per URL, so >~52 days of 1min data exceeds 15 URLs). Also triggered by intervals like 1h over decades or requesting dates far before the instrument's creation when creation_date is used as the start.","commonSituations":"Scripts that default to 'max history' with 1-minute resolution; backtesting jobs that fetch full history in one call; re-running a query that used to work after changing interval from 1d to a smaller resolution.","solutions":["Split the date range into multiple calls, each small enough that (candles / 5000) <= 15 — e.g. for 1min data, request at most ~52 days per call and loop.","Use a coarser interval (1d, 4h, 1h) which fits more history under the 15-URL cap.","Tighten start_date/end_date to only the window you actually need instead of full instrument history.","If you need bulk history, persist each chunk to disk (parquet/csv) so re-runs only fetch new windows."],"exampleFix":"// before\nobb.crypto.historical(symbol=\"BTC-PERPETUAL\", interval=\"1min\", start_date=\"2019-01-01\", end_date=\"2024-01-01\")  // raises\n\n// after\nimport openbb as obb\nfor chunk_start, chunk_end in month_ranges(\"2019-01-01\", \"2024-01-01\"):  # 1min: keep chunks <= ~50 days\n    df = obb.crypto.historical(symbol=\"BTC-PERPETUAL\", interval=\"1min\", start_date=chunk_start, end_date=chunk_end).to_df()","handlingStrategy":"validation","validationCode":"# Deribit: 5000 candles per request, 15 requests max -> 75_000 candles max\ndef max_days(interval: str) -> int:\n    per_day = {\"1min\": 1440, \"3min\": 480, \"5min\": 288, \"15min\": 96, \"30min\": 48, \"1h\": 24, \"4h\": 6, \"1d\": 1}\n    return 75_000 // per_day.get(interval, 1)\n\ndef assert_range_ok(start, end, interval):\n    days = (end - start).days\n    limit = max_days(interval)\n    assert days <= limit, f\"{days} days of {interval} exceeds limit {limit}; chunk into <= {limit}-day calls\"","typeGuard":null,"tryCatchPattern":"from openbb_core.provider.utils.errors import OpenBBError\ntry:\n    df = fetch_window(symbol, start, end, interval)\nexcept OpenBBError as e:\n    if \"too large\" in str(e):\n        raise ValueError(\"split range\") from e\n    raise","preventionTips":["Cap each Deribit OHLC request at ~75k candles (interval-specific day limits) before calling.","Default scripts to the coarsest interval that answers the question.","Persist fetched chunks so history accumulates instead of being re-requested whole."],"tags":["deribit","crypto","ohlc","rate-limit","date-range","chunking"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}