以下清單列出此方法的常見用途。將滑鼠遊標懸停在用途上,即可查看相關說明,或按一下用途,在 API Explorer 中載入範例參數值。您可以開啟全螢幕 API Explorer 查看程式碼範例,這些程式碼範例會動態更新以反映在 Explorer 中輸入的參數值。
下表列出此方法的常見用途。按一下用途名稱,即可在 APIs Explorer 中載入範例參數值。或者,您也可以按一下用途名稱下方的程式碼圖示,在全螢幕 API Explorer 中查看用途的程式碼範例。在全螢幕使用者介面中,您可以更新參數和屬性值,程式碼範例就會動態更新,反映輸入的值。
此方法有一個常見用途,說明如下。說明下方的按鈕會將範例值填入 API Explorer,或是開啟全螢幕 APIs Explorer,顯示使用這些值的程式碼範例。如果您變更這些值,程式碼範例也會動態更新。
Use cases | |
---|---|
list (by keyword) | This example retrieves the first 25 search results associated with the keyword surfing. By default, the type parameter does not specify a value, which means the response could include videos, playlists, and channels. |
list (by location) | This example retrieves search results associated with the keyword surfing that also specify in their metadata a geographic location within 10 miles of the point identified by the location parameter value. (The sample request specifies a point on the North Shore of Oahu, Hawaii . The request retrieves the top five results, which is the default number returned when the maxResults parameter is not specified. |
list (live events) | This example retrieves a list of active live broadcasts (see the eventType parameter value) that are associated with the keyword news. Since the eventType parameter is set, the request must also set the type parameter value to video . |
list (my videos) | This example searches within the authorized user's videos for videos that match the keyword fun. The forMine parameter indicates that the response should only search within the authorized user's videos. Also, since this request uses the forMine parameter, it must also set the type parameter value to video .If you have not uploaded any videos associated with that term, you will not see any items in the API response list. |