Tolen
Tolen

Reputation: 111

Get videos using play-list

I want to write a code that retrieves all the videos related to a specific play list. what the query should I use? for example : I have used the

"https://gdata.youtube.com/feeds/api/videos?author="+username+"&v=2&alt=jsonc&max-results=3" query to get all the videos related by the user.

The "username" field takes the value from edit text.

Upvotes: 0

Views: 264

Answers (1)

mertaydin
mertaydin

Reputation: 2244

You can search this link : http://code.google.com/apis/youtube/2.0/developers_guide_protocol_api_query_parameters.html#authorsp

And you can use query like you wrote : http://gdata.youtube.com/feeds/api/videos?author="+username+"&v=2&alt=json

For spesicif playlist first of all, research this link which is about getting playlist. https://developers.google.com/youtube/2.0/developers_guide_protocol_playlists

You can get playlist in xml format : https://gdata.youtube.com/feeds/api/users/thenewboston/playlists?v=2

if you want it in json append &alt=json to query. This link will give you playlists.

And use URL like this getting playlist's items :https://gdata.youtube.com/feeds/api/playlists/8BCDD04DE8F771B2?v=2

For getting playlist item's in Json data, you must get the this node :

    "content": {

        "type": "application/atom+xml;type=feed",
        "src": "https://gdata.youtube.com/feeds/api/playlists/PL6gx4Cwl9DGCS7sMM-19z9_ud7F2SINJq?v=2
},

this node is from thenewboston's playlist data. You can find more information about Youtube API and playlist check this link : https://developers.google.com/youtube/2.0/developers_guide_protocol_playlists and Retrieving a single playlist title.

Upvotes: 3

Related Questions