{
  "schemaVersion": "1.0",
  "item": {
    "slug": "xiaohongshutools",
    "name": "小红书",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/ChocomintX/xiaohongshutools",
    "canonicalUrl": "https://clawhub.ai/ChocomintX/xiaohongshutools",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/xiaohongshutools",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=xiaohongshutools",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/units/base_response.py",
      "scripts/units/singleton.py",
      "scripts/units/fuck_reverse_crypto/asymmetric.py",
      "scripts/units/fuck_reverse_crypto/bitwise_operations.py",
      "scripts/units/fuck_reverse_crypto/encoding.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "xiaohongshutools",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-12T23:59:08.371Z",
      "expiresAt": "2026-05-19T23:59:08.371Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=xiaohongshutools",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=xiaohongshutools",
        "contentDisposition": "attachment; filename=\"xiaohongshutools-0.1.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "xiaohongshutools"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/xiaohongshutools"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/xiaohongshutools",
    "agentPageUrl": "https://openagent3.xyz/skills/xiaohongshutools/agent",
    "manifestUrl": "https://openagent3.xyz/skills/xiaohongshutools/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/xiaohongshutools/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Xiaohongshu Skill",
        "body": "小红书（XiaoHongShu / Little Red Book）数据采集和交互工具包。基于RedCrack纯Python逆向工程实现。"
      },
      {
        "title": "Installation",
        "body": "Dependencies are already installed:\n\npip install aiohttp loguru pycryptodome getuseragent"
      },
      {
        "title": "Basic Usage",
        "body": "import asyncio\nimport sys\nsys.path.insert(0, r'C:\\\\Users\\\\Chocomint\\\\.openclaw\\\\workspace\\\\xiaohongshu\\\\scripts')\n\nfrom request.web.xhs_session import create_xhs_session\n\nasync def main():\n    # ✅ 推荐：不强制代理（有代理再填 proxy）\n    # 说明：当前小红书接口经常对“未登录/游客”限制搜索能力。\n    # 如果 search 报 code=-104（未登录无权限），请提供 web_session。\n    xhs = await create_xhs_session(proxy=None, web_session=\"YOUR_WEB_SESSION_OR_NONE\")\n\n    # Search notes\n    res = await xhs.apis.note.search_notes(\"美妆\")\n    data = await res.json()\n    print(data)\n\n    await xhs.close_session()\n\nasyncio.run(main())"
      },
      {
        "title": "1. Search & Discovery",
        "body": "Search notes by keyword:\n\nres = await xhs_session.apis.note.search_notes(\"口红\")\n\nGet home feed (trending):\n\n# 注意：get_homefeed 需要 category 参数\nres = await xhs_session.apis.note.get_homefeed(\n    xhs_session.apis.note.homefeed_category_enum.FOOD\n)\n\nGet note detail:\n\n# note_detail 需要 note_id + xsec_token（有时在搜索结果 item 里叫 xsec_token）\nres = await xhs_session.apis.note.note_detail(note_id, xsec_token)"
      },
      {
        "title": "2. User Interactions",
        "body": "Get user info:\n\nres = await xhs_session.apis.auth.get_self_simple_info()\n\nFollow a user:\n\nres = await xhs_session.apis.user.follow_user(user_id)\n\nLike a note:\n\nres = await xhs_session.apis.note.like_note(note_id)"
      },
      {
        "title": "3. Comments",
        "body": "Get comments for a note:\n\n# comments 也需要 note_id + xsec_token\nres = await xhs_session.apis.comments.get_comments(note_id, xsec_token)"
      },
      {
        "title": "Proxy",
        "body": "代理不是硬性要求（本技能可以 proxy=None 运行）。但在以下情况建议使用代理：\n\n网络环境不稳定/请求超时\n频繁触发风控（例如 461）想换出口 IP 试试\n\n不使用代理：\n\nxhs = await create_xhs_session(proxy=None, web_session=None)\n\n使用代理：\n\nxhs = await create_xhs_session(\n    proxy=\"http://127.0.0.1:7890\",\n    web_session=\"your_web_session_cookie\"  # 需要登录能力时再提供\n)"
      },
      {
        "title": "Encryption Parameters",
        "body": "All encryption parameters are automatically generated:\n\nCookies: a1, webId, acw_tc, web_session, sec_poison_id, websectiga, gid\nHeaders: x-s, x-s-common, x-t, x-b3-traceid, x-xray-traceid\n\nConfiguration file: scripts/request/web/encrypt/web_encrypt_config.ini"
      },
      {
        "title": "Guest Mode (No Login)",
        "body": "xhs_session = await create_xhs_session(proxy=\"http://127.0.0.1:7890\")"
      },
      {
        "title": "Authenticated Mode (With Login)",
        "body": "xhs_session = await create_xhs_session(\n    proxy=\"http://127.0.0.1:7890\",\n    web_session=\"030037afxxxxxxxxxxxxxxxxxxxaeb59d5b4\"  # Your cookie\n)"
      },
      {
        "title": "Close Session",
        "body": "await xhs_session.close_session()"
      },
      {
        "title": "Links & IDs (重要)",
        "body": "小红书笔记的公开标识通常是 note_id（十六进制风格字符串），例如：697cc945000000000a02cdad。\n这个 note_id 可以做数学意义的 16 进制→10 进制转换，但那只是“另一种表示法”，不会变成小红书的短数字 ID（类似 App Store 的 id741292507），也不会更适合拼接小红书链接。\n我们通过接口得到的可直接打开的网页链接通常形如：\n\nhttps://www.xiaohongshu.com/explore/<note_id>?xsec_token=...&xsec_source=pc_search\n\n\nxhslink.com 短链一般需要在 App/登录态里通过“分享→复制链接”获得；仅靠当前接口通常拿不到。"
      },
      {
        "title": "输出到聊天时的链接美化（推荐）",
        "body": "为了避免长链接难看，优先用文本标签超链接：\n\nMarkdown：[标题](https://www.xiaohongshu.com/explore/...)"
      },
      {
        "title": "Available APIs",
        "body": "All APIs are accessible via xhs_session.apis.*:\n\nAuthentication (apis.auth):\n\nget_self_simple_info() - Get current user info\n\nNotes (apis.note):\n\nsearch_notes(keyword) - Search notes by keyword\nget_homefeed(category) - Get home feed\nnote_detail(note_id, share_token) - Get note details\nlike_note(note_id) - Like a note\n\nComments (apis.comments):\n\nget_comments(note_id, share_token) - Get note comments\n\nUser (apis.user):\n\nfollow_user(user_id) - Follow a user\nget_user_info(user_id) - Get user details"
      },
      {
        "title": "Workflow 1: Search and Extract Notes",
        "body": "async def search_example():\n    xhs_session = await create_xhs_session(proxy=\"http://127.0.0.1:7890\")\n\n    # Search for makeup tutorials\n    res = await xhs_session.apis.note.search_notes(\"美妆教程\")\n    data = await res.json()\n\n    for note in data['data']['items']:\n        print(f\"Title: {note['display_title']}\")\n        print(f\"Author: {note['user']['nickname']}\")\n        print(f\"Likes: {note['liked_count']}\")\n        print(\"---\")\n\n    await xhs_session.close_session()"
      },
      {
        "title": "Workflow 2: Get Comments for Analysis",
        "body": "async def comments_example():\n    xhs_session = await create_xhs_session(proxy=\"http://127.0.0.1:7890\")\n\n    note_id = \"64f1a2d30000000013003689\"\n    res = await xhs_session.apis.comments.get_comments(note_id, \"\")\n    data = await res.json()\n\n    for comment in data['data']['comments']:\n        print(f\"User: {comment['user']['nickname']}\")\n        print(f\"Content: {comment['content']}\")\n        print(f\"Likes: {comment['like_count']}\")\n        print(\"---\")\n\n    await xhs_session.close_session()"
      },
      {
        "title": "Workflow 3: User Profile Analysis",
        "body": "async def profile_example():\n    xhs_session = await create_xhs_session(\n        proxy=\"http://127.0.0.1:7890\",\n        web_session=\"your_cookie_here\"\n    )\n\n    # Get self info\n    res = await xhs_session.apis.auth.get_self_simple_info()\n    data = await res.json()\n\n    print(f\"Username: {data['data']['user']['nickname']}\")\n    print(f\"Followers: {data['data']['user']['follows']}\")\n    print(f\"Fans: {data['data']['user']['fans']}\")\n\n    await xhs_session.close_session()"
      },
      {
        "title": "Important Notes",
        "body": "Proxy is required for most operations due to XiaoHongShu's anti-scraping measures\nRate limiting: Be respectful with request frequency to avoid IP bans\nAuthentication: Some operations require login (web_session cookie)\nLegal compliance: Use only for legitimate research and data analysis purposes"
      },
      {
        "title": "Technical Details",
        "body": "Based on RedCrack - Pure Python reverse engineering of XiaoHongShu's encryption algorithms.\n\nWhat's automatically handled:\n\nBase64/Base58 custom encoding\nRC4/XOR encryption\nMD5/SHA256 hashing\nCustom signature generation (x-s, x-s-common)\nDynamic cookie generation (a1, webId, sec_poison_id, etc.)\n\nNo JavaScript runtime required - All encryption is pure Python."
      },
      {
        "title": "Connection errors",
        "body": "Verify your proxy is running on the configured port\nTry different proxy servers if needed\nCheck network connectivity"
      },
      {
        "title": "461 errors（风控/安全校验）",
        "body": "这通常不是代码语法问题，而是触发了小红书的风控/安全校验。\n典型现象：OtherStatusError: 461异常，或者接口返回看似 success=true 但 HTTP=461。\n\n应对建议：\n\n降低频率/加随机 sleep、避免并发\n换关键词/换 endpoint（例如先用搜索拿到 note_id + xsec_token，再查 detail）\n使用稳定的登录态（web_session）\n必要时更换代理出口"
      },
      {
        "title": "401/403 errors",
        "body": "web_session 可能过期\n小红书可能更新了风控参数/签名逻辑（需要更新逆向实现）"
      },
      {
        "title": "Import errors",
        "body": "Ensure all dependencies are installed: pip install aiohttp loguru pycryptodome getuseragent\nCheck that the skill path is correct in sys.path.insert()"
      }
    ],
    "body": "Xiaohongshu Skill\n\n小红书（XiaoHongShu / Little Red Book）数据采集和交互工具包。基于RedCrack纯Python逆向工程实现。\n\nQuick Start\nInstallation\n\nDependencies are already installed:\n\npip install aiohttp loguru pycryptodome getuseragent\n\nBasic Usage\nimport asyncio\nimport sys\nsys.path.insert(0, r'C:\\\\Users\\\\Chocomint\\\\.openclaw\\\\workspace\\\\xiaohongshu\\\\scripts')\n\nfrom request.web.xhs_session import create_xhs_session\n\nasync def main():\n    # ✅ 推荐：不强制代理（有代理再填 proxy）\n    # 说明：当前小红书接口经常对“未登录/游客”限制搜索能力。\n    # 如果 search 报 code=-104（未登录无权限），请提供 web_session。\n    xhs = await create_xhs_session(proxy=None, web_session=\"YOUR_WEB_SESSION_OR_NONE\")\n\n    # Search notes\n    res = await xhs.apis.note.search_notes(\"美妆\")\n    data = await res.json()\n    print(data)\n\n    await xhs.close_session()\n\nasyncio.run(main())\n\nCore Capabilities\n1. Search & Discovery\n\nSearch notes by keyword:\n\nres = await xhs_session.apis.note.search_notes(\"口红\")\n\n\nGet home feed (trending):\n\n# 注意：get_homefeed 需要 category 参数\nres = await xhs_session.apis.note.get_homefeed(\n    xhs_session.apis.note.homefeed_category_enum.FOOD\n)\n\n\nGet note detail:\n\n# note_detail 需要 note_id + xsec_token（有时在搜索结果 item 里叫 xsec_token）\nres = await xhs_session.apis.note.note_detail(note_id, xsec_token)\n\n2. User Interactions\n\nGet user info:\n\nres = await xhs_session.apis.auth.get_self_simple_info()\n\n\nFollow a user:\n\nres = await xhs_session.apis.user.follow_user(user_id)\n\n\nLike a note:\n\nres = await xhs_session.apis.note.like_note(note_id)\n\n3. Comments\n\nGet comments for a note:\n\n# comments 也需要 note_id + xsec_token\nres = await xhs_session.apis.comments.get_comments(note_id, xsec_token)\n\nConfiguration\nProxy\n\n代理不是硬性要求（本技能可以 proxy=None 运行）。但在以下情况建议使用代理：\n\n网络环境不稳定/请求超时\n频繁触发风控（例如 461）想换出口 IP 试试\n\n不使用代理：\n\nxhs = await create_xhs_session(proxy=None, web_session=None)\n\n\n使用代理：\n\nxhs = await create_xhs_session(\n    proxy=\"http://127.0.0.1:7890\",\n    web_session=\"your_web_session_cookie\"  # 需要登录能力时再提供\n)\n\nEncryption Parameters\n\nAll encryption parameters are automatically generated:\n\nCookies: a1, webId, acw_tc, web_session, sec_poison_id, websectiga, gid\nHeaders: x-s, x-s-common, x-t, x-b3-traceid, x-xray-traceid\n\nConfiguration file: scripts/request/web/encrypt/web_encrypt_config.ini\n\nSession Management\nGuest Mode (No Login)\nxhs_session = await create_xhs_session(proxy=\"http://127.0.0.1:7890\")\n\nAuthenticated Mode (With Login)\nxhs_session = await create_xhs_session(\n    proxy=\"http://127.0.0.1:7890\",\n    web_session=\"030037afxxxxxxxxxxxxxxxxxxxaeb59d5b4\"  # Your cookie\n)\n\nClose Session\nawait xhs_session.close_session()\n\nLinks & IDs (重要)\n小红书笔记的公开标识通常是 note_id（十六进制风格字符串），例如：697cc945000000000a02cdad。\n这个 note_id 可以做数学意义的 16 进制→10 进制转换，但那只是“另一种表示法”，不会变成小红书的短数字 ID（类似 App Store 的 id741292507），也不会更适合拼接小红书链接。\n我们通过接口得到的可直接打开的网页链接通常形如：\nhttps://www.xiaohongshu.com/explore/<note_id>?xsec_token=...&xsec_source=pc_search\nxhslink.com 短链一般需要在 App/登录态里通过“分享→复制链接”获得；仅靠当前接口通常拿不到。\n输出到聊天时的链接美化（推荐）\n\n为了避免长链接难看，优先用文本标签超链接：\n\nMarkdown：[标题](https://www.xiaohongshu.com/explore/...)\nAvailable APIs\n\nAll APIs are accessible via xhs_session.apis.*:\n\nAuthentication (apis.auth):\n\nget_self_simple_info() - Get current user info\n\nNotes (apis.note):\n\nsearch_notes(keyword) - Search notes by keyword\nget_homefeed(category) - Get home feed\nnote_detail(note_id, share_token) - Get note details\nlike_note(note_id) - Like a note\n\nComments (apis.comments):\n\nget_comments(note_id, share_token) - Get note comments\n\nUser (apis.user):\n\nfollow_user(user_id) - Follow a user\nget_user_info(user_id) - Get user details\nExample Workflows\nWorkflow 1: Search and Extract Notes\nasync def search_example():\n    xhs_session = await create_xhs_session(proxy=\"http://127.0.0.1:7890\")\n\n    # Search for makeup tutorials\n    res = await xhs_session.apis.note.search_notes(\"美妆教程\")\n    data = await res.json()\n\n    for note in data['data']['items']:\n        print(f\"Title: {note['display_title']}\")\n        print(f\"Author: {note['user']['nickname']}\")\n        print(f\"Likes: {note['liked_count']}\")\n        print(\"---\")\n\n    await xhs_session.close_session()\n\nWorkflow 2: Get Comments for Analysis\nasync def comments_example():\n    xhs_session = await create_xhs_session(proxy=\"http://127.0.0.1:7890\")\n\n    note_id = \"64f1a2d30000000013003689\"\n    res = await xhs_session.apis.comments.get_comments(note_id, \"\")\n    data = await res.json()\n\n    for comment in data['data']['comments']:\n        print(f\"User: {comment['user']['nickname']}\")\n        print(f\"Content: {comment['content']}\")\n        print(f\"Likes: {comment['like_count']}\")\n        print(\"---\")\n\n    await xhs_session.close_session()\n\nWorkflow 3: User Profile Analysis\nasync def profile_example():\n    xhs_session = await create_xhs_session(\n        proxy=\"http://127.0.0.1:7890\",\n        web_session=\"your_cookie_here\"\n    )\n\n    # Get self info\n    res = await xhs_session.apis.auth.get_self_simple_info()\n    data = await res.json()\n\n    print(f\"Username: {data['data']['user']['nickname']}\")\n    print(f\"Followers: {data['data']['user']['follows']}\")\n    print(f\"Fans: {data['data']['user']['fans']}\")\n\n    await xhs_session.close_session()\n\nImportant Notes\nProxy is required for most operations due to XiaoHongShu's anti-scraping measures\nRate limiting: Be respectful with request frequency to avoid IP bans\nAuthentication: Some operations require login (web_session cookie)\nLegal compliance: Use only for legitimate research and data analysis purposes\nTechnical Details\n\nBased on RedCrack - Pure Python reverse engineering of XiaoHongShu's encryption algorithms.\n\nWhat's automatically handled:\n\nBase64/Base58 custom encoding\nRC4/XOR encryption\nMD5/SHA256 hashing\nCustom signature generation (x-s, x-s-common)\nDynamic cookie generation (a1, webId, sec_poison_id, etc.)\n\nNo JavaScript runtime required - All encryption is pure Python.\n\nTroubleshooting\nConnection errors\nVerify your proxy is running on the configured port\nTry different proxy servers if needed\nCheck network connectivity\n461 errors（风控/安全校验）\n这通常不是代码语法问题，而是触发了小红书的风控/安全校验。\n典型现象：OtherStatusError: 461异常，或者接口返回看似 success=true 但 HTTP=461。\n\n应对建议：\n\n降低频率/加随机 sleep、避免并发\n换关键词/换 endpoint（例如先用搜索拿到 note_id + xsec_token，再查 detail）\n使用稳定的登录态（web_session）\n必要时更换代理出口\n401/403 errors\nweb_session 可能过期\n小红书可能更新了风控参数/签名逻辑（需要更新逆向实现）\nImport errors\nEnsure all dependencies are installed: pip install aiohttp loguru pycryptodome getuseragent\nCheck that the skill path is correct in sys.path.insert()"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/ChocomintX/xiaohongshutools",
    "publisherUrl": "https://clawhub.ai/ChocomintX/xiaohongshutools",
    "owner": "ChocomintX",
    "version": "0.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/xiaohongshutools",
    "downloadUrl": "https://openagent3.xyz/downloads/xiaohongshutools",
    "agentUrl": "https://openagent3.xyz/skills/xiaohongshutools/agent",
    "manifestUrl": "https://openagent3.xyz/skills/xiaohongshutools/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/xiaohongshutools/agent.md"
  }
}