{"record":{"id":"8da050aefff84506","repo":"searxng/searxng","slug":"yandex-search-api-no-rawdata-in-response","errorCode":null,"errorMessage":"Yandex Search API: no 'rawData' in response","messagePattern":"Yandex Search API: no 'rawData' in response","errorType":"exception","errorClass":"SearxEngineAPIException","httpStatus":null,"severity":"error","filePath":"searx/engines/yandex_api.py","lineNumber":179,"sourceCode":"    params[\"method\"] = \"POST\"\n    params[\"url\"] = base_url\n    params[\"headers\"][\"Authorization\"] = f\"Api-Key {api_key}\"\n    params[\"headers\"][\"Content-Type\"] = \"application/json\"\n    params[\"json\"] = body\n\n\ndef _raw_xml(resp: \"SXNG_Response\") -> bytes:\n    \"\"\"Extract and Base64-decode the XML payload out of the JSON envelope.\n\n    The synchronous ``/v2/web/search`` endpoint returns ``{\"rawData\":\n    \"<base64>\"}`` on success; HTTP errors are raised upstream via\n    ``raise_for_httperror``.\n    \"\"\"\n    data: dict[str, t.Any] = resp.json()\n\n    raw_data = data.get(\"rawData\")\n    if raw_data is None:\n        raise SearxEngineAPIException(\"Yandex Search API: no 'rawData' in response\")\n\n    return b64decode(raw_data)\n\n\ndef response(resp: \"SXNG_Response\") -> EngineResults:\n    res = EngineResults()\n\n    dom = etree.fromstring(_raw_xml(resp))  # pylint: disable=c-extension-no-member\n\n    # An <error> inside <response> signals an application error.  Code 15 simply\n    # means \"nothing was found\" and must not raise.\n    error = dom.find(\".//response/error\")\n    if error is not None:\n        if error.get(\"code\") == \"15\":\n            return res\n        raise SearxEngineAPIException(f\"Yandex Search API error {error.get('code')}: {error.text}\")\n\n    for doc in dom.iterfind(\".//doc\"):","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/searxng/searxng/blob/9fea41204fdfa7a5cfa15b0ebd12904c520478ce/searx/engines/yandex_api.py#L161-L197","documentation":"Error \"Yandex Search API: no 'rawData' in response\" thrown in searxng/searxng.","triggerScenarios":"Thrown at searx/engines/yandex_api.py:179 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9fea41204fdfa7a5cfa15b0ebd12904c520478ce","analyzedAt":"2026-08-27T06:40:00.395Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}