1) The YouTube API allows developers to programmatically access YouTube video data and services to build applications that search, retrieve, and interact with YouTube content.
2) The API uses REST principles and returns data in XML formats. It supports searching for videos, channels, playlists and other metadata as well as commenting, rating, and uploading videos.
3) Authentication is required to interact with user-specific data and is done through an API key and OAuth or ClientLogin methods depending on the level of access needed.
2. Google's mission …is to organize the world's information and make it universally accessible and useful. Sometimes making information accessible requires making it available in contexts other than a web browser.
31. Response Codes Same response codes for HTTP 200, 201, 301, 400, 500 etc.. Codes have similar meaning for each type of call 200 (OK) 400 (Bad Request) 401 (Not Authorized) 404 (Not Found) 500 (Internal Error) Accompanied with error details (XML in payload)
33. YouTubeData API Search for Videos Keywords (tags) Categories Query Params (metadata) Search for Playlists Keywords (tags) Categories Search for Channels Keywords (tags) Categories
34. YouTube Data API Retrieve Videos Comments Captions Related Videos Video Responses Categories Keywords Playlists Subscriptions Profiles Contacts Messages Activity Feeds Insight Data Feed Favorites
35. YouTube Data API (cont.) Create Videos Comments Captions Related Videos Video Responses Complaint Rating Contact Message Favorite Playlist Subscription
36. YouTube Data API (cont.) Update Video Metadata Captions Profiles Playlists Contacts Delete Video Message Favorite Playlist Subscription Contact
37. YouTube Data API Batch Processing Process multiple types of calls in a single request Each Request in its own <entry> tag
38. Sample Interaction Query API for videos tagged with “SHU” Display Videos in List Allow user to Select Video to Display Display Single Video Retrieve Comments for that Video Post Comment Login Add to Playlist
48. Categories http://gdata.youtube.com/schemas/2007/categories.cat <app:categories [namespaces]> <atom:category term="Film" label="Film & Animation" xml:lang="en-US"> <yt:assignable/> <yt:browsable regions="AU BR CA CZ DE ES FR GB HK IE IL IN IT JP KR MX NL NZ PL PT RU SE TW US"/> </atom:category> </app>
49. Video by Keyword/Tag http://gdata.youtube.com/feeds/api/videos/ Append /-/keyword/ to video feed URL Use query string ?category=keyword Not (-) Or (|) /-/Kennedy/-Bobby/-Ted/-Patrick /-/Kennedy/Bobby|Ted|Patrick
50. Video by Category http://gdata.youtube.com/feeds/api/videos/ Append /-/Category/ to video feed URL Use query string ?category=Category Multiple Categories /-/Comedy/Music/Shortmov/ ?category=Comedy,Music,Shortmov Category ARE case sensitive
51. Channels http://gdata.youtube.com/feeds/api/channels?v=2 Search just like videos using “?q=keywords/tags” <feed [namespaces> … metadata … <openSearch:totalResults /> <openSearch:startIndex /> <openSearch: itemsPerPage /> <entry> <title /> <summary /> <gd:feedlinkurl=“…” hitcount=“…”> </entry> </feed>
55. ClientLogin https://www.google.com/youtube/accounts/ClientLogin Pass in: Email Passwd Receive: Auth=AIwbFARksypDdUSGGYRI_5v7Z9TaijoPQqpIfCEjTFPAikn_---OC-I1VJtQ YouTubeUser=testuser Send into all requests: Header: Authorization = “GoogleLogin auth= AIwbFARksypDdUSGGYRI_5v7Z9TaijoPQqpIfCEjTFPAikn_---OC-I1VJtQ”
56. Comments Get Video Feed Look for: <gd:comments> <gd:feedlinkhref=“…” countHint=“…” /> </gd:comments> Pass in
57. Ratings Link embeded in the video feed <link rel='http://gdata.youtube.com/schemas/2007#video.ratings' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/VIDEO_ID/ratings'/> Send back to this URL: <entry [namespaces]> <gd:rating value="4" min="1" max="5"/> </entry>
58. Updating Link embeded in the video feed <link rel='edit' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/andyland74/uploads/914IMX9RSTE'> Send Back to this URL: <entry [namespaces]> <media:group> <media:title type=“…“ /> <media:description type=“…“ /> <media:category scheme=“…“ /> <media:keywords /> </media:group> </entry>
59. Uploading http://uploads.gdata.youtube.com/feeds/api/users Include in Header Authentication Slug (filename) Include in Body Video File <entry [namespace]> <media:group> <media:title type=”...” /> <media:description type=“…“ /> <media:keywords /> <media:categoryscheme=“…“ /> </media:group> </entry>
61. Developer Resources Google Group http://groups.google.com/group/youtube-api-gdata Google Code Help http://code.google.com/support/bin/topic.py?topic=12357
62. Contact Ron West @notronwest facebook.com/notronwest www.notronwest.com/blog