如何通过视频ID使用youtube api获取视频类别

时间:2020-06-16 07:27:25

标签: api http youtube

如何通过视频ID使用youtube api获取视频类别?

https://www.googleapis.com/youtube/v3/videoCategoriespart=id&part=snippet&id=tjAsV8m24F4&key[YOUR_API_KEY]

我尝试了这个,但是结果是:

{
  "kind": "youtube#videoCategoryListResponse",
  "etag": "qeAs28_qPv1tj8F0eBP7Qqr58Hw",
  "items": []
}

没有用。

1 个答案:

答案 0 :(得分:0)

此电话:

https://www.googleapis.com/youtube/v3/videoCategories

提供有关此列表中指定VideoVategories的信息:

2 - Autos & Vehicles
1 -  Film & Animation
10 - Music
15 - Pets & Animals
17 - Sports
18 - Short Movies
19 - Travel & Events
20 - Gaming
21 - Videoblogging
22 - People & Blogs
23 - Comedy
24 - Entertainment
25 - News & Politics
26 - Howto & Style
27 - Education
28 - Science & Technology
29 - Nonprofits & Activism
30 - Movies
31 - Anime/Animation
32 - Action/Adventure
33 - Classics
34 - Comedy
35 - Documentary
36 - Drama
37 - Family
38 - Foreign
39 - Horror
40 - Sci-Fi/Fantasy
41 - Thriller
42 - Shorts
43 - Shows
44 - Trailers

您需要执行GET https://www.googleapis.com/youtube/v3/videos

获取类别ID,然后致电:

https://www.googleapis.com/youtube/v3/videoCategories

带有视频类别ID