api-samples
api-samples copied to clipboard
Search List - Querying Multiple Channel IDs Not Working
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": [
]
}
still no solution in 2020?
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}
Thanks @overclokk! Have you tested how many ID parameters are supported to call at once?
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!
Any luck with this problem??
Still actual :-/