{"record":{"id":"ee0ff46137c61115","repo":"OpenBB-finance/OpenBB","slug":"no-data-available-for-the-requested-time-period-d","errorCode":null,"errorMessage":"No data available for the requested time period. Data for this table with country '{fetch_kwargs.get('COUNTRY', 'N/A')}' is only available from {time_start} to {time_end}. Your request: {start_date or 'beginning'} to {end_date or 'present'}.","messagePattern":"No data available for the requested time period\\. Data for this table with country '(.+?)' is only available from (.+?) to (.+?)\\. Your request: (.+?) to (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/utils/table_builder.py","lineNumber":832,"sourceCode":"                            return datetime(int(date_str[:4]), 1, 1)\n\n                        try:\n                            avail_start = parse_date(time_start)\n                            avail_end = parse_date(time_end)\n                            req_start = parse_date(start_date) if start_date else None\n                            req_end = parse_date(end_date) if end_date else None\n                        except (ValueError, TypeError):\n                            # Date parsing failed - skip validation\n                            break\n\n                        no_overlap = False\n                        if req_start and avail_end and req_start > avail_end:\n                            no_overlap = True\n                        if req_end and avail_start and req_end < avail_start:\n                            no_overlap = True\n\n                        if no_overlap:\n                            raise ValueError(\n                                f\"No data available for the requested time period. \"\n                                f\"Data for this table with country \"\n                                f\"'{fetch_kwargs.get('COUNTRY', 'N/A')}' is only available \"\n                                f\"from {time_start} to {time_end}. \"\n                                f\"Your request: {start_date or 'beginning'} to {end_date or 'present'}.\"\n                            )\n                        break\n\n        # Extract post-fetch filter codes before passing to fetch_data\n        indicator_codes_to_filter = fetch_kwargs.pop(\"_indicator_codes_to_filter\", None)\n\n        # Skip validation in fetch_data since we already validated progressively\n        data_result = self.query_builder.fetch_data(\n            dataflow=dataflow,\n            start_date=start_date,\n            end_date=end_date,\n            limit=limit,\n            _skip_validation=True,  # We already validated above","sourceCodeStart":814,"sourceCodeEnd":850,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/utils/table_builder.py#L814-L850","documentation":"Date-range validation: after fetching the table's availability window (time_start/time_end) for the selected country, the builder compares it with the user's requested start_date/end_date. If the ranges do not overlap at all, it raises immediately instead of returning an empty DataFrame, telling you exactly what window is actually available.","triggerScenarios":"Requesting dates entirely outside the data's coverage - e.g. start_date='1990-01-01' when the table only starts in 2005, or end_date before the series begins. Only fires when parse_date succeeds on both sides and the overlap test fails (req_start > avail_end or req_end < avail_start).","commonSituations":"Assuming long histories for countries that joined a dataset late (e.g. new euro members in IFS); passing year-first vs month-first date strings that parse into unexpected dates; querying brand-new tables whose history is short.","solutions":["Read the message: it states the available from/to window - re-request within that range.","Omit start_date/end_date (or widen them) to let the builder use full available history.","Verify date strings are ISO format (YYYY-MM-DD) so parse_date doesn't misread them.","For late-joining countries, first call the availability endpoint to discover the window programmatically."],"exampleFix":"# before\nobb.economy.imf.fetch(dataset='IFS', parameters={'COUNTRY': 'MNE'}, start_date='1995-01-01')\n# after - Montenegro data starts later; use the window from the error\nobb.economy.imf.fetch(dataset='IFS', parameters={'COUNTRY': 'MNE'}, start_date='2006-01-01')","handlingStrategy":"validation","validationCode":"# Discover the availability window before requesting a range\nmeta = obb.economy.imf.fetch(dataset='IFS', parameters={'COUNTRY': c}, limit=1)\nstart = meta.results[0].date if meta.results else None\n# then clamp your request to [max(requested_start, availability_start), ...]","typeGuard":"from datetime import date\ndef ranges_overlap(req: tuple[date, date], avail: tuple[date, date]) -> bool:\n    return req[0] <= avail[1] and req[1] >= avail[0]","tryCatchPattern":"try:\n    res = obb.economy.imf.fetch(..., start_date=s, end_date=e)\nexcept ValueError as e:\n    if 'only available from' in str(e):\n        # parse window from message, clamp request, retry once\n        new_start, new_end = parse_window(str(e))\n        res = obb.economy.imf.fetch(..., start_date=max(s, new_start), end_date=min(e, new_end))\n    else:\n        raise","preventionTips":["Always send ISO dates (YYYY-MM-DD)","For late-joining countries, probe availability first","Omit dates when full history is acceptable"],"tags":["imf","date-validation","data-availability","valueerror"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}