curl --max-time 120 -X GET 'https://api.justoneapi.com/api/xiaohongshu/get-note-comment/v2?token=YOUR_API_KEY¬eId=VALUE'
text
JustOneAPI의 "게시물 댓글 (V2)" API를 사용하고 싶습니다.기본 URL: https://api.justoneapi.com.API 경로: /api/xiaohongshu/get-note-comment/v2?token=YOUR_API_KEY¬eId=VALUEAPI 주소: BASE_URL + /api/xiaohongshu/get-note-comment/v2?token=YOUR_API_KEY¬eId=VALUEHTTP 메서드: GET인증: URL에 "token" 쿼리 파라미터를 추가하세요.OpenAPI 정의: https://docs.justoneapi.com/openapi/xiaohongshu-rednote/note-comments-v2-ko.json요청 파라미터:- token (query): 이 API 서비스의 액세스 토큰입니다. (필수)- noteId (query): 샤오홍슈 노트 ID 또는 /explore/를 포함하는 explore URL입니다. (필수)- lastCursor (query): 직전 페이지의 페이지네이션 커서입니다. 직전 응답에서 반환한 cursor 값을 사용하세요.- sort (query): 결과의 정렬 방식입니다.사용 가능한 값- `normal`: 기본 순서- `latest`: 최신순- `like_count`: 좋아요 수 기준응답 형식: 실제 Content-Type에 따라 JSON 또는 텍스트를 안전하게 처리하세요.응답 처리 및 오류 코드1. 응답 본문의 "code" 필드에서 처리 결과를 확인하세요. 0은 성공을 뜻합니다.2. 권장 요청 제한 시간은 120초입니다. 120초가 너무 길다면 최소 60초로 설정하세요. 일부 요청은 응답을 받기 전에 시간 초과될 수 있습니다.3. API 결과 코드 - 0: 성공 - 100: 유효하지 않거나 비활성화된 토큰 - 301: 데이터 수집에 실패했습니다. 다시 시도해 주세요. - 302: 호출 빈도 제한 초과 - 303: 일일 호출 한도 초과 - 400: 잘못된 파라미터 - 500: 서버 내부 오류 - 600: 호출 권한 없음 - 601: 계정 잔액 부족 - 602: API 토큰의 누적 예산 한도 초과4. 601은 공유 계정 잔액이 부족하다는 뜻입니다. 602는 현재 API 토큰의 누적 예산 한도에 도달했다는 뜻입니다. 토큰 예산을 설정해도 공유 계정 잔액은 별도로 배정되지 않습니다.제가 사용하는 프로그래밍 언어로 이 API를 호출하고 응답을 처리하는 스크립트를 작성해 주세요.
python
import requestsBASE_URL = "https://api.justoneapi.com" # OpenAPI 서버 설정에서 제공url = BASE_URL + "/api/xiaohongshu/get-note-comment/v2?token=YOUR_API_KEY¬eId=VALUE"response = requests.get(url, timeout=120)print(response.status_code)if response.content: content_type = response.headers.get("content-type", "").lower() if "json" in content_type: try: print(response.json()) except ValueError: print(response.text) elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}: print(response.text) else: with open("response.bin", "wb") as output: output.write(response.content) print(f"Saved {len(response.content)} bytes to response.bin")
샤오홍슈(RedNote) 게시물 댓글 API (V2)
샤오홍슈(RedNote) 노트의 댓글을 조회합니다. 커서 페이지네이션과 기본, 최신, 좋아요 수 기준 정렬을 지원합니다. 피드백 검토, 대화 분석, 댓글 관리에 사용할 수 있습니다.
사용 안내
사용 방법
기본 정렬은
latest를 사용하는 것이 좋습니다.latest로 일부 노트의 댓글을 가져올 수 없으면normal로 다시 시도하세요.요청 파라미터
tokenstringnoteIdstringlastCursorstringsortstringlatest사용 가능한 값
-
normal: 기본 순서-
latest: 최신순-
like_count: 좋아요 수 기준코드 예제
응답 필드
성공 응답(
code = 0)의 주요 필드입니다.댓글 목록 및 페이징필드 13개
data응답에 소홍수 노트 댓글의 페이지가 포함될 때 반환된 필드.
commentsarrayuser_idstringcomment_countintegercomment_count_l1integerhas_morebooleancursorstringpage_contextstringcurrent_sort_strategystringall_sort_strategiesarrayall_sort_strategies[]objectall_sort_strategies[].typestringall_sort_strategies[].optional_namestringall_sort_strategies[].suffix_namestring댓글 내용필드 7개
data.comments[]노트에 대한 최상위 댓글.
idstringnote_idstringcontentstringtimeintegerip_locationstringstatusintegercomment_typeinteger댓글 작성자필드 9개
data.comments[].user이 최상위 댓글의 작성자.
useridstringred_idstringnicknamestringimagesstringcurrent_userstringai_agentbooleanlevelobjectlevel.imagestringadditional_tagsobject참여도 및 상태필드 11개
data.comments[]like_countintegerlikedbooleandownvotedbooleancollectedbooleanhiddenbooleanshow_typestringscoreintegertrack_idstringtranslation_strategyintegershare_strategyintegerfriend_liked_msgstring이미지, 주제, 언급필드 39개
data.comments[]at_usersarrayat_users[]objectat_users[].useridstringat_users[].nicknamestringat_users[].ai_agentbooleanat_users[].levelobjectat_users[].level.imagestringhash_tagsarrayhash_tags[]objecthash_tags[].namestringhash_tags[].linkstringhash_tags[].typestringhash_tags[].disable_jumpbooleanshow_tagsarrayshow_tags_v2arrayshow_tags_v2[]objectshow_tags_v2[].typestringshow_tags_v2[].textstringshow_tags_v2[].style_idstringshow_tags_v2[].posstringbiz_labelobjectbiz_label.product_reviewbooleanbiz_label.group_invitestringbiz_label.rich_textstringpicturesarraypictures[]objectpictures[].file_idstringpictures[].urlstringpictures[].origin_urlstringpictures[].widthintegerpictures[].heightintegerpictures[].box_wintegerpictures[].box_hintegerpictures[].meme_packageobjectpictures[].meme_package.meme_idstringpictures[].meme_package.image_urlstringpictures[].meme_package.widthintegerpictures[].meme_package.heightintegermedia_source_typeinteger답변 목록 및 페이징필드 3개
data.comments[]sub_comment_countintegersub_comment_cursorstringsub_commentsarray답변 작성자필드 9개
data.comments[].sub_comments[].user포함된 답변의 작성자.
useridstringred_idstringnicknamestringimagesstringcurrent_userstringai_agentbooleanlevelobjectlevel.imagestringadditional_tagsobject답변된 댓글필드 12개
data.comments[].sub_comments[].target_comment이 답변이 대상으로 하는 댓글에 대한 정보.
idstringstatusintegeruserobjectuser.useridstringuser.red_idstringuser.nicknamestringuser.imagesstringuser.current_userstringuser.ai_agentbooleanuser.levelobjectuser.level.imagestringuser.additional_tagsobject답변 내용 및 상태필드 29개
data.comments[].sub_comments[]최상위 댓글 아래에 포함된 답변.
idstringnote_idstringcontentstringtimeintegerip_locationstringlike_countintegerlikedbooleandownvotedbooleancollectedbooleanhiddenbooleanstatusintegercomment_typeintegershow_typestringscoreintegertranslation_strategyintegershare_strategyintegerfriend_liked_msgstringat_usersarrayshow_tagsarrayshow_tags_v2arrayshow_tags_v2[]objectshow_tags_v2[].typestringshow_tags_v2[].textstringshow_tags_v2[].style_idstringshow_tags_v2[].posstringbiz_labelobjectbiz_label.product_reviewbooleanbiz_label.group_invitestringbiz_label.rich_textstring응답 예시