curl --max-time 120 -X GET 'https://api.justoneapi.com/api/youtube/get-video-sub-comment/v1?token=YOUR_API_KEY&cursor=VALUE'
text
JustOneAPI의 "동영상 대댓글 목록 (V1)" API를 사용하고 싶습니다.기본 URL: https://api.justoneapi.com.API 경로: /api/youtube/get-video-sub-comment/v1?token=YOUR_API_KEY&cursor=VALUEAPI 주소: BASE_URL + /api/youtube/get-video-sub-comment/v1?token=YOUR_API_KEY&cursor=VALUEHTTP 메서드: GET인증: URL에 "token" 쿼리 파라미터를 추가하세요.OpenAPI 정의: https://docs.justoneapi.com/openapi/youtube/video-sub-comment-list-v1-ko.json요청 파라미터:- token (query): 이 API 서비스의 액세스 토큰입니다. (필수)- cursor (query): 최상위 댓글 응답에서 가져온 답글 조회 커서입니다. (필수)- languageCode (query): 응답 데이터에 적용할 언어 설정입니다.- countryCode (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/youtube/get-video-sub-comment/v1?token=YOUR_API_KEY&cursor=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")
YouTube 동영상 대댓글 목록 API (V1)
YouTube 댓글의 연속 조회 커서와 연결된 답글을 가져옵니다. 언어·지역 설정은 선택 사항입니다. 최상위 댓글 아래에 이어지는 대화를 따라갈 수 있습니다.
요청 파라미터
tokenstringcursorstringlanguageCodestringzh-CNcountryCodestringUS코드 예제
응답 필드
성공 응답(
code = 0)의 주요 필드입니다.답변 및 페이지 나누기필드 7개
dataYouTube 댓글의 답글입니다. 답글을 조회할 때는 상위 댓글의 reply_continuation_token을 이 엔드포인트의 cursor에 전달하세요.
commentsarraycomments[]objectcomments[].comment_idstringcomments[].contentstringcomments[].published_timestringcomments[].reply_levelintegercontinuation_token참여 횟수필드 4개
data.comments[]like_countstringlike_count_a11ystringreply_countstringreply_count_a11ystring답변 작성자필드 10개
data.comments[]creator_thumbnail_urlauthorobjectauthor.channel_idstringauthor.display_namestringauthor.channel_urlstringauthor.avatar_urlstringauthor.avatar_thumbnailsauthor.is_verifiedbooleanauthor.is_creatorbooleanauthor.is_artistboolean응답 예시