{"record":{"id":"c32117c9a9e193ea","repo":"mvanhorn/last30days-skill","slug":"missing-xiaohongshu-api-base-url","errorCode":null,"errorMessage":"Missing Xiaohongshu API base URL","messagePattern":"Missing Xiaohongshu API base URL","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/last30days/scripts/lib/xiaohongshu_api.py","lineNumber":77,"sourceCode":"\ndef _build_note_url(feed_id: str, xsec_token: str) -> str:\n    \"\"\"Build a stable Xiaohongshu note URL.\"\"\"\n    if xsec_token:\n        return f\"https://www.xiaohongshu.com/explore/{feed_id}?xsec_token={xsec_token}\"\n    return f\"https://www.xiaohongshu.com/explore/{feed_id}\"\n\n\ndef search_feeds(\n    topic: str,\n    from_date: str,\n    to_date: str,\n    base_url: str,\n    depth: str = \"default\",\n) -> List[Dict[str, Any]]:\n    \"\"\"Search Xiaohongshu feeds and normalize to web-item shape.\"\"\"\n    base = (base_url or \"\").rstrip(\"/\")\n    if not base:\n        raise ValueError(\"Missing Xiaohongshu API base URL\")\n\n    # Quick login sanity check.\n    login = http.get(f\"{base}/api/v1/login/status\", timeout=8, retries=1)\n    is_logged_in = (\n        login.get(\"data\", {}).get(\"is_logged_in\")\n        if isinstance(login, dict) else False\n    )\n    if not is_logged_in:\n        raise http.HTTPError(\"Xiaohongshu API reachable but not logged in\")\n\n    # API supports filters; use recency-oriented defaults.\n    publish_time = \"一天内\" if depth == \"quick\" else \"一周内\" if depth == \"default\" else \"半年内\"\n    payload = {\n        \"keyword\": topic,\n        \"filters\": {\n            \"sort_by\": \"综合\",\n            \"note_type\": \"不限\",\n            \"publish_time\": publish_time,","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/mvanhorn/last30days-skill/blob/c7460f6114449ddfe6ea3fc2f23c3d910c0e740c/skills/last30days/scripts/lib/xiaohongshu_api.py#L59-L95","documentation":"Error \"Missing Xiaohongshu API base URL\" thrown in mvanhorn/last30days-skill.","triggerScenarios":"Fires when the Xiaohongshu source is enabled but its API base URL is not configured. Occurs when the required environment variable/config entry for the Xiaohongshu API endpoint is missing or empty before the client makes its first request.","commonSituations":"See trigger scenarios.","solutions":["Configure the Xiaohongshu API base URL (XIAOHONGSHU_BASE_URL / the skill's base_url setting) to point at your running Xiaohongshu API instance.","If you do not intend to use the Xiaohongshu source, exclude it from the run (--sources without xiaohongshu or INCLUDE_SOURCES without it)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c7460f6114449ddfe6ea3fc2f23c3d910c0e740c","analyzedAt":"2026-08-15T03:34:49.540Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}