我們正在更新 Data API,以符合 YouTube 計算 Shorts 觀看次數的方式。
瞭解詳情
GuideCategories: list
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
注意:這是淘汰公告。
自 2020 年 9 月 9 日起,guideCategories
資源和 guideCategories.list
方法均已淘汰。
傳回可與 YouTube 頻道建立關聯的類別清單。
配額影響:呼叫此方法會產生 1 個單位的配額費用。
要求
HTTP 要求
GET https://www.googleapis.com/youtube/v3/guideCategories
參數
下表列出這項查詢支援的參數。列出的所有參數都是查詢參數。
參數 |
必要參數 |
part |
string
part 參數會指定 API 回應中要包含的 guideCategory 資源屬性。將參數值設為 snippet 。
|
篩選器 (請指定下列其中一個參數) |
id |
string
id 參數會指定以半形逗號分隔的 YouTube 頻道類別 ID 清單,用於擷取資源。在 guideCategory 資源中,id 屬性會指定 YouTube 頻道類別 ID。 |
regionCode |
string
regionCode 參數會指示 API 傳回指定國家/地區可用的節目表類別清單。參數值為 ISO 3166-1 alpha-2 國家/地區代碼。 |
選用參數 |
hl |
string
hl 參數會指定 API 回應中文字值所用的語言。預設值為 en-US 。 |
回應
如果成功的話,這個方法會傳回回應內文,其結構如下:
{
"kind": "youtube#guideCategoryListResponse",
"etag": etag,
"nextPageToken": string,
"prevPageToken": string,
"pageInfo": {
"totalResults": integer,
"resultsPerPage": integer
},
"items": [
guideCategory resource
]
}
屬性
下表定義這個資源中顯示的屬性:
屬性 |
kind |
string
識別 API 資源的類型。值為 youtube#guideCategoryListResponse 。 |
etag |
etag
這項資源的 Etag。 |
nextPageToken |
string
這個權杖可用做 pageToken 參數的值,以擷取結果集中的下一頁。 |
prevPageToken |
string
這個權杖可用做 pageToken 參數的值,以擷取結果集中的上一頁。 |
pageInfo |
object
pageInfo 物件會封裝結果集的換頁資訊。 |
pageInfo.totalResults |
integer
結果集中的結果總數。 |
pageInfo.resultsPerPage |
integer
API 回應中包含的結果數量。 |
items[] |
list
可與 YouTube 頻道建立關聯的類別清單。在這個對應中,類別 ID 是對應鍵,值則是對應的 guideCategory 資源。 |
錯誤
下表列出 API 可能在呼叫這個方法時傳回的錯誤訊息。詳情請參閱錯誤訊息說明文件。
試試看!
使用 APIs Explorer 呼叫這個 API,並查看 API 要求和回應。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-22 (世界標準時間)。
[null,null,["上次更新時間:2025-07-22 (世界標準時間)。"],[[["\u003cp\u003eThe \u003ccode\u003eguideCategories\u003c/code\u003e resource and \u003ccode\u003eguideCategories.list\u003c/code\u003e method have been deprecated as of September 9, 2020.\u003c/p\u003e\n"],["\u003cp\u003eThis API method, when functional, returned a list of categories associated with YouTube channels.\u003c/p\u003e\n"],["\u003cp\u003eA call to this method has a quota cost of 1 unit.\u003c/p\u003e\n"],["\u003cp\u003eThe API request requires the \u003ccode\u003epart\u003c/code\u003e parameter with the value \u003ccode\u003esnippet\u003c/code\u003e, and either the \u003ccode\u003eid\u003c/code\u003e or \u003ccode\u003eregionCode\u003c/code\u003e as a filtering parameter.\u003c/p\u003e\n"],["\u003cp\u003eThe method's response, when functional, included properties such as \u003ccode\u003ekind\u003c/code\u003e, \u003ccode\u003eetag\u003c/code\u003e, \u003ccode\u003enextPageToken\u003c/code\u003e, \u003ccode\u003eprevPageToken\u003c/code\u003e, and \u003ccode\u003epageInfo\u003c/code\u003e, along with a list of \u003ccode\u003eguideCategory\u003c/code\u003e resources in the \u003ccode\u003eitems\u003c/code\u003e property.\u003c/p\u003e\n"]]],["The `guideCategories` resource and `guideCategories.list` method were deprecated on September 9, 2020. This method previously returned a list of YouTube channel categories. Key parameters included `part` (specifying properties), `id` (category IDs), and `regionCode` (country-specific categories). The method had a quota cost of 1 unit and did not use a request body. A successful response included metadata like `kind`, `etag`, `pageInfo`, and a list of `guideCategory` resources.\n"],null,["# GuideCategories: list\n\n**Note:** This is a deprecation announcement. \n\nThe `guideCategories` resource and the `guideCategories.list` method have both been deprecated as of September 9, 2020.\nReturns a list of categories that can be associated with YouTube channels.\n\n**Quota impact:** A call to this method has a [quota cost](/youtube/v3/getting-started#quota) of 1 unit.\n\nRequest\n-------\n\n### HTTP request\n\n```\nGET https://www.googleapis.com/youtube/v3/guideCategories\n```\n\n### Parameters\n\nThe table below 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 the `guideCategory` resource properties that the API response will include. Set the parameter value to `snippet`. |\n| **Filters (specify exactly one of the following parameters)** |||\n| `id` | `string` The **id** parameter specifies a comma-separated list of the YouTube channel category ID(s) for the resource(s) that are being retrieved. In a `guideCategory` resource, the `id` property specifies the YouTube channel category ID. |\n| `regionCode` | `string` The **regionCode** parameter instructs the API to return the list of guide categories available in the specified country. The parameter value is an [ISO 3166-1 alpha-2](http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm) country code. |\n| **Optional parameters** |||\n| `hl` | `string` The **hl** parameter specifies the language that will be used for text values in the API response. The default value is `en-US`. |\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#guideCategoryListResponse\",\n \"etag\": etag,\n \"nextPageToken\": string,\n \"prevPageToken\": string,\n \"pageInfo\": {\n \"totalResults\": integer,\n \"resultsPerPage\": integer\n },\n \"items\": [\n guideCategory 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#guideCategoryListResponse`. |\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| `prevPageToken` | `string` The token that can be used as the value of the `pageToken` parameter to retrieve the previous 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 categories that can be associated with YouTube channels. In this map, the category ID is the map key, and its value is the corresponding `guideCategory` resource. |\n\nErrors\n------\n\nThe table below 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| `notFound (404)` | `notFound` | The guide category identified by the `id` parameter cannot be found. Use the [guideCategories.list](/youtube/v3/docs/guideCategories/list) method to retrieve a list of valid values. |\n\nTry it!\n-------\n\nUse the APIs Explorer to call this API and see the API request and response."]]