Youtube API v3 category topics - youtube-api

Hey guys I'm not having an issue with the API directly, but with the documentation. I can make an API request and get the video topic details just fine, but I am looking for a master list of all topics.
According to the documentation the old style of topics that you can see here was depreciated in 2017 and replaced with Wikipedia articles. This is fine and a little better for my use case but I would like to get a list of all options. The documentation says
A list of Wikipedia URLs that provide a high-level description of the video's content.
which is not especially helpful haha. I think I found the Wikipedia Source for all music genres, and it looks like they are just using the "main" genres but I would like to confirm that. I also found this list of topics that looks similar but is from the natural language API documentation instead of the YouTube API documentation.
I could try and brute force it but that would require a considerable amount of effort with no real way to confirm my results. I also found this API but it just returns the top level categories.
I am also really only interested in the music categories.

Related

Will topic based searches work after freebase is deprecated

Freebase will be deprecated starting Tuesday, March 31st, what does this mean for topic based searches with the youtube api? Will these queries still work?
https://www.googleapis.com/youtube/v3/search?part=snippet&relevanceLanguage=en&topicId=%2Fm%2F04qf57&type=video&videoSyndicated=true&key={YOUR_API_KEY}
I think this will be unaffected since Google Knowledge Graph API, which is the replacement of Freebase, is able to search by topicId too.
Do not quote me on this one though as there's really no documented change notes on the Youtube Data API
Also, some SO posts that contains discussions regarding the possible impact and alternatives(as of the moment) to the use of Youtube Data API and topicIds can be found here and here

search error for YouTube EDU lectures

We will provide YouTube EDU contents in our application.
I used the below API for querying the lectures in the category, and it's work well.
- http://gdata.youtube.com/feeds/api/edu/lectures?category=39&v=2
I'd like to search EDU lectures including specific keyword.
First, I used the q=keyword method, but it's not work with HTTP 403.
- http://gdata.youtube.com/feeds/api/edu/lectures?category=39&v=2&q=keyword
Second, I used the query=keyword method, it's work with out error, but the result was same without it.
- http://gdata.youtube.com/feeds/api/edu/lectures?category=39&v=2&query=keyword
Please, let me know how to query the relevant EDU content including specific keyword.
Unfortunately search is not supported with these feeds. The only thing you could try doing is filtering, using the partial response protocol in YouTube Data API V2 (https://developers.google.com/youtube/2.0/developers_guide_protocol_partial). It is rather restrictive as far as operands are concerned so I am not sure it will fit your use case.
Another idea is to look to YouTube Data API V3 and Topics API. It is not a direct replacement for the EDU feeds in v2, but perhaps it will be a good potential source for content in your application.
For educational content, you can fetch the video category using:
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.videoCategories.list?part=snippet&regionCode=US&_h=4&
then search within a category:
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=snippet&q=euler's%252Btheorem&type=video&videoCategoryId=27&_h=1&
With the search results you can learn about topic IDs for the videos, for example: VRcX9Fzu1Jo
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.videos.list?part=snippet%252C+topicDetails&id=VRcX9Fzu1Jo&_h=3&
Once you know the topic IDs, you can search for other relevant content. In this example, the topic ID is /m/0382k:
http://www.freebase.com/m/0382k - "Graph theory"
Other videos on this topic:
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=snippet&topicId=%252Fm%252F0382k&type=video&_h=4&
More information about searching by topics: https://developers.google.com/youtube/v3/guides/searching_by_topic

YouTube API comments streaming

Is there any YouTube API which enables external applications to search for keyword/brand name across all video comments on YouTube and send it back to some URL? Also, pull method is fine if the proposed push idea does not exist.
So I would like to know if my brand was mentioned in any video comment on YouTube, similar as what Twitter allows with User/Site Streams.
The YouTube API (v2.0) defines comments as a property of the video object. Details on this relationship here:
https://developers.google.com/youtube/2.0/developers_guide_protocol_comments?hl=en#Retrieve_comments
Therefore, in order to search every YouTube comment you would need to traverse the entire collection of videos. If you're going to attempt something like this, it makes sense to validate your concept by first focusing on the feeds or categories that are most relevant to your brand. Details on feed and categories here:
https://developers.google.com/youtube/2.0/developers_guide_protocol_video_feeds
https://developers.google.com/youtube/2.0/developers_guide_protocol_category_keyword_browsing
No, there isn't anything like this available from the existing youtube api (neither V2 nor V3)

Youtube Search Results as Playlist, Need Advise

Hi guys, this is my first time to post on this awesome community so
please bear with me.
I am working with a Wordpress Plugin that can display a Youtube Search Results into Video Playlist.
My settings are:
Keywords
Author
Content- channel/keyword
My first Approach was this:
with this api as reference,
search for the keyword > display the relevant results according to the author as playlist
*I'm in doubt if I this is possible, coding 30%
*I'm not sure where could I use my settings for Content
but then when my coding is in progress I recently bumped an article that says Youtube Search is differrent on Searching a Youtube Playlist
Now I can't continue my coding because I'm not sure If I'm doing it
right. Can you give me some advise with this situation or show me some
similar project/examples?
You don't have to write any YouTube Data API code for this; it's a built-in feature of the YouTube Player.
This blog post has an example of loading a list player that takes its content from the recent uploads of a channel. You can do something similar by setting listType=search&list=SEARCH_TERM, where SEARCH_TERM is whatever string you want to search for (be sure to URL escape it). You can read more in the documentation.

Is it possible to get the YouTube author name for a video using the v3 api?

So I'm working on switching to using the v3 version of the YouTube api (which is so much better it's like a completely different product), but I'm either missing something or it is ...
Being able to fetch an arbitrary list of videos, and their details, in one call is going to make life significantly better, but in the videos list method, the the video details "snippet" contains the "channelId", not the "author".
I've spent quite a bit of time looking through the documentation, but can't find any way of getting from a channelId to the human readable author name.
How am I expected to map a video to an author?
It's not possible to get back a display name (either legacy YouTube name or Google+ name) for a channel as part of the video.snippet response. You need to take the channelId and perform a channels.list(id=channelId1,channelId2,...,part=snippet) operation to get that information. The good part is that you can pass in up to 50 channel ids in a single call.
This sort of separation of information into different resources with ids effectively serving as keys linking the resources was a deliberate decision. The engineering team is aware that it will require developers to make an additional API call, but they're in favor of that design.
At the same time, the API is still in an experimental release, and if you have any feedback about using the API while doing real-world development, feel free to open a feature request in the issue tracker. If enough people give feedback about a certain aspect of the API, that could factor in to the final revision's design.
The accepted answer may have been correct at the time of writing, but as of 2/2018 the snippet part now includes a channelTitle property.

Resources