{"record":{"id":"db5ef582eddded51","repo":"OpenBB-finance/OpenBB","slug":"openbberror-response-get-error","errorCode":null,"errorMessage":"OpenBBError(response.get(\"error\"))","messagePattern":"OpenBBError\\(response\\.get\\(\"error\"\\)\\)","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/deribit/openbb_deribit/utils/helpers.py","lineNumber":206,"sourceCode":"    Parameters\n    ----------\n    symbol : str\n        The symbol to get ticker data for.\n\n    Returns\n    -------\n    dict\n        The ticker data.\n    \"\"\"\n    # pylint: disable=import-outside-toplevel\n    from openbb_core.provider.utils.helpers import amake_request\n\n    url = f\"{BASE_URL}/api/v2/public/ticker?instrument_name={symbol}\"\n\n    try:\n        response = await amake_request(url)\n        if response.get(\"error\"):  # type: ignore[union-attr]\n            raise OpenBBError(response.get(\"error\"))  # type: ignore[union-attr]\n        data = response.get(\"result\", {})  # type: ignore[union-attr]\n        stats = data.pop(\"stats\", {})\n        return {**data, **stats}\n\n    except Exception as e:  # pylint: disable=broad-except\n        raise OpenBBError(f\"Failed to get ticker data -> {e}: {e.args[0]}\") from e\n\n\nasync def get_perpetual_symbols() -> dict:\n    \"\"\"\n    Get perpetual symbols.\n\n    Returns\n    -------\n    dict\n        A dictionary of short symbols to full perpetual symbols.\n    \"\"\"\n    instruments = await get_instruments(\"all\", \"future\")","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/deribit/openbb_deribit/utils/helpers.py#L188-L224","documentation":"OpenBBError raised inside get_ticker_data when the Deribit /public/ticker response contains a non-null 'error' field (Deribit signals API errors in-band with HTTP 200). The error dict (code/message) is passed as the exception arg. This is the per-instrument failure for invalid names, e.g. error code 11000 'instrument not found'. Note this raise is then re-wrapped by the outer except (error 277).","triggerScenarios":"Requesting a ticker for a non-existent, misspelled, or expired instrument_name; or a Deribit permission/availability error returned in the error envelope. The URL embeds the symbol unescaped, so whitespace/commas also produce malformed names.","commonSituations":"Passing instrument names assembled from stale cached lists (contract expired), trailing whitespace in symbols, or wrong instrument naming conventions (must be e.g. BTC-PERPETUAL or BTC-27JUN26-25000-C).","solutions":["Confirm the exact instrument_name via get_instruments for the currency/kind and retry with that string verbatim.","Trim/strip symbols and reject empty strings before calling.","Read the embedded Deribit error code in the message — 11000-series mean unknown/invalid instrument.","If expired contracts are the cause, switch to the active contract or perpetual."],"exampleFix":"# before\nfrom openbb_deribit.utils.helpers import get_ticker_data\nt = await get_ticker_data(\"BTC-PERP\")\n\n# after\nt = await get_ticker_data(\"BTC-PERPETUAL\")","handlingStrategy":"validation","validationCode":"from openbb_deribit.utils.helpers import get_instruments\nnames = {d[\"instrument_name\"] for d in asyncio.run(get_instruments(\"all\", None))}\nsymbol = symbol.strip()\nassert symbol and symbol in names, f\"{symbol!r} is not a live Deribit instrument\"","typeGuard":"def is_live_instrument(symbol: str, live: set[str]) -> bool:\n    return isinstance(symbol, str) and symbol.strip() in live","tryCatchPattern":"from openbb_core.provider.utils.errors import OpenBBError\ntry:\n    t = await get_ticker_data(symbol)\nexcept OpenBBError as e:\n    msg = str(e)\n    if \"instrument\" in msg.lower() or \"11000\" in msg:\n        refresh_instrument_cache(); skip(symbol)  # unknown/expired instrument\n    else:\n        raise","preventionTips":["Strip whitespace and never construct instrument names by string concat without validation.","Resolve names from get_instruments right before use.","Learn Deribit's 11000 error codes to recognize unknown instruments fast."],"tags":["deribit","ticker","api-error","instrument-name","expired-contract"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}