curl --max-time 120 -X GET 'https://api.justoneapi.com/api/twitter/get-post-comments/v1?token=YOUR_API_KEY&tweetId=VALUE'
text
JustOneAPI의 "게시물 댓글 (V1)" API를 사용하고 싶습니다.기본 URL: https://api.justoneapi.com.API 경로: /api/twitter/get-post-comments/v1?token=YOUR_API_KEY&tweetId=VALUEAPI 주소: BASE_URL + /api/twitter/get-post-comments/v1?token=YOUR_API_KEY&tweetId=VALUEHTTP 메서드: GET인증: URL에 "token" 쿼리 파라미터를 추가하세요.OpenAPI 정의: https://docs.justoneapi.com/openapi/twitter/post-comments-v1-ko.json요청 파라미터:- token (query): API 접근에 필요한 인증 토큰입니다. (필수)- tweetId (query): X(Twitter) 게시물의 고유 식별자입니다. (필수)- cursor (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/twitter/get-post-comments/v1?token=YOUR_API_KEY&tweetId=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")
Twitter 게시물 댓글 API (V1)
트윗 ID로 X(Twitter) 게시물의 최신 댓글을 조회합니다. 커서 기반 페이지네이션으로 특정 게시물의 최근 토론을 확인하고 다음 댓글 페이지를 조회할 수 있습니다.
요청 파라미터
tokenstringtweetIdstringcursorstring코드 예제
응답 필드
성공 응답(
code = 0)의 주요 필드입니다.게시물 및 답변 관계필드 14개
data.timeline[]하나의 타임라인 항목입니다. 이 항목에는 답장과 원본 게시물이 포함될 수 있습니다.
tweet_idstringcreated_atstringtextstringlangstringconversation_idstringsensitiveboolean | nulltypestringscreen_namestringdisplay_text_rangearraydisplay_text_range[]integersourcestring | nullin_reply_to_status_id_strstringin_reply_to_user_id_strstringin_reply_to_screen_namestring페이지당 항목 수필드 4개
datastatusstringtimelinearraynext_cursorstringprev_cursorstring참여도필드 6개
data.timeline[]bookmarksintegerfavoritesintegerquotesintegerrepliesintegerretweetsintegerviewsstring | null작성자필드 10개
data.timeline[].user_info이 항목의 작성자의 공개 프로필 필드입니다.
rest_idstringcreated_atstringnamestringscreen_namestringavatarstringfollowers_countintegerfavorites_countintegerverifiedbooleanverified_typestring | nulllocationstring링크 및 언급필드 23개
data.timeline[].entities게시물 텍스트와 관련된 링크, 언급, 기타 엔티티들입니다.
urlsarrayurls[]objecturls[].urlstringurls[].expanded_urlstringurls[].display_urlstringurls[].indicesarrayurls[].indices[]integeruser_mentionsarrayuser_mentions[]objectuser_mentions[].id_strstringuser_mentions[].namestringuser_mentions[].screen_namestringuser_mentions[].indicesarrayuser_mentions[].indices[]integerhashtagsarraysymbolsarraymediaarraymedia[]objectmedia[].id_strstringmedia[].typestringmedia[].media_url_httpsstringmedia[].indicesarraymedia[].indices[]integer이미지 및 동영상필드 18개
data.timeline[].media미디어 첨부파일. 첨부파일이 없을 경우 응답에 빈 배열을 사용할 수 있음.
photoarrayphoto[]objectphoto[].idstringphoto[].media_url_httpsstringphoto[].sizesobjectphoto[].sizes.hintegerphoto[].sizes.wintegervideoarrayvideo[]objectvideo[].idstringvideo[].media_url_httpsstringvideo[].variantsarrayvideo[].variants[]objectvideo[].variants[].urlstringvideo[].variants[].content_typestringvideo[].variants[].bitrateintegervideo[].aspect_ratioarrayvideo[].aspect_ratio[]integer인용된 게시물필드 38개
data.timeline[].quoted이 항목에 의해 인용된 게시물, 사용 가능할 경우.
tweet_idstringcreated_atstringtextstringlangstringconversation_idstringsensitiveboolean | nullbookmarksintegerfavoritesintegerquotesintegerrepliesintegerretweetsintegerviewsstring | nullauthorobjectauthor.rest_idstringauthor.created_atstringauthor.namestringauthor.screen_namestringauthor.avatarstringauthor.blue_verifiedbooleanmediaobject | arraymedia.photoarraymedia.photo[]objectmedia.photo[].idstringmedia.photo[].media_url_httpsstringmedia.photo[].sizesobjectmedia.photo[].sizes.hintegermedia.photo[].sizes.wintegermedia.videoarraymedia.video[]objectmedia.video[].idstringmedia.video[].media_url_httpsstringmedia.video[].variantsarraymedia.video[].variants[]objectmedia.video[].variants[].urlstringmedia.video[].variants[].content_typestringmedia.video[].variants[].bitrateintegermedia.video[].aspect_ratioarraymedia.video[].aspect_ratio[]integer응답 예시