YouTube에서 Shorts 동영상의 조회수를 집계하는 방식에 맞게 Data API를 업데이트하고 있습니다.
자세히 알아보기
Thumbnails: set
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
YouTube에 맞춤 동영상 미리보기 이미지를 업로드하고 이를 동영상에 설정합니다.
이 방법은 미디어 업로드를 지원합니다. 업로드한 파일은 다음 제한사항을 따라야 합니다.
- 최대 파일 크기: 2MB
- 허용되는 미디어 MIME 유형:
image/jpeg
, image/png
, application/octet-stream
할당량 영향: 이 메서드를 호출하면 약 50단위의 할당량 비용이 발생합니다.
일반적인 사용 사례
요청
HTTP 요청
POST https://www.googleapis.com/upload/youtube/v3/thumbnails/set
승인
이 요청에는 다음 범위 중 최소 하나를 사용하여 인증이 필요합니다. (인증 및 승인에 대해 자세히 알아보기)
범위 |
https://www.googleapis.com/auth/youtubepartner |
https://www.googleapis.com/auth/youtube.upload |
https://www.googleapis.com/auth/youtube |
https://www.googleapis.com/auth/youtube.force-ssl |
매개변수
다음 표에는 이 쿼리가 지원하는 매개변수가 나와 있습니다. 나열된 모든 매개변수는 쿼리 매개변수입니다.
매개변수 |
필수 매개변수 |
videoId |
string
videoId 매개변수는 맞춤 동영상 썸네일이 제공될 YouTube 동영상 ID를 지정합니다. |
선택적 매개변수 |
onBehalfOfContentOwner |
string
참고: 이 매개변수는 YouTube 콘텐츠 파트너 전용입니다.
onBehalfOfContentOwner 매개변수는 요청의 승인 사용자 인증 정보가 매개변수 값에 지정된 콘텐츠 소유자를 대신하는 YouTube CMS 사용자를 식별함을 나타냅니다. 이 매개변수는 다양한 YouTube 채널을 소유하고 관리하는 YouTube 콘텐츠 파트너를 위한 것입니다. 콘텐츠 소유자가 각 채널에 사용자 인증 정보를 제공하지 않고도 한 번만 인증하면 모든 동영상 및 채널 데이터에 액세스할 수 있습니다. 사용자가 인증할 실제 CMS 계정은 지정된 YouTube 콘텐츠 소유자에게 연결되어야 합니다. |
요청 본문
요청 본문에 업로드 중인 썸네일 이미지가 포함되어 있습니다. 요청 본문에 thumbnail
리소스가 포함되어 있지 않습니다.
응답
요청에 성공할 경우 이 메소드는 다음과 같은 구조의 응답 본문을 반환합니다.
{
"kind": "youtube#thumbnailSetResponse",
"etag": etag,
"items": [
thumbnail resource
]
}
속성
다음 표는 이 리소스에 표시되는 속성을 정의합니다.
속성 |
kind |
string
API 리소스 유형을 식별합니다. 값은 youtube#thumbnailSetResponse 입니다. |
etag |
etag
이 리소스의 Etag입니다. |
items[] |
list
썸네일 목록입니다. |
오류
다음 표에서는 이 메서드에 대한 호출에 대한 응답으로 API가 반환할 수 있는 오류 메시지를 확인합니다. 자세한 내용은 오류 메시지 설명서를 참조하세요.
오류 유형 |
오류 세부정보 |
설명 |
badRequest (400) |
invalidImage |
제공된 이미지 콘텐츠가 잘못되었습니다. |
badRequest (400) |
mediaBodyRequired |
요청에 이미지 콘텐츠가 포함되어 있지 않습니다. |
forbidden (403) |
forbidden |
지정된 동영상에 썸네일을 설정할 수 없습니다. 요청이 제대로 인증되지 않았을 수 있습니다. |
forbidden (403) |
forbidden |
인증된 사용자에게 맞춤 동영상 미리보기 이미지를 업로드하고 설정할 수 있는 권한이 없습니다. |
notFound (404) |
videoNotFound |
미리보기 이미지를 삽입하려는 동영상을 찾을 수 없습니다. 요청의 videoId 매개변수 값이 올바른지 확인하세요. |
tooManyRequests (429) |
uploadRateLimitExceeded |
채널에 최근 너무 많은 썸네일이 업로드되었습니다. 나중에 다시 요청해 주세요. |
사용해 보기
APIs Explorer를 사용하여 이 API를 호출하고 API 요청 및 응답을 확인하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-04-26(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-04-26(UTC)"],[],[],null,["# Thumbnails: set\n\nUploads a custom video thumbnail to YouTube and sets it for a video.\n\nThis method supports media upload. Uploaded files must conform to these constraints:\n\n- **Maximum file size:** 2MB\n- **Accepted Media MIME types:** `image/jpeg`, `image/png`, `application/octet-stream`\n\n**Quota impact:** A call to this method has a [quota cost](/youtube/v3/getting-started#quota) of approximately 50 units.\n\nCommon use cases\n----------------\n\nThe list below shows common use cases for this method. Hover over a use case to see its description, or click on a use case to load sample parameter values in the APIs Explorer. You can open the [fullscreen APIs Explorer](#) to see code samples that dynamically update to reflect the parameter values entered in the Explorer.\n\nThe table below shows common use cases for this method. You can click on a use case name to load sample parameter values in the APIs Explorer. Or you can see code samples for a use case in the fullscreen APIs Explorer by clicking on the code icon below a use case name. In the fullscreen UI, you can update parameter and property values and the code samples will dynamically update to reflect the values you enter. \nThis method has one common use case, which is described below. The buttons below the description populate the APIs Explorer with sample values or open the fullscreen APIs Explorer to show code samples that use those values. The code samples also dynamically update if you change the values.\n\n\u003cbr /\u003e\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/upload/youtube/v3/thumbnails/set\n```\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes ([read more about authentication and authorization](/youtube/v3/guides/authentication)).\n\n| Scope |\n|-----------------------------------------------------|\n| `https://www.googleapis.com/auth/youtubepartner` |\n| `https://www.googleapis.com/auth/youtube.upload` |\n| `https://www.googleapis.com/auth/youtube` |\n| `https://www.googleapis.com/auth/youtube.force-ssl` |\n\n### Parameters\n\nThe following table lists the parameters that this query supports. All of the parameters listed are query parameters.\n\n| Parameters ||\n|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| **Required parameters** |||\n| `videoId` | `string` The **videoId** parameter specifies a YouTube video ID for which the custom video thumbnail is being provided. |\n| **Optional parameters** |||\n| `onBehalfOfContentOwner` | `string` **Note:** This parameter is intended exclusively for YouTube content partners. The **onBehalfOfContentOwner** parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. |\n\n### Request body\n\nThe body of the request contains the thumbnail image that you are uploading. The request body does not contain a [thumbnail](/youtube/v3/docs/thumbnails#resource-representation) resource.\n\nResponse\n--------\n\nIf successful, this method returns a response body with the following structure: \n\n```objective-c\n{\n \"kind\": \"youtube#thumbnailSetResponse\",\n \"etag\": etag,\n \"items\": [\n thumbnail resource\n ]\n}\n```\n\n### Properties\n\nThe following table defines the properties that appear in this resource:\n\n| Properties ||\n|-----------|------------------------------------------------------------------------------------------------|\n| `kind` | `string` Identifies the API resource's type. The value will be `youtube#thumbnailSetResponse`. |\n| `etag` | `etag` The Etag of this resource. |\n| `items[]` | `list` A list of thumbnails. |\n\nErrors\n------\n\nThe following table identifies error messages that the API could return in response to a call to this method. Please see the [error message](/youtube/v3/docs/errors) documentation for more detail.\n\n| Error type | Error detail | Description |\n|-------------------------|---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `badRequest (400)` | `invalidImage` | The provided image content is invalid. |\n| `badRequest (400)` | `mediaBodyRequired` | The request does not include the image content. |\n| `forbidden (403)` | `forbidden` | The thumbnail can't be set for the specified video. The request might not be properly authorized. |\n| `forbidden (403)` | `forbidden` | The authenticated user doesn't have permissions to upload and set custom video thumbnails. |\n| `notFound (404)` | `videoNotFound` | The video that you are trying to insert a thumbnail image for cannot be found. Check the value of the request's `videoId` parameter to ensure that it is correct. |\n| `tooManyRequests (429)` | `uploadRateLimitExceeded` | The channel has uploaded too many thumbnails recently. Please try the request again later. |\n\nTry it!\n-------\n\nUse the APIs Explorer to call this API and see the API request and response."]]