YouTube에서 Shorts 동영상의 조회수를 집계하는 방식에 맞게 Data API를 업데이트하고 있습니다.
자세히 알아보기
Comments: list
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
API 요청 매개변수와 일치하는 주석 목록을 반환합니다.
할당량 영향: 이 메서드를 호출하면 1단위의 할당량 비용이 적용됩니다.
일반적인 사용 사례
요청
HTTP 요청
GET https://www.googleapis.com/youtube/v3/comments
매개변수
다음 표에는 이 쿼리가 지원하는 매개변수가 나와 있습니다. 나열된 모든 매개변수는 쿼리 매개변수입니다.
매개변수 |
필수 매개변수 |
part |
string
part 매개변수는 API 응답에 포함될 comment 리소스 속성 하나 이상의 쉼표로 구분된 목록을 지정합니다.
다음 목록에는 매개변수 값에 포함할 수 있는 part 이름이 포함되어 있습니다.
|
필터(다음 매개변수 중 하나만 지정) |
id |
string
id 매개변수는 검색되는 리소스에 대한 댓글 ID의 쉼표로 구분된 목록을 지정합니다. comment 리소스에서 id 속성은 댓글의 ID를 지정합니다. |
parentId |
string
parentId 매개변수는 답글을 검색해야 하는 댓글의 ID를 지정합니다.
참고: 현재 YouTube에서는 최상위 댓글에 대해서만 답글을 작성할 수 있습니다. 하지만 답장에 대한 답장은 향후 지원될 수 있습니다. |
선택적 매개변수 |
maxResults |
unsigned integer
maxResults 매개변수는 결과 집합에 반환해야 하는 최대 항목 수를 지정합니다.
참고: 이 매개변수는 id 매개변수와 함께 사용하도록 지원되지 않습니다. 사용 가능한 값: 1 ~100 기본값은 20 입니다. |
pageToken |
string
pageToken 매개변수는 반환해야 하는 결과 집합의 특정 페이지를 식별합니다. API 응답에서 nextPageToken 속성은 검색할 수 있는 결과의 다음 페이지를 식별합니다.
참고: 이 매개변수는 id 매개변수와 함께 사용하도록 지원되지 않습니다. |
textFormat |
string
이 매개변수는 API가 HTML 또는 일반 텍스트 형식의 주석을 반환해야 하는지 여부를 나타냅니다. 기본값은 html 입니다.
허용되는 값은 다음과 같습니다.
html – 주석을 HTML 형식으로 반환합니다. 기본값입니다.
plainText – 일반 텍스트 형식으로 주석을 반환합니다.
|
요청 본문
이 메소드를 호출할 때 요청 본문을 제공하지 마세요.
응답
요청에 성공할 경우 이 메소드는 다음과 같은 구조의 응답 본문을 반환합니다.
{
"kind": "youtube#commentListResponse",
"etag": etag,
"nextPageToken": string,
"pageInfo": {
"totalResults": integer,
"resultsPerPage": integer
},
"items": [
comment Resource
]
}
속성
다음 표는 이 리소스에 표시되는 속성을 정의합니다.
속성 |
kind |
string
API 리소스 유형을 식별합니다. 값은 youtube#commentListResponse 입니다. |
etag |
etag
이 리소스의 Etag입니다. |
nextPageToken |
string
pageToken 매개변수의 값으로 사용하여 결과 집합의 다음 페이지를 검색할 수 있는 토큰입니다. |
pageInfo |
object
pageInfo 객체는 결과 집합의 페이지 정보를 요약합니다. |
pageInfo.totalResults |
integer
결과 집합의 총 결과 수입니다. |
pageInfo.resultsPerPage |
integer
API 응답에 포함된 결과 수입니다. |
items[] |
list
요청 기준과 일치하는 주석 목록입니다. |
오류
다음 표에서는 이 메서드에 대한 호출에 대한 응답으로 API가 반환할 수 있는 오류 메시지를 확인합니다. 자세한 내용은 오류 메시지 설명서를 참조하세요.
사용해 보기
APIs Explorer를 사용하여 이 API를 호출하고 API 요청 및 응답을 확인하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-04-26(UTC)
[null,null,["최종 업데이트: 2024-04-26(UTC)"],[],[],null,["# Comments: list\n\nReturns a list of comments that match the API request parameters.\n\n**Quota impact:** A call to this method has a [quota cost](/youtube/v3/getting-started#quota) of 1 unit.\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```\nGET https://www.googleapis.com/youtube/v3/comments\n```\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| `part` | `string` The **part** parameter specifies a comma-separated list of one or more `comment` resource properties that the API response will include. The following list contains the `part` names that you can include in the parameter value: - `id` - `snippet` |\n| **Filters (specify exactly one of the following parameters)** |||\n| `id` | `string` The **id** parameter specifies a comma-separated list of comment IDs for the resources that are being retrieved. In a `comment` resource, the `id` property specifies the comment's ID. |\n| `parentId` | `string` The **parentId** parameter specifies the ID of the comment for which replies should be retrieved. **Note:** YouTube currently supports replies only for top-level comments. However, replies to replies may be supported in the future. |\n| **Optional parameters** |||\n| `maxResults` | `unsigned integer` The **maxResults** parameter specifies the maximum number of items that should be returned in the result set. **Note:** This parameter is not supported for use in conjunction with the [id](#id) parameter. Acceptable values are `1` to `100`, inclusive. The default value is `20`. |\n| `pageToken` | `string` The **pageToken** parameter identifies a specific page in the result set that should be returned. In an API response, the `nextPageToken` property identifies the next page of the result that can be retrieved. **Note:** This parameter is not supported for use in conjunction with the [id](#id) parameter. |\n| `textFormat` | `string` This parameter indicates whether the API should return comments formatted as HTML or as plain text. The default value is `html`. Acceptable values are: - **html** -- Returns the comments in HTML format. This is the default value. - **plainText** -- Returns the comments in plain text format. |\n\n### Request body\n\nDo not provide a request body when calling this method.\n\nResponse\n--------\n\nIf successful, this method returns a response body with the following structure: \n\n```objective-c\n{\n \"kind\": \"youtube#commentListResponse\",\n \"etag\": etag,\n \"nextPageToken\": string,\n \"pageInfo\": {\n \"totalResults\": integer,\n \"resultsPerPage\": integer\n },\n \"items\": [\n comment 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#commentListResponse`. |\n| `etag` | `etag` The Etag of this resource. |\n| `nextPageToken` | `string` The token that can be used as the value of the `pageToken` parameter to retrieve the next page in the result set. |\n| `pageInfo` | `object` The `pageInfo` object encapsulates paging information for the result set. |\n| pageInfo.`totalResults` | `integer` The total number of results in the result set. |\n| pageInfo.`resultsPerPage` | `integer` The number of results included in the API response. |\n| `items[]` | `list` A list of comments that match the request criteria. |\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)` | `operationNotSupported` | The id filter is only compatible with comments based on Google+. |\n| `forbidden (403)` | `forbidden` | One or more of the requested comments cannot be retrieved due to insufficient permissions. The request might not be properly authorized. |\n| `notFound (404)` | `commentNotFound` | One or more of the specified comments cannot be found. Check the values of the request's [id](/youtube/v3/docs/comments/list#id) and [parentId](/youtube/v3/docs/comments/list#parentId) parameters to ensure that they are correct. |\n\nTry it!\n-------\n\nUse the APIs Explorer to call this API and see the API request and response."]]