Saturday, 15 September 2012

Video meta data using YouTube Data API v3 -



Video meta data using YouTube Data API v3 -

by using search example, able video details name, id, thumb nail url. how can video total duration using youtube info api. in advance.

you have create phone call youtube info api's video resource after create search call. can set 50 video id's in search, wont have phone call each element.

https://developers.google.com/youtube/v3/docs/videos/list

you'll want set part=contentdetails, because duration there.

for illustration next call:

https://www.googleapis.com/youtube/v3/videos?id=9bzkp7q19f0&part=contentdetails&key={your_api_key} gives result:

{ "kind": "youtube#videolistresponse", "etag": "\"xlbem5onbuofjuiugi6ikumnzr8/ny1s4th-ku477varry_u4tiqctw\"", "items": [ { "id": "9bzkp7q19f0", "kind": "youtube#video", "etag": "\"xlbem5onbuofjuiugi6ikumnzr8/hn8ilnw-dbxycctsc7jg0z51bgg\"", "contentdetails": { "duration": "pt4m13s", "dimension": "2d", "definition": "hd", "caption": "false", "licensedcontent": true, "regionrestriction": { "blocked": [ "de" ] } } } ] }

youtube youtube-data-api

No comments:

Post a Comment