4

As stated in this documentation: "Search with Freebase Topics" and in the available video as well, the YouTube Data API v3 offers certain Freebase MIDs when using topicDetails as an argument for part.

My question is how can I use those returned topics for things like getting all videos that are related to that topic (which is offered as an example in the video as well) considering that the Freebase API is not available at the moment (and it will be shut down in the future)?

For example for /m/0410tth, the Google Knowledge Graph doesn't return anything when making a request to:

GET https://kgsearch.googleapis.com/v1/entities:search?ids=%2Fm%2F0410tth

and for Wikidata I still haven't found an easy way to use their data.

I know that not all of the information from Freebase has been included into GK graph, and I also know that there is a file for mappings between Freebase's MIDs and Wikidata's QIDs, but they don't seem to help me right now.

How should I make use of the topicIDs that YouTube offers me, and how can I correlate them with other YouTube videos at the moment?

This question is not about how to use Freebase MIDs for Wikidata searching, it's about the official Google response on how to make use of the relevantTopicIds that their API is offering since the documentation doesn't offer any insights into that.

Vlad
  • 997
  • 1
  • 5
  • 18

1 Answers1

3

I'm not sure what your actual question is, but the current situation is this: Freebase is deprecated, but YouTube Data API v3 still references it and video's topicDetails part returns relevant topics in a form of Freebase identifiers. While I know of no consistent way of labeling those since Freebase has been shut down, you can still use them to find relevant YouTube videos based on the identifiers alone. So for example:

GET https://www.googleapis.com/youtube/v3/videos?part=id%2Csnippet%2CtopicDetails&id=hBoCRYX6Vq0&key={YOUR_API_KEY}

Which returns:

"topicDetails": {
    "topicIds": [
     "/m/0qsc46_",
     "/m/0gs0nr"
    ],
    "relevantTopicIds": [
     "/m/03hdbf",
     "/m/03cz_9n",
     "/m/0403l3g",
     "/m/025zzc",
     "/m/06zm8z",
     "/m/0bzvm2",
     "/m/0403l3g",
     "/m/025zzc",
     "/m/06zm8z"
    ]
}
(...)

I happen to know /m/0qsc46_ is the topicId for The Witcher 3 game, I want other videos about that, so I just use YouTube search method:

GET https://www.googleapis.com/youtube/v3/search?part=id%2Csnippet&topicId=%2Fm%2F0qsc46_&type=video&key={YOUR_API_KEY}

Unfortunately AFAIK there is no way to build queries combining more than one topic.

I expect some replacement for Freebase topicIds to appear in YTD API within a few months.

jkondratowicz
  • 1,291
  • 15
  • 21
  • Thanks for the response! The question was mainly to have an official Google response on how could I use those topics now and in the future as well, based on the fact that the Freebase API will be shut down as of 31st of Aug. Also in that YouTube video they state a future work including Taxonomies. Right now the `topicDetails` part doesn't include `topicIds` every time, just `relevantTopicIds`, and also almost all of those MIDs don't appear when searching on the knowledge graph. – Vlad May 13 '16 at 11:57
  • Unfortunately you're unlikely to get an official response. In a private e-mail exchange with one of YouTube's Technical Account Managers I was assured (a year ago or something like that) that they'll surely roll out a a fully working replacement for Freebase in YouTube API before shutting it down, but now it seems not to be their priority... – jkondratowicz May 13 '16 at 12:32