I am writing some functions with the Youtube API version 3
. I am using python
but confirmed my error in the google provided test console.
(I am making all authorized requests, just didn't paste my key below)
The Python client library automatically adds the forMine
parameter to my Search().list()
request, though I can set it to false. I am unable to remove the parameter from my request, if I omit the argument, it defaults to true. If I set it to false, I get this error:
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://www.googleapis.com/youtube/v3/search?forMine=false&maxResults=50&q=week&part=snippet&alt=json&type=playlist&order=date returned "The request contains an invalid combination of search filters and/or restrictions. Note that you must set the <code>type</code> parameter to <code>video</code> if you set a value for the <code>eventType</code>, <code>videoCaption</code>, <code>videoCategoryId</code>, <code>videoDefinition</code>, <code>videoDimension</code>, <code>videoDuration</code>, <code>videoEmbeddable</code>, <code>videoLicense</code>, <code>videoSyndicated</code>, or <code>videoType</code> parameters.">
Symptoms on the API Explorer:
request that fails (forMine
parameter removed):
GET https://www.googleapis.com/youtube/v3/search?part=snippet&forMine=false&q=week&type=playlist&key={YOUR_API_KEY}
request that doesn't fail (forMine
parameter set to false):
GET https://www.googleapis.com/youtube/v3/search?part=snippet&q=week&type=playlist&key={YOUR_API_KEY}
my python code that fails which I believe should work:
result = youtube_service.search().list(part='snippet', forMine=False, q='test', type='playlist', maxResults=50).execute()
Can anyone verify that this is either my bug or an API bug?