We have a website which displays our YouTube video channels and favourite videos in our channel, etc. We were using Youtube Data API v2.0 to fetch data.
for example:
https://gdata.youtube.com/feeds/api/users/" + userid + "/playlists?v=2&alt=json-in-script&orderby=" + orderFeedsBy + "&callback=?
But now these links return "NetworkError: 410 Gone". We checked the new YouTube Javascript API, but we didn't understand how to migrate to the new API. Please help us to fix this.
This URL will return JSON with video ids for a playlist:
https://www.googleapis.com/youtube/v3/playlistItems?part=id&playlistId={PLAYLIST_ID}&key={YOUR_API_KEY}
You will need an API Key from console.developers.google.com and the playlist ID.
You can get a list of playlist IDs for a channel with a URL like this:
https://www.googleapis.com/youtube/v3/playlists?part=id&channelId={CHANNEL_ID}&key={YOUR_API_KEY}
Documentation at developers.google.com/youtube/v3/docs/
Youtube stopped support to V2, so to get data from V3 use the below URL
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=50&playlistId={PLAYLIST_ID}&key={KEY}
Related
I've been trying to get tags for youtube videos using playlists/playlistItems api.
I've seen other questions about this and saw there's a possibility to do it with more than one call (make a call to get the videos, which has the tags).
For example: How to retrieve a YouTube video's tags with YouTube v3 API?, YouTube API - get tags for all videos with playlist query
BUT I see in their api documentation that the snippet in playlists api is supposed to include tags:
But it doesn't!
The url I'm using: https://www.googleapis.com/youtube/v3/playlists?part=snippet&channelIdz=&key=
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.
I have a playlist from youtube .
I was using this form :
http://gdata.youtube.com/feeds/api/playlists/PLqDQIb5EqNmJEzzDF3L3Sxize_ailX-Lp
but i know that Youtube migrated it API v2 into v3. How can i get the playlist ? I read documentation , but i didn't understand. Could someone to give a concretely example,please ?
you can user this API to get youtube PlayList. try this API :
https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=50&q=SEARCH VIDEO NAME &type=playlist&key=YOUTUBE KEY &pageToken=%#
Im trying to retrieve the oldest video of a playlist using the youtube v3 API. Based on the fact that there's no YT-API-Param to sort the playlist result and the max-value of the max-results param is 50, i'm searching for other solutions.Since the YouTube Data API v3 results are paginated (https://developers.google.com/youtube/v3/docs/playlists/list), i'm looking for a way to a get a "lastPageToken" or some such. Any ideas? Many thanks!
How can I form requests using the youtube api to get the videos from a channel as an rss feed?
I read this question, where a link to the new api (V3) is given, but I couldn't find it there. I tried with the deprecated syntax from api v2:
https://gdata.youtube.com/feeds/users/UCqAEtEr0A0Eo2IVcuWBfB9g/uploads
but it only works sometimes.
I also tried:
https://www.googleapis.com/youtube/v3/search?key={your_key_here}&channelId={channel_id_here}&part=snippet,id&order=date&maxResults=20
where I enter the channel id and the search key, but I get a 'bad request' error.
To answer the question in the headline:
Pre-append https://www.youtube.com/feeds/videos.xml?channel_id= to the channel unique identifier.
For example, lets assume that the channel url is https://www.youtube.com/channel/feed/UCpjNXONNE-JUz74ACsRCgcw. So the rss feed URL would be https://www.youtube.com/feeds/videos.xml?channel_id=UCpjNXONNE-JUz74ACsRCgcw.