开发者

Lost in the YouTube API

I've been working with a couple of API's before like Vimeo, Dribbble and Twitter. Now I am trying out YouTube's API. But the complexity of the API gets me lost.

I've been going through parts of it and reading up on a couple of tutorials but can't seem to find what I want.

They say something about zend_gdata but I don't understand what that has to do with YouTube's API and can't seem to get it work either.

This is what I want to accomplish:

Get video data for each video from [playlist] by [user]:

  • Video poster (big thumbnail)
  • Title
  • Description
  • Embed code (iframe probably)

I am using PHP and prefer an output in JSON.

Can you guys point me out where to start (tutorial, which API, ...) to accomplish this rather simple task?

EDIT

Example for Vimeo: http://vimeo.com/api/v2/channel/52750/videos.json

Which URL can I CURL for YouTube to get al vi开发者_Go百科deos in a specified playlist?


From Data API Protocol site:

As noted in the previous section, each entry in a user's playlists feed contains a tag that specifies the URL for retrieving the list of videos in the playlist. The following example shows the URL for retrieving a playlist as that URL appears in a playlists feed entry:

<content type='application/atom+xml' src='http://gdata.youtube.com/feeds/api/playlists/8BCDD04DE8F771B2?v=2'/>

So the url is something like this: http://gdata.youtube.com/feeds/api/playlists/PLAYLISTID?v=2

Update

For JSON format, add &alt=json GET parameter at the end of the url:

http://gdata.youtube.com/feeds/api/playlists/PLAYLISTID?v=2&alt=json

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜