search error for YouTube EDU lectures - youtube-api

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

Related

Is there a way to simply query the YouTube Data Api for information about a url?

It seems like pretty common problem/question on here to ask how to parse a YouTube video/user/channel/playlist url; with a lot of the answers being partial or outdated regex solutions (Meaning they don't support legacy urls or newer features like handles). Which made me wonder..
Can I simply just ask the v3 Youtube Data Api if a url is valid; then have it return any relevant information? (similar to doing a search w/the api, it'll tell you the type, id, etc.)
As far as I can tell from the reference it's not entirely possible.
The closest I could find was doing a search with the url as the query, but this unsurprisingly led to getting a list with somewhat unpredictable results.

Youtube API v3 category topics

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.

Is there a way to access the comments I make on YouTube through the API?

I'm trying to retrieve the comments I've made on YouTube to turn them into Markdown files, but I can't find a way to do it filtering by user in the API documentation.
I thought it would be possible since the Google account has a link for it but when using the parameter "channelID" in the API to list comments as it says in the documentation, it gives back a 400 error.
You are looking for the comments your channel posted, however when using CommentThreads: list with channelId=YOUR_CHANNEL_ID you are listing comments people wrote on your channel, as described the documentation:
channelId
string
The channelId parameter instructs the API to return comment threads containing comments about the specified channel. (The response will not include comments left on videos that the channel uploaded.)
One more time YouTube Data API v3 AFAIK doesn't provide this basic feature.
You have two possibilities:
Use Google TakeOut (make sure to export Comments in YouTube and YouTube Music)
Web-scrap the webpage you provided

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)

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