I am currently writing an endpoint to return data for videos from two youtube channels. Currently using the method of making the request via url and fetch() and want to continue using this. How do I construct the URL such that it returns the data for two channels and not one. My current URL is shown below:
lets say channel1 = foo and I want to query for channel2 = bar also, without using a second url and making a second query.
let url = `https://www.googleapis.com/youtube/v3/search?key=${process.env.YOUTUBE_API_KEY}&part=snippet&q=foo`;
Any help would be greatly appreciated.
Your example call uses "q=foo" where you say foo is channel1. However "q" is for the query term so the API would search all channels for "foo".
To limit a search to a channel you would use the "channelId" parameter, and you an only use one per call.
See https://developers.google.com/youtube/v3/docs/search/list