How to get the gdata address for a youtube channel? - youtube

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

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

Youtube API V3 how can i get channel username

I need to use youtube username in a javascript script that retrieves data from youtube API with username
the problem is that this channel has a custom url in format:
https://www.youtube.com/c/myname
but from tutorial and video i found i need to get the user from a custom url like this
https://www.youtube.com/user/myname
since, as far as i know, is not possible to set an url and surname based on second url for newer channel how can i found the username?
any way to get it with API?
youtube.channels.list does NOT provide the username. you have to use Google+ API to get it.
tube_dl is the answer.
pip install tube_dl
This module is a great video downloader and youtube parser.
Here's the sample code:
from tube_dl import Youtube
yt = Youtube('your video id').channelUrl
For tube_dl documentation, visit Github Page of tube_dl
You can try out the Channels.list method on the YouTube Data API. You can pass the username and it will return the list of channels that said user have.
The YouTube Data API developer site has more information if you want to learn more about it.

How to get Youtube page's username Using Youtube API

I am trying to find the page's username through the Youtube API (******#pages.plusgoogle.com). I'm not getting this information through a request like: GET https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true
What should I do?
PS: I'm using the PHP Library.
Its not possible to get the /c/username or the /user/username via the YouTube API at this moment.

YouTube API from V2 to V3 migration

I'm still using old V2 api and now i get https://youtube.com/devicesupport.
My current request is:
https://gdata.youtube.com/feeds/api/users/{username}/uploads?alt=jsonc&max-results=15&v=2
There is no authentication required to make that call
Question:
Any idea how to achieve the same with new Google V3 API? I check documentation but didn't found answer for that.
I had the same problem with V3 api. I think you can't access videos informations without authentication anymore, but you don't need to use an OAuth to get a snippet from some video or search. I was searching a simple solution for my app, because I just want to request title, thumb and descriptions.
The new url will be:
https://www.googleapis.com/youtube/v3/videosid={VIDEO_ID}&part=snippet&key={YOU_API_KEY}
You need to access google developers console, enable youtube api and your public access key - on credentials (API KEY), so they can relate your app to all requests.
And I found this example in PHP if you need to parse JSON result:
http://www.leenooks.com/php/parsing-youtube-v3-json-with-php-examples.html
I'm still don't know all the limitations of V3, I was using V2 too, but maybe for uploads, or more control for youtube accounts you'll have to use OAuth.
I hope this will help you.

Youtube Related Videos using Youtube V3 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}

Resources