api-config.json 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. {
  2. "name": "xiaohongshu-note-comments",
  3. "displayName": "小红书笔记评论",
  4. "description": "根据 note_id 批量抓取小红书笔记评论(完整评论文本、用户、点赞数、时间、回复数),支持翻页。中国市场 VOC 分析的核心数据源。",
  5. "category": "xiaohongshu",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "GET",
  9. "url": "https://server.fmode.cn/thapi/v1/xiaohongshu/app/get_note_comments",
  10. "headers": {
  11. "Authorization": "Bearer gqsZHfMWgAiMwV+ITbmZy0qALADWBZVS7QnV7kKJe9CwzgWgJG+7bwK+GQ==",
  12. "Accept": "application/json"
  13. }
  14. },
  15. "parameters": {
  16. "type": "object",
  17. "required": [
  18. "note_id"
  19. ],
  20. "properties": {
  21. "note_id": {
  22. "type": "string",
  23. "description": "小红书笔记 ID(24 位十六进制),从 xiaohongshu-search-notes 获取"
  24. },
  25. "cursor": {
  26. "type": "string",
  27. "description": "翻页游标。首次请求留空,翻页时使用上次响应的 data.cursor",
  28. "default": ""
  29. }
  30. }
  31. },
  32. "requestTransform": {
  33. "query": {
  34. "note_id": "{{note_id}}",
  35. "cursor": "{{cursor}}"
  36. }
  37. },
  38. "response": {
  39. "type": "object",
  40. "description": "评论列表(按热度排序,双层 data 包装,每次约 10 条)",
  41. "note": "cursor 字段是 JSON 字符串(如 '{\"cursor\":\"69a426900..\"}'),翻页时原样传回。",
  42. "keyFields": {
  43. "data.code": "HTTP 状态码(外层)",
  44. "data.data.code": "业务状态码(0=成功)",
  45. "data.data.success": "布尔成功标志",
  46. "data.data.has_more": "是否还有更多评论(翻页终止条件)",
  47. "data.data.cursor": "下一页游标(JSON 字符串),翻页时作为 cursor 参数原样传回",
  48. "data.data.comments[]": "评论列表(按热度排序,每页约 10 条)",
  49. "data.data.comments[].id": "评论唯一 ID",
  50. "data.data.comments[].content": "评论正文(VOC 核心数据 — NLP 聚类的原始输入)",
  51. "data.data.comments[].create_time": "评论时间戳(毫秒)",
  52. "data.data.comments[].like_count": "评论获赞数(高赞 = 共识,加权过滤)",
  53. "data.data.comments[].sub_comment_count": "子评论/回复数",
  54. "data.data.comments[].user_info.user_id": "评论者 ID",
  55. "data.data.comments[].user_info.nickname": "评论者昵称",
  56. "data.data.comments[].user_info.image": "评论者头像",
  57. "data.data.comments[].ip_location": "评论 IP 地域(地域分布洞察)",
  58. "data.data.comments[].sub_comments[]": "热门子评论列表(作者/其他用户的回复)"
  59. }
  60. },
  61. "workflow": {
  62. "description": "推荐调用链",
  63. "steps": [
  64. "1. xiaohongshu-search-notes(keyword) → 发现高评论笔记",
  65. "2. xiaohongshu-note-comments(note_id) ← 本 skill,批量抓评论",
  66. "3. (翻页)xiaohongshu-note-comments(note_id, cursor=上次的 data.cursor) → 直到 has_more=false",
  67. "4. 下游 NLP 聚类:痛点/亮点/场景/人群"
  68. ]
  69. },
  70. "usageExamples": [
  71. {
  72. "name": "爆款笔记评论采集",
  73. "input": {
  74. "note_id": "665f95200000000006005624"
  75. },
  76. "description": "首次请求,抓取第一页评论(约 10-20 条,按热度排序)"
  77. },
  78. {
  79. "name": "评论翻页",
  80. "input": {
  81. "note_id": "665f95200000000006005624",
  82. "cursor": "65ab1234567890abcdef"
  83. },
  84. "description": "根据上次响应的 data.cursor 继续翻页"
  85. }
  86. ],
  87. "reportMapping": {
  88. "slides": [
  89. "小红书用户 VOC 原声",
  90. "小红书用户痛点聚类",
  91. "小红书使用场景洞察"
  92. ],
  93. "dataPoints": [
  94. "用户真实评论文本",
  95. "高赞评论(共识指标)",
  96. "子评论讨论热点",
  97. "评论 IP 地域分布",
  98. "用户表达关键词"
  99. ]
  100. },
  101. "timeout": 60000,
  102. "retry": {
  103. "maxAttempts": 3,
  104. "delay": 2000,
  105. "backoffMultiplier": 2,
  106. "retryOn": [400, 429, 500, 502, 503, 504]
  107. },
  108. "notes": "本 skill 使用共享社媒数据订阅(/thapi/ 网关),不经过 APIG 计费。评论按热度排序,单次返回约 10-20 条。"
  109. }