How to specify multiple topics in youtube search API? - youtube-api

Can I only give one topic id to search youtube videos ?
Is there a way I can give more than one parameters ?

We just rolled out support for additional video topics that are "relevant" to the video, but don't completely describe the video:
As of right now, you can just specify a single topic id to use as a search filter, but these additional topics (as well as the fact that a video can have more than a single "central" topic) do imply that providing combinations of topic ids as a filter would be useful.
Could you please file a feature request to keep track of this publicly off of Stack Overflow?

Related

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.

Get Cards for Videos from Youtube APIs

I'm trying to get a list of all cards associated with a video id. I've looked at the different Youtube APIs, but no success.
example of cards in a video
Does anyone have an idea how to do this?
Thanks
This is currently not supported by Youtube API. You can find the supported methods by Youtube API in this reference list.
Disclaimer - this is only a partial answer.
It is possible to get card stats for a given channel through the Reporting API.
To do so, you need to create a reporting job https://developers.google.com/youtube/reporting/v1/reports/channel_reports#video-cards
This will give you basic stats (card_id included) for every card of every video for one channel during the specified time interval. At this stage, we know that there are cards for a given video, we know what type of cards these are, and we have some basic stats regarding their performance. We still don't know what is behind that card.
So the follow up question is: how to query youtube APIs with a card_id to retrieve more detail information about that card?
If someone knows this, then we have a way of getting card infos for any video.

Find original content author from a re-posted video

Here's the same video, under two different channels:
https://www.youtube.com/watch?v=gYh9DCN8ads
https://www.youtube.com/watch?v=5_v7QrIW0zY
The second one is the original I believe. But if you query the api using the id 'gYh9DCN8ads', it seems like there's no information that points you to the original content creator, is there? All you can get is the channel, which is FlorianPurcarus, not Isaac Lamb.
Unfortunately, it is not possible to get the original video ID since YouTube does not make this information available to the public.
However, if you are the owner of the content and you are a Content ID partner, you are able to list active claims on one of your assets. For more information about that, please reach out to your Partner Technology Manager for more information.

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: videoEntry context in playlist

Is it possible to find the context of a video in respect to any playlist that it is included in? I would like to be able to check if the videoEntry is included in a playlist and, if so, figure out the next video in the playlist.
Flickr has a lot of great photo context methods, I hope YouTube does too, I just can't find anything on it.
Well, obviously you want to know the VideoId of the video in question first, right? So say it's "4eUibFQKJqI" and it's in a playlist whose Id is "6C0464B5CC81A607" (You can easily get those Ids from your 'My Account' section in YouTube).
If I get the feed for that playlist, then the resulting xml file gives you all the information you need to check if that Video is present, and the order that you have set in 'My Account' is preserved.
So, you have two ways of analysing the results that YouTube sends you. One is to make a request to that playlist address and parsing the results using Linq-to-Sql, if you use Asp.Net, for example. Whatever language you use, it will have Xml-parsing capabilities, so it's just a case of iterating through the entries in the feed.
If you use a library for your language, it may well have a specific method to determine whether a given video is in a given playlist, but if it doesn't, it's pretty easy to query the raw xml file and get that information, as described above.
Hope that helps - it's hard to tell from your question what level you're at with this stuff... Anyway, it's all at the Developers' Guide.
http://gdata.youtube.com/feeds/api/playlists/PLAYLIST_ID?v=2
from http://code.google.com/apis/youtube/2.0/reference.html

Resources