{"record":{"id":"c48edc8c016e3751","repo":"OpenBB-finance/OpenBB","slug":"error-in-intrinio-request-result","errorCode":null,"errorMessage":"Error in Intrinio request -> {result}","messagePattern":"Error in Intrinio request -> (.+?)","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/intrinio/openbb_intrinio/models/company_news.py","lineNumber":228,"sourceCode":"        ignore = (\n            [\"symbol\", \"page_size\", \"is_spam\"]\n            if not query.source or query.source == \"yahoo\"\n            else [\"symbol\", \"page_size\"]\n        )\n        query_str = get_querystring(query.model_dump(by_alias=True), ignore)\n        symbols = query.symbol.split(\",\") if query.symbol else []\n        news: list = []\n\n        async def callback(response, session):\n            \"\"\"Response callback.\"\"\"\n            result = await response.json()\n\n            if isinstance(result, dict) and \"error\" in result:\n                if \"api key\" in result.get(\"message\", \"\").lower():\n                    raise UnauthorizedError(\n                        f\"Unauthorized Intrinio request -> {result.get('message')}\"\n                    )\n                raise OpenBBError(f\"Error in Intrinio request -> {result}\")\n\n            symbol = response.url.parts[-2]\n            _data = result.get(\"news\", [])\n            data = []\n            data.extend([{\"symbol\": symbol, **d} for d in _data])\n            articles = len(data)\n            next_page = result.get(\"next_page\")\n            # query.limit can be None...\n            limit = query.limit or 2500\n            while next_page and limit > articles:\n                url = (\n                    f\"{base_url}/{symbol}/news?{query_str}\"\n                    + f\"&page_size={query.limit}&api_key={api_key}&next_page={next_page}\"\n                )\n                result = await get_data(url, session=session, **kwargs)\n                _data = result.get(\"news\", [])\n                if _data:\n                    data.extend([{\"symbol\": symbol, **d} for d in _data])","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/intrinio/openbb_intrinio/models/company_news.py#L210-L246","documentation":"Generic catch-all raised in the same response callback of IntrinioCompanyNewsFetcher when Intrinio returns {'error': ...} but the message does not mention 'api key'. The full error payload is embedded in the message so the upstream API's own error text is visible to the caller.","triggerScenarios":"Intrinio returns an error envelope for reasons other than auth: invalid/unsupported symbol in the path (response.url.parts[-2]), malformed query parameters (bad date strings for start_date/end_date), or endpoint/plan restrictions that don't use the 'api key' wording.","commonSituations":"Passing an OTC/delisted/misspelled ticker; sending a date the API rejects; hitting rate limits expressed as a generic error; plan changes on the Intrinio side renaming the message so it no longer matches the 'api key' heuristic (in which case a true auth problem shows up as this generic error).","solutions":["Read the embedded Intrinio payload in the message; it contains the API's own error code and text — fix the stated cause first","Validate symbols exist before the call (e.g. obb.equity.profile or a search) if the error indicates an unknown security","Check start_date/end_date formatting and range support for the news endpoint","If the payload hints at access/subscription, verify your plan or key (it may be an auth issue worded differently)"],"exampleFix":"// not a code defect — inspect message payload, e.g.\n# Error in Intrinio request -> {'error': 'bullseye', 'message': 'No data found'}\n# => symbol has no news; use a valid, listed ticker","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"from openbb_core.provider.abstract.error import OpenBBError\n\ndef is_intrinio_request_error(err: BaseException) -> bool:\n    return isinstance(err, OpenBBError) and str(err).startswith(\"Error in Intrinio request\")","tryCatchPattern":"from openbb_core.provider.abstract.error import OpenBBError\n\ntry:\n    news = await obb.news.company_news(provider=\"intrinio\", symbol=sym)\nexcept OpenBBError as e:\n    msg = str(e)\n    if msg.startswith(\"Error in Intrinio request\"):\n        log.warning(\"intrinio rejected %s: %s\", sym, msg)  # inspect payload, skip symbol\n        news = None\n    else:\n        raise","preventionTips":["Validate symbols and date params before the call","Log the full embedded payload — it contains Intrinio's own code/message","In multi-symbol loops, treat per-symbol errors as skips, not aborts"],"tags":["api-error","intrinio","news","upstream-error"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}