1

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.

Daniel
  • 2,345
  • 4
  • 19
  • 36
  • 1
    https://developers.google.com/youtube/v3/docs/playlistItems/list – mpgn Jun 13 '15 at 10:32
  • GET https://www.googleapis.com/youtube/v3/videos?key=API_KEY&part=snippet&playlistId=28BC8AB186E6F925 returns 400 Bad Request with "message": "No filter selected." @mpgn – tech alshop Jun 13 '15 at 11:50
  • If you want to get the videos in a specific playlist then you need to use the playlistItems:list call rather than videos:list. @mpgn gave the documentation link above. Something like: GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=50&playlistId=28BC8AB186E6F925&key={YOUR_API_KEY} – theduck Jun 13 '15 at 13:28
  • 1
    If you want a list of playlists then you can use playlists:list GET https://www.googleapis.com/youtube/v3/playlists?part=snippet&mine=true&key={YOUR_API_KEY} for example will get a list of all your playlists. You can try this out here:https://developers.google.com/youtube/v3/docs/playlists/list#try-it and switch oAuth on to authenticate. – theduck Jun 13 '15 at 13:34
  • What is your question, exactly? Are you looking for something other than links to the docs for the v3 API calls? – Daniel Aug 03 '15 at 22:24

2 Answers2

0

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/

Daniel
  • 2,345
  • 4
  • 19
  • 36
Alex
  • 2,795
  • 3
  • 21
  • 21
0

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}