Look at this link , there is an example given
https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&key=YOUR_API_KEY
&part=snippet,contentDetails,statistics,status
Part of the response is
"contentDetails": {
"duration": "PT15M51S",
"aspectRatio": "RATIO_16_9"
},
Now I want to retrieve contentDetails or mainly duration. So I called using
https://www.googleapis.com/youtube/v3/search?part=snippet,contentDetails&key=[API_KEY]&q=something&maxResults=15&&fields=items,nextPageToken,prevPageToken,tokenPagination
It shows
{
error: {
errors: [
{
domain: "youtube.part",
reason: "unknownPart",
message: "contentDetails",
locationType: "parameter",
location: "part"
}
],
code: 400,
message: "contentDetails"
}
}
Why? What am I missing? How to retrieve the duration for videos?