Youtube Related Videos using Youtube V3 API - youtube-api

I need the API URL for Youtube Related Videos using the Youtube V3 API.
But I couldn't find the direct API call, like it is in Version 2. Did I miss something?
https://developers.google.com/youtube/v3/docs/

Are you trying to find videos related to a video?
You can use search->list call for this with specifying the "relatedToVideoId"
And for anyone looking for a coded example:
GET https://www.googleapis.com/youtube/v3/search?part=snippet&relatedToVideoId=5rOiW_xY-kc&type=video&key={YOUR_API_KEY}

Related

How can I use the deprecated YouTube Data API to get video comments?

I have an application where we would like to display YouTube video comments. In the YouTube API 2 there was support for retrieving video comments - this functionality is no longer available in API 3.
As stated in the docs:
You can continue using the v2 API for comments and uploading video
captions for now, and we'll be adding this functionality into the v3
API soon. While we don’t have specific dates yet, we will release that
functionality so that developers have as much time as possible to
migrate to v3.
...there
will not be 100% feature parity between the v2 and v3 APIs. Please see
the v3 API documentation for more details as to what functionality is
supported in v3.
As I understand it, you need to register your app through the Google Developer console for the API you wish to use first, and there is no longer an option to add YouTube API 2. I tried sending a request to the old endpoint
https://gdata.youtube.com/feeds/api/videos/VideoIdHere/comments
but got the following response
No longer available
Is there a way I can still use the API 2 to retrieve video comments? How can I accomplish this?
Edit:
YouTube video comments are now available at the following endpoint
https://www.googleapis.com/youtube/v3/commentThreads
See the docs here
Nope, API v2 is completely deprecated and no longer available. You will need to use API v3.
Example call: https://www.googleapis.com/youtube/v3/commentThreads?part=snippet%2C+replies&maxResults=50&videoId=VIDEO_ID&order=time&textFormat=plainText&key=API_KEY

How do I mark a video as watched with Youtube API v3?

I have a C# program I wrote using the Youtube API V3 that manages my channel's videos.
I already have all the OAuth 2.0 stuff sorted out and I'm looking for a way to tell Youtube that the authenticated account watched the video.
The reason being that I use the "watched" feature to determine which of the videos in my feed is the last one I actually watched.
Is there a way to do that?
Or is it purposefully not in the API because it messes with the view count?
Of course I checked Google and Google's API reference first, didn't find anything.

YouTube Data V3 API videos.insert - wrong snippet.categoryID

I am trying to upload the video using V3 YouTube API.
https://developers.google.com/youtube/v3/docs/videos/insert
I keep hitting HTTP 400 due to incorrect snippet.categoryID field. Is there any documentation on what available options on this field are?
I've got the answer on YouTube itself. When you upload a video, use web developer tools in browser to inspect categories dropdown. It will contain category ids.

How to get the gdata address for a youtube channel?

Hey Developer's I am working on an android app. I see this gdata.youtube kind of address in tutorials. I need to get one for my channel. Please how do i go about it.
Thanks.
The gdata links are from YouTube Data API v2.0 which is deprecated. You should look into Youtube Data API v3.0.
Here is how to get started: https://developers.google.com/youtube/v3/
If you just want to get information about your channel use this link:
https://content.googleapis.com/youtube/v3/channels?part=snippet&mine=true&key=YOURAPIKEY
Replace YOURAPIKEY with the public access API key from https://console.developers.google.com/project

Get views referrers in Youtube API V3 or in Youtube Analytics

Does anyone know if it's possible to get referrers / sources of the views in the new experimental Youtube API v3? We checked these plus the experimental Youtube Analytics API, but this doesn't seem to be possible.
We'd like to get the Referrers report as we can find here in the V2: https://developers.google.com/youtube/2.0/developers_guide_protocol_insight
Thanks,
Stéphane
The YouTube Analytic V3 api does not include a way to get referrers or sources. The available metrics can be viewed on this page. https://developers.google.com/youtube/analytics/v1/dimsmets/mets
If you would more metrics to be added please file a feature request here. https://code.google.com/p/gdata-issues/issues/entry?template=YouTube%20(Enhancement%20Request)

Resources