Search code examples
youtubeyoutube-apiyoutube-data-api

Search youtube channel for specific video id's


I have a large array of video id's. (Over 100) I need to determine which videos belong to the oauth'd user. Looking through the Youtube API docs it doesn't look like they have a way to get videos by ID for a channel. I see how to get all videos for a channel but that looks like it limits the results. Is there an efficient way to do this that I'm missing?

Ideally I'd like to say grab all videos with this id that belong to this channel. I'd accept a way to just get all videos for the users channel so I can compare the array of videos with my array of id's.

Using Laravel socialite and the PHP google api client.


Solution

  • You can either

    1. Get videos by IDs using the videos:list API endpoint. The id parameter takes up to 50 comma-separated videoIDs.

    or

    1. Get all videos in a channel using the channels:list API endpoint. The id parameter takes up to 50 comma-separated channelIDs. Each page of results has up to 50 videos.

    If you already have the videoIDs, option 1 would be best.