Danh sách dưới đây cho thấy các trường hợp sử dụng phổ biến cho phương thức này. Di chuột qua một trường hợp sử dụng để xem phần mô tả của trường hợp đó hoặc nhấp vào một trường hợp sử dụng để tải các giá trị tham số mẫu trong APIs Explorer. Bạn có thể mở trình khám phá API toàn màn hình để xem các mã mẫu tự động cập nhật nhằm phản ánh các giá trị tham số được nhập vào Explorer.
Bảng dưới đây trình bày các trường hợp sử dụng phổ biến cho phương thức này. Bạn có thể nhấp vào tên trường hợp sử dụng để tải các giá trị tham số mẫu trong APIs Explorer. Ngoài ra, bạn có thể xem mã mẫu cho một trường hợp sử dụng trong Trình khám phá API toàn màn hình bằng cách nhấp vào biểu tượng mã bên dưới tên trường hợp sử dụng. Trong giao diện người dùng toàn màn hình, bạn có thể cập nhật các giá trị tham số và thuộc tính. Mã mẫu sẽ tự động cập nhật để phản ánh các giá trị mà bạn nhập.
Phương thức này có một trường hợp sử dụng phổ biến, theo mô tả dưới đây. Các nút bên dưới phần mô tả sẽ điền các giá trị mẫu vào APIs Explorer hoặc mở APIs Explorer toàn màn hình để hiển thị mã mẫu sử dụng các giá trị đó. Các mã mẫu cũng tự động cập nhật nếu bạn thay đổi các giá trị.
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. |