How do I get a YouTube video thumbnail from the YouTube API?

后端 未结 30 2687
Happy的楠姐
Happy的楠姐 2020-11-21 07:06

If I have a YouTube video URL, is there any way to use PHP and cURL to get the associated thumbnail from the YouTube API?

30条回答
  •  离开以前
    2020-11-21 07:35

    Use:

    https://www.googleapis.com/youtube/v3/videoCategories?part=snippet,id&maxResults=100®ionCode=us&key=**Your YouTube ID**
    

    Above is the link. Using that, you can find the YouTube characteristics of videos. After finding characteristics, you can get videos of the selected category. After then you can find selected video images using Asaph's answer.

    Try the above approach and you can parse everything from the YouTube API.

提交回复
热议问题