Can contentOwners use youtube analytics API to find ContentType(uploaderType) of a video - youtube

Using CMS account we can download raw data files from youtube(https://cms.youtube.com/cyc_download_reports).
This csv does have information whether a video was Partner-provided or UGC.
The corresponding closest match from Youtube Analytics API I believe is using the uploaderType
GET https://www.googleapis.com/youtube/analytics/v1/reports?ids=contentOwner%3D%3DXXXXXXXXXXXXXXX&start-date=2013-06-17&end-date=2013-06-21&metrics=views&filters=uploaderType%3D%3Dself&key={YOUR_API_KEY}
But this is at a contentOwner Level rather than at video level.Kindly let me know if I am missing something.

You're not missing anything. You can run a content-owner YouTube Analytics API report and use the uploaderType as a filter, to find stats about all the videos underneath that content owner that have a specific uploader type value. You can't request uploaderType as a dimension in a request with a video== or channel== filter, though.
The matrix of supported parameters is at https://developers.google.com/youtube/analytics/v1/content_owner_reports#Reports

Related

YouTube API V3 - How to get normalized game title?

I am trying to get the normalized game name using youtube API for a video if it is in Gaming category.
For example: https://www.youtube.com/watch?v=qIvWgSpy31k, for this video I can see its normalized game name is the description:
But when I use the videos.list method, I can not see this returned. After checking all the properties for the video, I can not find it either.
Is there any way to fetch the game name?
That information isn't exposed by the YouTube API. You can see that by checking the documentation for Videos.list which returns a list of videos resources this is the information available about a video.
You can request it as a new feature here gdata-issues why they are using a gdata forum for issues I have no idea.
I've encountered the same problem, so far in 2020 they haven't implemented it yet. It looks more like business issue. The only way to get game title bound to video is webscraping. I've used headless browser library for Java called HtmlUnit. When you go to the direct url of the video you want to scrape just get html from it and use the regex listed below to acquire game title.
(?<=,"title":\{"simpleText":").*?(?="},"subtitle")

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 Search by Tags

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[]

Youtube API v3 Return Lat/Lng

I can search lat/long with YouTube v3 successfully,
https://www.googleapis.com/youtube/v3/search?part=snippet,id&maxResults=50&type=video& videoType=any&key=foobar&location=40.7127,74.0059&locationRadius=100km
However, the response doesnt give me the individual videos lat/lng in the results.
The API doc says:
The part parameter specifies a comma-separated list of one or more
search resource properties that the API response will include. Set the
parameter value to snippet.
I cannot find any other search resource properties besides id and snippet in Search:list.
(Why would the API include that first sentence if there are only 2 options?) I digress.
Question-
Is there any way that I can retrieve YT videos lat/long based on lat/long search?
You can have lat/long parameters of the videos you own or manage. But due to privacy reasons (been able to locate people from their uploads.) you won't be able to get specific geolocations of other people's uploads.

Obtain analytical data for a specific video within a date range

So after scouring the youtube API, and thinking that this may not be possible, I'll give a last try here.
In a nutshell, I am trying to obtain analytical data from youtube's analytics's API for specific videos for a date range (by day if possible). I've found ways to get the channel data that the video reside in, but I have been unable to find how to ontain the specific video data itself. Assuming it exists in v3 that is.
Anyone had any luck with this kind of task at all? Has this feature been developed for v3 as of yet?
Channel Reports is the API to retrieve video metrics. It can filter by video, by country, by lead (for some fields) and accepts timespan and data aggregation granularity. In brief, Available Reports lists all the valid query parameter combinations.
Individual comments can be retrieved with v2 Data API - together with their dates.

Resources