Youtube Data API - Search for video in a playlist - youtube

The YouTube API allows you to search for videos from a given channel by specifying the channel id - but is it possible to search for videos from a given playlist?
Currently I have set up using the API to get all videos from a chosen playlist
var request = 'https://www.googleapis.com/youtube/v3/playlistItems?key={{my_key}}&part=contentDetails,snippet&playlist_id={{playlist_id}}&maxResults=6';
But I cant seem to combine search - unless I get all items from the playlist and then do a search on my end. Which would be inefficient and use more of my daily allowance.

Related

Is there a way to get a youtube ID for a song using ISRC?

I've currently got a list of ISRCs (International Standard Recording Code which are unique identifiers for a song recording) and want to collect viewership count on youtube for that given song recording... I understand there's a way to query song statistics (such as viewership count, like count etc.) using the youtube API but this requires knowing the "youtube ID".
The way to get the youtube ID, according to my understanding, is by using the search feature in the youtube v3 API. However, there's no way to be definite that the search results for a song title will be an exact match to the song recording denoted by an ISRC. So, the question becomes - is there a way to get a youtube ID using a song's ISRC?

How to get metrics from YouTube Analytics API for every video which belongs to current user?

I want to get metrics (such as likes, views and subscribers gained) for every video in my youtube channel (or about 10 latest video) , how can I do it correctly?
I'm using such API call from Youtube Analytics API, but it turns out that it returns total views and total likes from all videos, not individually about every video.
`https://youtubeanalytics.googleapis.com/v2/reports?metrics=views,likes,subscribersGained&ids=channel==MINE&startDate=2014-07-03&endDate=2020-06-01&&key=${apiKey}&access_token=${token}`
I read documentation of YouTube Analytics API and I can't find this information there.
If you want the response to be grouped by video your have to specify the dimension parameter to video.
Here is a sample request from the documentation (Basic stats/Top 10 – Most watched videos for a channel):
https://developers.google.com/youtube/analytics/sample-requests#Channel_Reports
Although the note does not specify it, the sort parameter must be the first metric that you declared.
If want to get information on more that 10 videos or to pull information for the latest videos, you can specify the dimension as video and you must specify the video ids in the filter parameter as video==VIDEO1_id,VIDEO2_id....
The videos in a channel can be retrieved through the YouTube Data API from the search endpoint.
You will get a list of videos with their details as a response, among others the videoId and publishedAt values.

Search youtube channel for specific video id's

I have a large array of video id's. (Over 100) I need to determine which videos belong to the oauth'd user. Looking through the Youtube API docs it doesn't look like they have a way to get videos by ID for a channel. I see how to get all videos for a channel but that looks like it limits the results. Is there an efficient way to do this that I'm missing?
Ideally I'd like to say grab all videos with this id that belong to this channel. I'd accept a way to just get all videos for the users channel so I can compare the array of videos with my array of id's.
Using Laravel socialite and the PHP google api client.
You can either
Get videos by IDs using the videos:list API endpoint. The id parameter takes up to 50 comma-separated videoIDs.
or
Get all videos in a channel using the channels:list API endpoint. The id parameter takes up to 50 comma-separated channelIDs. Each page of results has up to 50 videos.
If you already have the videoIDs, option 1 would be best.
I have figured it out if you want to get the video with particular video id
https://www.youtube.com/watch?v=hcMzwMrr1tE
if you want the thumbnails for the particular video
https://storage.googleapis.com/yt-trends-top-ten-lists-2022/thumbs/**hcMzwMrr1tE**.jpg
put the video id you will get the details you can use google api like this

How to Retrieve the Video ID from private videos within a public Playlist- YouTube API v3?

I need some help getting the video ID number and the video title ( the title would be "Private video") for all private videos within a public playlist. Specifically I'd need help editing my script below. This script used to be able to do that, but I fear something has changed with Youtube's API. I want to know if there is any way to get this information and fix my script.
My script is located here
Just a month ago my script (see above) was able to retrieve video ID numbers and video names of private videos when fetching playlistItems from a playlistid (of course the video titles were renamed "Private video" - but that is the info I wanted). Unfortunately now when I fetch the same playlistid from youtube it hides all this info. It acts as if there are no videos in the playlist when a playlist contains private videos. Here is a question asked last year, it shows you can pull the video ID numbers and names from a playlist that contained private videos. Retrieve Video IDs contained in a Playlist - YouTube API v3
Here is an example of a playlist I would want to fetch the video ID and video name from.
https://www.youtube.com/playlist?list=PLAg_-NsALZoOLfXbX7eGIzFsbG21XAvct
I haven't tried it but you can try PlaylistItems: list and Advanced Google Services
Returns a collection of playlist items that match the API request parameters. You can retrieve all of the playlist items in a specified playlist or retrieve one or more playlist items by their unique IDs.
AFAIK if you own the private/unlisted videos, you can get the videos using Youtube API v3. You can read these related SO questions - Using the YouTube API v3 to list all private videos, Google Youtube Data API: Private videos with API key and Google YouTube API (v3): how to access my unlisted/private videos from my server? that all discuss retrieving the ID as the owner of the videos.
This issue has been fixed. You now get the behavior you were used to.

Youtube get videos and playlist accounts

I'm creating a media house mock app and am wondering whether there is a way I can get video playlists from a certain account which is not mine for example if a user has a page that is http://www.youtube.com/someuser is it possible to get all the videos and playlist from that user?
You can use youtube video feeds(Youtube RSS Video Feeds)
Make following requests using GET and read the xml data returned.
http://gdata.youtube.com/feeds/api/users/{{username}}/playlists - For playlists
http://gdata.youtube.com/feeds/api/users/{{username}}/uploads - For uploads
Orderby parameter can be used to change order of videos.

Resources