Youtube Data API: Retrieving multiple Video entries by IDs in a single request

后端 未结 5 1222
清歌不尽
清歌不尽 2021-02-02 16:09

I am wondering if there is a way to query YouTube for multiple random videos (video id\'s are known) in a single query? I am storing video id\'s in the local db and need to show

5条回答
  •  后悔当初
    2021-02-02 16:47

    In Youtube Data API version 3.0 You can do it in a simple way like this.

    https://www.googleapis.com/youtube/v3/videos?key=API_KEY&part=snippet&id=video_id1,video_id2
    

    Just add your video ids separated by comma. It will fetch you the data for all videos in JSON

    I dont know what is the limit on this, will update the answer once I find it.

提交回复
热议问题