{"record":{"id":"085d5f47849d98da","repo":"OpenBB-finance/OpenBB","slug":"unauthorized-intrinio-request-message-085d5f","errorCode":null,"errorMessage":"Unauthorized Intrinio request -> {message}","messagePattern":"Unauthorized Intrinio request -> (.+?)","errorType":"exception","errorClass":"UnauthorizedError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/intrinio/openbb_intrinio/models/forward_eps_estimates.py","lineNumber":170,"sourceCode":"            if not data or not isinstance(data, dict) or not data.get(\"estimates\"):\n                warn(f\"Symbol Error: No data found for {symbol}\")\n            if isinstance(data, dict) and data.get(\"estimates\"):\n                new_data = data.get(\"estimates\")  # type: ignore\n                if new_data:\n                    results.extend(new_data)\n\n        if symbols:\n            await asyncio.gather(*[get_one(symbol) for symbol in symbols])\n            return results\n\n        async def fetch_callback(response, session):\n            \"\"\"Use callback for pagination.\"\"\"\n            data = await response.json()\n            error = data.get(\"error\", None)\n            if error:\n                message = data.get(\"message\", \"\")\n                if \"api key\" in message.lower():\n                    raise UnauthorizedError(\n                        f\"Unauthorized Intrinio request -> {message}\"\n                    )\n                raise OpenBBError(f\"Error: {error} -> {message}\")\n\n            if data.get(\"estimates\") and len(data.get(\"estimates\")) > 0:  # type: ignore\n                results.extend(data.get(\"estimates\"))  # type: ignore\n                while data.get(\"next_page\"):  # type: ignore\n                    next_page = data[\"next_page\"]  # type: ignore\n                    next_url = f\"{url}&next_page={next_page}\"\n                    data = await amake_request(next_url, session=session, **kwargs)\n                    if \"estimates\" in data and len(data.get(\"estimates\")) > 0:  # type: ignore\n                        results.extend(data.get(\"estimates\"))  # type: ignore\n            return results\n\n        url = f\"{BASE_URL}&{query_str}&api_key={api_key}\"\n\n        results = await amake_request(url, response_callback=fetch_callback, **kwargs)  # type: ignore\n","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/intrinio/openbb_intrinio/models/forward_eps_estimates.py#L152-L188","documentation":"UnauthorizedError raised inside the pagination callback of the Intrinio forward EPS estimates fetcher when the API response body contains an 'error' key and the accompanying 'message' text contains 'api key' (case-insensitive). It signals that Intrinio rejected the request because the supplied API key is missing, malformed, or lacks entitlement to the zacks/forward_eps endpoint.","triggerScenarios":"Calling equity/estimates/forward_eps with provider=intrinio while the intrinio_api_key credential is empty, expired, or a free-tier key not entitled to Zacks estimates data; Intrinio returns HTTP 200/4xx with a JSON body like {\"error\": ..., \"message\": \"...API Key...\"} and the callback converts it to UnauthorizedError.","commonSituations":"No intrinio_api_key set in OpenBB hub credentials or environment; key revoked or past its subscription; free/starter plan without Zacks forward EPS access; key copied with whitespace or truncated.","solutions":["Set a valid key: `obb.user.credentials.intrinio_api_key = '...'` or export INTRINIO_API_KEY.","Verify the key against Intrinio directly: curl 'https://api-v2.intrinio.com/zacks/forward_eps?api_key=KEY'.","Confirm your Intrinio subscription includes Zacks estimates data; upgrade or switch provider if not.","Check for stray whitespace/newlines in the stored credential."],"exampleFix":"# before - no key configured\nobb.equity.estimates.forward_eps(symbol='AAPL', provider='intrinio')\n\n# after\nobb.user.credentials.intrinio_api_key = os.environ['INTRINIO_API_KEY']\nobb.equity.estimates.forward_eps(symbol='AAPL', provider='intrinio')","handlingStrategy":"validation","validationCode":"import os, urllib.request, json\nkey = os.environ.get('INTRINIO_API_KEY', '')\nassert key, 'INTRINIO_API_KEY not set'\n# cheap credential probe before the real call\nreq = urllib.request.Request(f'https://api-v2.intrinio.com/data_point/AAPL/data_point/marketcap?api_key={key}')\nwith urllib.request.urlopen(req) as r:\n    json.load(r)  # raises on auth failure","typeGuard":null,"tryCatchPattern":"from openbb_core.provider.exceptions import UnauthorizedError\ntry:\n    res = obb.equity.estimates.forward_eps(symbol='AAPL', provider='intrinio')\nexcept UnauthorizedError as e:\n    raise SystemExit(f'Fix Intrinio credentials: {e}') from e","preventionTips":["Set intrinio_api_key once via obb.user.credentials and persist","Probe the key with a cheap data_point call at app startup","Keep the key out of code; use env vars","Confirm the plan includes Zacks estimates"],"tags":["intrinio","auth","api-key","estimates"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}