YouTube API Search by Tags - asp.net-mvc

I'm trying to add videos to an existing ASP.NET MVC site, and I'd like to show videos from our YouTube channel.
I have added a tag to each video to indicate what page it should appear on. I had thought that I could search our channel by tag on each page to render the relevant video on that page.
I'm trying to exclusively use the API v3, but it seems I can't do this.
I can't use developer tags, because videos are uploaded by multiple users using the standard YouTube front end. This seems like basic functionality, so I'm assuming it's my inexperience with this API.
As an example, our YouTube channel is ChillinWithCharlie. During development, one video is tagged 20141213Cheneys.
I can get all videos in our channel, but is there a way to query the v3 API to retrieve just this video?
I've seen one suggestion here that I retrieve all videos, and filter in code. This feels inefficient, so I'd rather not do this, but I can't even see where the tag is returned with all channel videos, that I could interrogate in code.

It's not just you. There seems to be no specific query parameter to search by tag with API v3.
I would recommend doing a search with your tag in the 'q' (search) parameter, then checking the results to see if the tag exists in the returned snippet->tags property to verify the exact video.
Note YouTube tags are only visible to the video's uploader.
https://developers.google.com/youtube/v3/docs/videos#snippet.tags[]

Related

PHP Youtube API: Search videos where a URL is within the description

I'm working on a site where they have recently changed their domain. I'm trying to get a list of all the videos that contain that domain and change to the new domain using the Youtube API.
I am using the developers PHP example on search list, changing the 'q' value to be equal the old website domain and also adding a channelId parameter so that it'll only search inside their channel.
The problem is that some of the results do not contain the old URL in the description. Am I doing something wrong?
Thanks!
AFAIK there isn't any official YouTube Data API v3 endpoint to directly do what you are trying to.
If I were you I would list the YouTube channel's videos and then use Videos: list with part=snippet to retrieve their descriptions and then I would locally filter the retrieved descriptions.

How do I to POST info about a Youtube video's chapters via API?

Youtube added the ability to break up their videos in the progress bar into sections called "chapters". As seen here Video Chapters
I would like to post a video via API and add chapters, I have not been able to find any documentation or example in the API about this.
This method is not currently available in the YouTube Data api, it appears to just be part of YouTube studio.
YOu may want to add a feature request maybe its something they will add to the api.

How can I get YouTube playlist views count?

Does anyone know how this website is able to get historical views data for YouTube playlists?
From my research, YouTube API doesn't even let you get the current playlist views (I might be wrong).
I am talking about the playlist views, not the views from videos that were added to the playlist (you can see the view count here for example, on the left side - on desktop).
How can we get access to this type of data?
One more time YouTube Data API v3 doesn't provide a basic feature.
I would recommend you to use my open-source YouTube operational API. Indeed by requesting the JSON document https://yt.lemnoslife.com/playlists?part=statistics&id=PLAYLIST_ID containing item["statistics"]["viewCount"] integer, your problem is solved.
You can request up to maxResults (currently 50) playlists separating playlist ids by a comma in id, example: https://yt.lemnoslife.com/playlists?part=statistics&id=PLAYLIST_ID_0,PLAYLIST_ID_1,...,PLAYLIST_ID_49
You can also request the title of the playlist by adding snippet to part, example: https://yt.lemnoslife.com/playlists?part=snippet,statistics&id=PLAYLIST_ID

YouTube Content ID API - Views and earnings per asset

Assuming that I'm quite new to the YouTube Content ID API (and in general to YouTube Content ID), i'm looking for a method for get quickly the views and the earnings of a single asset.
Analyzing the YouTube Analytics API, I have not found anything making reference to the assets,
then I tried to base myself on the claims to obtain the data which I need. It's work, but, having to walk multiple pages, this takes many requests to the YouTube API server and it responds really slowly.
I would like, in practice, achieve a similar result:
I'm using PHP for this, but I do mostly GET requests directly basing on the documentation of YouTube Content ID API
I've found the solution:
Using the Youtube Analytics API:
ids=contentOwner==MY_CONTENT_OWNER_ID
start-date=my_start_date
end-date=my_end_date
metrics=estimatedMinutesWatched,averageViewDuration,averageViewPercentage, views,subscribersGained
dimensions=video
filters=claimedStatus==claimed
max-results=10
sort=-views
I can obtain the top 10 videos claimed sorted by views.
With the video ids, I can get the views, the earnings and the asset id using the ClaimSearch reference in YouTube Content ID API I can find the rest of the informations that I need.
EDIT:
There is a dimension missed on the official documentation: asset.
I've updated the query of Analytics API:
ids=contentOwner==MY_CONTENT_OWNER_ID
start-date=my_start_date
end-date=my_end_date
metrics=estimatedMinutesWatched,averageViewDuration,averageViewPercentage, views,subscribersGained
dimensions=asset
filters=claimedStatus==claimed
max-results=10
sort=-views
and it show directly the assets.

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)

Resources