OpenBB-finance/OpenBB · error · UnauthorizedError

Unauthorized Intrinio request -> {message}

Error message

Unauthorized Intrinio request -> {message}

What it means

UnauthorizedError raised in the fetch_callback of the bulk (no-symbol) path of IntrinioForwardEbitdaEstimatesFetcher: the response JSON has an 'error' key and its 'message' contains 'api key', i.e. Intrinio rejected the credential on the ebitda-consensus endpoint.

Source

Thrown at openbb_platform/providers/intrinio/openbb_intrinio/models/forward_ebitda_estimates.py:140

            if not data or not consensus:
                warn(f"Symbol Error: No data found for {symbol}")
            if consensus:
                results.extend(consensus)

        if symbols:
            await asyncio.gather(*[get_one(symbol) for symbol in symbols])
            if not results:
                raise EmptyDataError(f"No results were found. -> {query.symbol}")
            return results

        async def fetch_callback(response, session):
            """Use callback for pagination."""
            data = await response.json()
            error = data.get("error", None)
            if error:
                message = data.get("message", "")
                if "api key" in message.lower():
                    raise UnauthorizedError(
                        f"Unauthorized Intrinio request -> {message}"
                    )
                raise OpenBBError(f"Error: {error} -> {message}")

            estimates = data.get("ebitda_consensus", [])  # type: ignore
            if estimates and len(estimates) > 0:
                results.extend(estimates)
                while data.get("next_page"):  # type: ignore
                    next_page = data["next_page"]  # type: ignore
                    next_url = f"{url}&next_page={next_page}"
                    data = await amake_request(next_url, session=session, **kwargs)
                    consensus = (
                        data.get("ebitda_consensus")
                        if isinstance(data, dict) and "ebitda_consensus" in data
                        else []
                    )
                    if consensus:
                        results.extend(consensus)  # type: ignore

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Set a valid key: obb.account.credentials.intrinio_api_key = '<key>' or the INTRINIO_API_KEY env var
  2. Confirm the key works: curl the endpoint directly with api_key=<key>
  3. Ensure the subscription includes Analyst Estimates / consensus data
Defensive patterns

Strategy: try-catch

Validate before calling

def intrinio_key_ready() -> bool:
    return bool(obb.account.credentials.intrinio_api_key)

Type guard

from openbb_core.provider.utils.errors import UnauthorizedError

Try / catch

from openbb_core.provider.utils.errors import UnauthorizedError

try:
    res = await obb.equity.estimates.ebitda(provider="intrinio")
except UnauthorizedError as e:
    raise RuntimeError("set a valid intrinio_api_key with estimates access") from e

Prevention

When it happens

Trigger: Calling forward EBITDA estimates without per-symbol mode using a missing, invalid, expired, or under-privileged intrinio_api_key. Detection is the substring 'api key' in the error message.

Common situations: Key not configured in the environment/obb.account; key from a plan without analyst estimates access; rotated key not refreshed; CI without credentials.

Understand the failure class

Related errors


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