curl --max-time 120 -X GET 'https://api.justoneapi.com/api/weibo/get-post-comments/v1?token=YOUR_API_KEY&mid=VALUE'
text
JustOneAPI의 "게시물 댓글 (V1)" API를 사용하고 싶습니다.기본 URL: https://api.justoneapi.com.API 경로: /api/weibo/get-post-comments/v1?token=YOUR_API_KEY&mid=VALUEAPI 주소: BASE_URL + /api/weibo/get-post-comments/v1?token=YOUR_API_KEY&mid=VALUEHTTP 메서드: GET인증: URL에 "token" 쿼리 파라미터를 추가하세요.OpenAPI 정의: https://docs.justoneapi.com/openapi/weibo/post-comments-v1-ko.json요청 파라미터:- token (query): API 액세스 토큰입니다. (필수)- mid (query): 웨이보 게시물의 mid입니다. (필수)- sort (query): 결과의 정렬 순서입니다.사용 가능한 값- `TIME`: 작성 시각순- `HOT`: 인기순- maxId (query): 직전 응답에서 반환한 페이지네이션 커서입니다.응답 형식: 실제 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/weibo/get-post-comments/v1?token=YOUR_API_KEY&mid=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")
웨이보 게시물 댓글 API (V1)
MID로 지정한 웨이보 게시물의 댓글을 가져옵니다. 선택적으로 maxId 커서를 사용하고 작성 시각이나 인기도순으로 정렬할 수 있습니다. 댓글을 이어서 읽거나 대화 검토, 콘텐츠 관리, 피드백 분석에 활용하세요.
요청 파라미터
tokenstringmidstringsortstringTIME사용 가능한 값
-
TIME: 작성 시각순-
HOT: 인기순maxIdstring코드 예제
응답 필드
성공 응답(
code = 0)의 주요 필드입니다.페이지 번호 및 필터필드 12개
data요청한 페이지의 웨이보 게시물 댓글, 대댓글 미리보기 및 페이지네이션 정보입니다.
okintegertotal_numberintegermax_idintegerdataarraydata[]objectrootCommentarraytip_msgstringtrendsTextstringfilter_grouparrayfilter_group[]objectfilter_group[].titlestringfilter_group[].isDefaultinteger최상위 댓글필드 15개
data.data[]idintegeridstrstringmidstringrootidintegerrootidstrstringfloor_numberintegercreated_atstringtextstringtext_rawstringsourcestringsource_allowclickintegersource_typeintegerdisable_replyintegerlike_countsintegerisLikedByMblogAuthorboolean최상위 댓글 작성자필드 45개
data.data[]userobjectuser.idintegeruser.idstrstringuser.screen_namestringuser.profile_image_urlstringuser.avatar_largestringuser.avatar_hdstringuser.cover_image_phonestringuser.profile_urlstringuser.domainstringuser.weihaostringuser.urlstringuser.descriptionstringuser.locationstringuser.genderstringuser.verifiedbooleanuser.verified_typeintegeruser.verified_type_extintegeruser.verified_reasonstringuser.followers_countintegeruser.followers_count_strstringuser.friends_countintegeruser.statuses_countintegeruser.status_total_counterobjectuser.status_total_counter.total_cnt_formatstring | integeruser.status_total_counter.comment_cntstringuser.status_total_counter.repost_cntstringuser.status_total_counter.like_cntstringuser.status_total_counter.total_cntstringuser.mbrankintegeruser.mbtypeintegeruser.svipintegeruser.vvipintegeruser.icon_listarrayuser.icon_list[]objectuser.icon_list[].typestringuser.icon_list[].dataobjectuser.icon_list[].data.mbrankintegeruser.icon_list[].data.mbtypeintegeruser.icon_list[].data.svipintegeruser.icon_list[].data.vvipintegeruser.icon_list[].data.valuestringuser.icon_list[].data.icon_imgstringuser.icon_list[].data.titlestringuser.icon_list[].data.urlstring주제, 링크 및 표시필드 33개
data.data[]url_objectsarraypic_numintegertopic_structarraytopic_struct[]objecttopic_struct[].titlestringtopic_struct[].topic_titlestringtopic_struct[].topic_urlstringurl_structarrayurl_struct[]objecturl_struct[].url_titlestringurl_struct[].url_type_picstringurl_struct[].ori_urlstringurl_struct[].short_urlstringurl_struct[].long_urlstringurl_struct[].h5_target_urlstringurl_struct[].page_idstringurl_struct[].url_typestringurl_struct[].object_typestringcomment_bubbleobjectcomment_bubble.idstringcomment_bubble.namestringcomment_bubble.start_colorstringcomment_bubble.end_colorstringcomment_bubble.start_color_darkstringcomment_bubble.end_color_darkstringcomment_bubble.icon_urlstringcomment_bubble.tag_textstringhot_iconobjecthot_icon.urlstringhot_icon.wh_ratiostringmore_infoobjectmore_info.textstringmore_info.highlight_textstring답장 미리보기 및 개수필드 4개
data.data[]commentsarraycomments[]objecttotal_numberintegermax_idinteger답장 미리보기필드 24개
data.data[].comments[]idintegeridstrstringmidstringrootidintegerrootidstrstringfloor_numberintegercreated_atstringtextstringtext_rawstringsourcestringsource_allowclickintegersource_typeintegerdisable_replyintegerlike_countsintegerurl_objectsarraypic_numintegerreply_commentobjectlike_countintegeris_mblog_authorbooleanis_sub_cmtbooleanblogger_iconsarrayblogger_icons[]objectblogger_icons[].namestringblogger_icons[].urlstring답장 작성자 미리보기필드 41개
data.data[].comments[]userobjectuser.idintegeruser.idstrstringuser.screen_namestringuser.profile_image_urlstringuser.avatar_largestringuser.avatar_hdstringuser.cover_image_phonestringuser.profile_urlstringuser.domainstringuser.weihaostringuser.urlstringuser.descriptionstringuser.locationstringuser.genderstringuser.verifiedbooleanuser.verified_typeintegeruser.verified_type_extintegeruser.verified_reasonstringuser.followers_countintegeruser.followers_count_strstringuser.friends_countintegeruser.statuses_countintegeruser.status_total_counterobjectuser.status_total_counter.total_cnt_formatstring | integeruser.status_total_counter.comment_cntstringuser.status_total_counter.repost_cntstringuser.status_total_counter.like_cntstringuser.status_total_counter.total_cntstringuser.mbrankintegeruser.mbtypeintegeruser.svipintegeruser.vvipintegeruser.icon_listarrayuser.icon_list[]objectuser.icon_list[].typestringuser.icon_list[].dataobjectuser.icon_list[].data.mbrankintegeruser.icon_list[].data.mbtypeintegeruser.icon_list[].data.svipintegeruser.icon_list[].data.vvipinteger답변된 댓글필드 11개
data.data[].comments[].reply_commentidintegeridstrstringmidstringrootidintegerrootidstrstringfloor_numberintegercreated_atstringtextstringdisable_replyintegerurl_objectsarraypic_numinteger답변된 댓글 작성자필드 45개
data.data[].comments[].reply_commentuserobjectuser.idintegeruser.idstrstringuser.screen_namestringuser.profile_image_urlstringuser.avatar_largestringuser.avatar_hdstringuser.cover_image_phonestringuser.profile_urlstringuser.domainstringuser.weihaostringuser.urlstringuser.descriptionstringuser.locationstringuser.genderstringuser.verifiedbooleanuser.verified_typeintegeruser.verified_type_extintegeruser.verified_reasonstringuser.followers_countintegeruser.followers_count_strstringuser.friends_countintegeruser.statuses_countintegeruser.status_total_counterobjectuser.status_total_counter.total_cnt_formatstring | integeruser.status_total_counter.comment_cntstringuser.status_total_counter.repost_cntstringuser.status_total_counter.like_cntstringuser.status_total_counter.total_cntstringuser.mbrankintegeruser.mbtypeintegeruser.svipintegeruser.vvipintegeruser.icon_listarrayuser.icon_list[]objectuser.icon_list[].typestringuser.icon_list[].dataobjectuser.icon_list[].data.mbrankintegeruser.icon_list[].data.mbtypeintegeruser.icon_list[].data.svipintegeruser.icon_list[].data.vvipintegeruser.icon_list[].data.valuestringuser.icon_list[].data.icon_imgstringuser.icon_list[].data.titlestringuser.icon_list[].data.urlstring응답 예시