JustOneAPI의 "동영상 댓글 (V1)" API를 사용하고 싶습니다.기본 URL: https://api.justoneapi.com.API 경로: /api/weixin-channels/get-video-comment/v1API 주소: BASE_URL + /api/weixin-channels/get-video-comment/v1HTTP 메서드: POST인증: application/x-www-form-urlencoded 요청 본문에 "token" 필드를 넣으세요.OpenAPI 정의: https://docs.justoneapi.com/openapi/wechat-channels/video-comments-v1-ko.json요청 헤더:- Content-Type: application/x-www-form-urlencoded요청 본문 (폼):- token (form): 이 API 서비스의 액세스 토큰입니다. (필수)- objectId (form): 최상위 댓글을 가져올 위챗 채널 동영상 객체 ID입니다. 동영상 검색 결과가 반환한 exportId만 있다면 먼저 내보내기 ID 변환(V1) 엔드포인트 /api/weixin-channels/convert-export-id/v1을 호출해 objectId로 변환하세요. (필수)- objectNonceId (form): 선택 사항인 위챗 채널 객체 nonce ID입니다.- last_buffer (form): 직전 위챗 채널 최상위 댓글 응답에서 반환된 페이지네이션 버퍼입니다. 첫 페이지에는 비워 두세요. 이 POST 엔드포인트에서는 application/x-www-form-urlencoded 형식의 폼 본문으로 전달하세요.응답 형식: 실제 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/weixin-channels/get-video-comment/v1"headers = { "Content-Type": "application/x-www-form-urlencoded"}data = "token=YOUR_API_KEY&objectId=string&objectNonceId=&last_buffer="response = requests.post(url, headers=headers, data=data, 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")
WeChat 채널 동영상 댓글 API (V1)
객체 ID로 위챗 채널 동영상의 최상위 댓글을 조회합니다. 이어서 조회할 때 버퍼를 사용합니다. 알고 있는 동영상의 시청자 반응을 살펴볼 수 있습니다.
요청 본문
tokenstringobjectIdstringobjectNonceIdstringlast_bufferstring코드 예제
응답 필드
성공 응답(
code = 0)의 주요 필드입니다.페이지 번호 및 결과필드 4개
data위챗 채널 동영상의 최상위 댓글과 페이지 이동 정보입니다.
last_bufferstringdown_continue_flagintegercomment_infoarraydatastring댓글 내용필드 5개
data.comment_info[]요청된 비디오에 대한 첫 번째 레벨 코멘트.
comment_idstringcontentstringcreatetimestringcontent_typeintegerreply_comment_idstring작성자 및 지역필드 9개
data.comment_info[]usernamestringnicknamestringhead_urlstringip_region_infoobjectip_region_info.region_textstringauthor_contactobjectauthor_contact.usernamestringauthor_contact.nicknamestringauthor_contact.head_urlstring참여도 및 답변 수필드 6개
data.comment_info[]like_countintegerdislike_countintegerexpand_comment_countintegercontinue_flagintegerauthor_reaction_infoobjectauthor_reaction_info.author_like_timeinteger스티커 첨부필드 9개
data.comment_info[]content_infoobjectcontent_info.emoticon_infosarraycontent_info.emoticon_infos[]objectcontent_info.emoticon_infos[].descstringcontent_info.emoticon_infos[].widthintegercontent_info.emoticon_infos[].heightintegercontent_info.emoticon_infos[].emoticon_infoobjectcontent_info.emoticon_infos[].emoticon_info.Urlstringcontent_info.emoticon_infos[].emoticon_info.ThumbUrlstring답변 미리보기필드 19개
data.comment_info[]level_two_commentarraylevel_two_comment[]objectlevel_two_comment[].comment_idstringlevel_two_comment[].usernamestringlevel_two_comment[].nicknamestringlevel_two_comment[].contentstringlevel_two_comment[].createtimestringlevel_two_comment[].head_urlstringlevel_two_comment[].like_countintegerlevel_two_comment[].dislike_countintegerlevel_two_comment[].content_typeintegerlevel_two_comment[].ip_region_infoobjectlevel_two_comment[].ip_region_info.region_textstringlevel_two_comment[].author_contactobjectlevel_two_comment[].author_contact.usernamestringlevel_two_comment[].author_contact.nicknamestringlevel_two_comment[].author_contact.head_urlstringlevel_two_comment[].reply_comment_idstringlevel_two_comment[].reply_contentstring응답 예시