api-samples icon indicating copy to clipboard operation
api-samples copied to clipboard

Search List - Querying Multiple Channel IDs Not Working

Open adam-hurwitz opened this issue 5 years ago • 6 comments

When including multiple YouTube channel ids in the API request the response does not return a result.

Expected

Returning video results from multiple channel ids with the API request.

Request

GET https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCiAW4HQiYjpPmyi4v905u1A%2C+UCrFCDzgIucPi7x_OzsYefWQ&key={YOUR_API_KEY}

Observed

Response

The response is empty.

{
 "kind": "youtube#searchListResponse",
 "etag": "\"XpPGQXPnxQJhLgs6enD_n8JR4Qk/-f6JA5_OcXz2RWuH1mpAA2_9mM8\"",
 "regionCode": "US",
 "pageInfo": {
  "totalResults": 0,
  "resultsPerPage": 5
 },
 "items": [
 ]
}

adam-hurwitz avatar May 30 '19 02:05 adam-hurwitz

still no solution in 2020?

neonoxd avatar Aug 19 '20 15:08 neonoxd

Solution: Add multiple ID parameter to request

GET https://www.googleapis.com/youtube/v3/search?part=snippet&id=UCiAW4HQiYjpPmyi4v905u1A%2C+UCrFCDzgIucPi7x_OzsYefWQ&id=UCiAW4HQiYjpPmyi4v905u1A%2C+UCrFCDzgIucPi7x_OzsYefWQ&key={YOUR_API_KEY}

overclokk avatar Dec 13 '20 07:12 overclokk

Thanks @overclokk! Have you tested how many ID parameters are supported to call at once?

adam-hurwitz avatar Dec 13 '20 16:12 adam-hurwitz

The proposed solution by overclokk doesn't work unfortunately. Youtube API only takes into account the first channelid provided in the request. I found it very surprising that Youtube API doesn't allow for passing more than one channelid in a search request. Opened to any other suggestions!

cdenervaux avatar Feb 25 '21 10:02 cdenervaux

Any luck with this problem??

mjarpitanand avatar Nov 20 '21 13:11 mjarpitanand

Still actual :-/

nesvet avatar Sep 10 '23 21:09 nesvet