Is there a YouTube API that can give me structured metadata about a video? -
using youtube api, how can fetch structured data video? instance, given video movie trailer, how can find movie title or topic in structured format, , other interesting metadata such celebrities featured or director?
yes. v3 api allows do via videos/list. here's example api call using trailer dark knight rises:
get https://www.googleapis.com/youtube/v3/videos?part=topicdetails&id=g8evye9tuyk&fields=items%2ftopicdetails%2ftopicids&key={your_api_key}
(to developer key, follow instructions in our video tutorial).
that sets:
topic: topicdetails id: g8evye9tuyk fields: items/topicdetails/topicids
in response body, get:
{ "items": [ { "topicdetails": { "topicids": [ "/m/0bpm4yw", "/m/01d5g", "/m/0btpm6", "/m/0184dt", "/m/02vxn" ] } } ] }
these correspond freebase mids, can lookup using freebase api. instance, first response corresponds freebase entity dark knight rises (movie). once entity, can related entities such director, actors, or genre.
play around api explorer bit. when you're ready translate code, watch out video turning api reference code.
Comments
Post a Comment