OpenBB-finance/OpenBB · error · OpenBBError

Error in Intrinio request -> {result}

Error message

Error in Intrinio request -> {result}

What it means

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.

Source

Thrown at openbb_platform/providers/intrinio/openbb_intrinio/models/company_news.py:228

        ignore = (
            ["symbol", "page_size", "is_spam"]
            if not query.source or query.source == "yahoo"
            else ["symbol", "page_size"]
        )
        query_str = get_querystring(query.model_dump(by_alias=True), ignore)
        symbols = query.symbol.split(",") if query.symbol else []
        news: list = []

        async def callback(response, session):
            """Response callback."""
            result = await response.json()

            if isinstance(result, dict) and "error" in result:
                if "api key" in result.get("message", "").lower():
                    raise UnauthorizedError(
                        f"Unauthorized Intrinio request -> {result.get('message')}"
                    )
                raise OpenBBError(f"Error in Intrinio request -> {result}")

            symbol = response.url.parts[-2]
            _data = result.get("news", [])
            data = []
            data.extend([{"symbol": symbol, **d} for d in _data])
            articles = len(data)
            next_page = result.get("next_page")
            # query.limit can be None...
            limit = query.limit or 2500
            while next_page and limit > articles:
                url = (
                    f"{base_url}/{symbol}/news?{query_str}"
                    + f"&page_size={query.limit}&api_key={api_key}&next_page={next_page}"
                )
                result = await get_data(url, session=session, **kwargs)
                _data = result.get("news", [])
                if _data:
                    data.extend([{"symbol": symbol, **d} for d in _data])

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Read the embedded Intrinio payload in the message; it contains the API's own error code and text — fix the stated cause first
  2. Validate symbols exist before the call (e.g. obb.equity.profile or a search) if the error indicates an unknown security
  3. Check start_date/end_date formatting and range support for the news endpoint
  4. If the payload hints at access/subscription, verify your plan or key (it may be an auth issue worded differently)

Example fix

// not a code defect — inspect message payload, e.g.
# Error in Intrinio request -> {'error': 'bullseye', 'message': 'No data found'}
# => symbol has no news; use a valid, listed ticker
Defensive patterns

Strategy: try-catch

Type guard

from openbb_core.provider.abstract.error import OpenBBError

def is_intrinio_request_error(err: BaseException) -> bool:
    return isinstance(err, OpenBBError) and str(err).startswith("Error in Intrinio request")

Try / catch

from openbb_core.provider.abstract.error import OpenBBError

try:
    news = await obb.news.company_news(provider="intrinio", symbol=sym)
except OpenBBError as e:
    msg = str(e)
    if msg.startswith("Error in Intrinio request"):
        log.warning("intrinio rejected %s: %s", sym, msg)  # inspect payload, skip symbol
        news = None
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Related errors


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