{"record":{"id":"4921403782ca6d17","repo":"calesthio/OpenMontage","slug":"unsplash-access-key-not-set-create-an-app-at-http","errorCode":null,"errorMessage":"UNSPLASH_ACCESS_KEY not set. Create an app at https://unsplash.com/documentation and add the access key to .env.","messagePattern":"UNSPLASH_ACCESS_KEY not set\\. Create an app at https://unsplash\\.com/documentation and add the access key to \\.env\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"tools/video/stock_sources/unsplash.py","lineNumber":97,"sourceCode":"        out_path.parent.mkdir(parents=True, exist_ok=True)\n\n        with requests.get(\n            candidate.download_url,\n            stream=True,\n            timeout=180,\n            headers={\"User-Agent\": _USER_AGENT},\n        ) as r:\n            r.raise_for_status()\n            with open(out_path, \"wb\") as f:\n                for chunk in r.iter_content(chunk_size=1 << 16):\n                    if chunk:\n                        f.write(chunk)\n        return out_path\n\n    def _headers(self) -> dict[str, str]:\n        key = os.environ.get(\"UNSPLASH_ACCESS_KEY\")\n        if not key:\n            raise RuntimeError(\n                \"UNSPLASH_ACCESS_KEY not set. Create an app at \"\n                \"https://unsplash.com/documentation and add the access key to .env.\"\n            )\n        return {\n            \"Authorization\": f\"Client-ID {key}\",\n            \"Accept-Version\": \"v1\",\n            \"User-Agent\": _USER_AGENT,\n        }\n\n\ndef _photo_to_candidate(photo: dict[str, Any], filters: SearchFilters) -> Candidate | None:\n    width = int(photo.get(\"width\") or 0)\n    height = int(photo.get(\"height\") or 0)\n    if filters.min_width is not None and width and width < filters.min_width:\n        return None\n    if filters.orientation and not _matches_orientation(filters.orientation, width, height):\n        return None\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/stock_sources/unsplash.py#L79-L115","documentation":"Error \"UNSPLASH_ACCESS_KEY not set. Create an app at https://unsplash.com/documentation and add the access key to .env.\" thrown in calesthio/OpenMontage.","triggerScenarios":"The Unsplash stock source is used without UNSPLASH_ACCESS_KEY set in the environment.","commonSituations":"See trigger scenarios.","solutions":["Create an app at https://unsplash.com/documentation to obtain an access key, then set UNSPLASH_ACCESS_KEY in the environment or .env.","Reload the environment (restart the process) after adding the key."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}