{"id":279,"date":"2010-05-20T21:42:00","date_gmt":"2010-05-20T21:42:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/getting-started-with-youtube-java-api.html"},"modified":"2012-10-21T19:13:04","modified_gmt":"2012-10-21T19:13:04","slug":"getting-started-with-youtube-java-api","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html","title":{"rendered":"Getting Started with YouTube Java API"},"content":{"rendered":"<p>In this tutorial I am taking a look at Google&#8217;s <a href=\"http:\/\/code.google.com\/apis\/youtube\/overview.html\">YouTube API<\/a> which allows you to empower your application with YouTube&#8217;s features. YouTube is one of the \u201ckiller\u201d Internet applications and its traffic comprises of a huge portion of the total internet traffic.<\/p>\n<p>Before we get started, make sure you have read the <a href=\"http:\/\/code.google.com\/apis\/youtube\/getting_started.html\">API Overview Guide<\/a>. We will mainly deal with the <a href=\"http:\/\/code.google.com\/apis\/youtube\/getting_started.html#data_api\">Data API<\/a>, which allows you to perform many of the operations available on the YouTube website (search for videos, retrieve standard feeds, see related content etc.).<\/p>\n<p>The API is available in multiple programming languages and we will be using Java for this tutorial. Read the <a href=\"http:\/\/code.google.com\/apis\/youtube\/2.0\/developers_guide_java.html\">Java Developer&#8217;s Guide<\/a> to get a first idea. Also bookmark the <a href=\"http:\/\/code.google.com\/apis\/gdata\/javadoc\/\">Google Data API JavaDoc<\/a> page.<\/p>\n<p>Let&#8217;s prepare the development environment. First, download the <a href=\"http:\/\/code.google.com\/p\/gdata-java-client\/\">GData Java Client<\/a> from the corresponding <a href=\"http:\/\/code.google.com\/p\/gdata-java-client\/downloads\/list\">download section<\/a>. I will be using the <a href=\"http:\/\/gdata-java-client.googlecode.com\/files\/gdata-src.java-1.41.2.zip\">1.41.2 version<\/a> for this tutorial. Note that there is also a version 2, but according to the site is experimental and not compatible with version 1. <\/p>\n<p>Extract the zipped file, locate the folder \u201cgdata\\java\\lib\u201d and include the following JARs into your application&#8217;s classpath:<\/p>\n<ul>\n<li>data-client-1.0.jar<\/li>\n<li>gdata-youtube-2.0.jar<\/li>\n<li>gdata-core-1.0.jar<\/li>\n<li>gdata-media-1.0.jar<\/li>\n<\/ul>\n<p>Next, we have to take care of the dependencies. The list of dependency packages can be found <a href=\"http:\/\/code.google.com\/p\/gdata-java-client\/wiki\/Dependencies\">here<\/a>.<\/p>\n<ul>\n<li>The <a href=\"http:\/\/java.sun.com\/products\/javamail\/\">JavaMail API<\/a> is included for media support. It can be downloaded <a href=\"http:\/\/java.sun.com\/products\/javamail\/downloads\/index.html\">here<\/a>. The \u201cmail.jar\u201d is needed. <\/li>\n<li>The <a href=\"http:\/\/code.google.com\/p\/google-collections\/\">Google Collections Library<\/a> is also internally used by the GData client. I downloaded the <a href=\"http:\/\/google-collections.googlecode.com\/files\/google-collect-1.0.zip\">1.0-final version<\/a>. The \u201cgoogle-collect-1.0.jar\u201d is needed.<\/li>\n<\/ul>\n<p>Make sure all the aforementioned JAR files are included in the project&#8217;s classpath.<\/p>\n<p><a href=\"http:\/\/4.bp.blogspot.com\/_piNjpdpJZXA\/S_ViET2nU6I\/AAAAAAAAAAM\/kSwUQqPyp5Y\/s1600\/01-build-path.png\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/4.bp.blogspot.com\/_piNjpdpJZXA\/S_ViET2nU6I\/AAAAAAAAAAM\/kSwUQqPyp5Y\/s320\/01-build-path.png\" style=\"cursor: pointer;height: 239px;margin: 0px auto 10px;text-align: center;width: 320px\" \/><\/a><\/p>\n<p>Note that all public feeds are read-only and do not require any authentication. Authenticated operations, on the other hand, are those that include the retrieval of private feeds, such as a user&#8217;s inbox feed, as well as write, upload, update and delete operations. You will need to <a href=\"http:\/\/code.google.com\/apis\/youtube\/dashboard\/\">sign up for a developer key<\/a> to be able to execute authenticated operations. No key is required for this tutorial though.<\/p>\n<p>Now that the infrastructure is ready, let&#8217;s talk a bit about the API. The main class that we will be using is the <a href=\"http:\/\/code.google.com\/apis\/gdata\/javadoc\/com\/google\/gdata\/client\/youtube\/YouTubeService.html\">YouTubeService<\/a> class. This allows you to perform search queries similar to the ones that you can perform while browsing YouTube&#8217;s web page. Each query is represented by a <a href=\"http:\/\/code.google.com\/apis\/gdata\/javadoc\/com\/google\/gdata\/client\/youtube\/YouTubeQuery.html\">YouTubeQuery<\/a> instance. The results of each query (if any), come in the form of a <a href=\"http:\/\/code.google.com\/apis\/gdata\/javadoc\/com\/google\/gdata\/data\/youtube\/VideoFeed.html\">VideoFeed<\/a> object.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>From each feed, a number of <a href=\"http:\/\/code.google.com\/apis\/gdata\/javadoc\/com\/google\/gdata\/data\/youtube\/VideoEntry.html\">VideoEntry<\/a> objects can be retrieved. From a VideoEntry, we extract a <a href=\"http:\/\/code.google.com\/apis\/gdata\/javadoc\/com\/google\/gdata\/data\/youtube\/YouTubeMediaGroup.html\">YoutTubeMediaGroup<\/a> object. You can imagine this class as a placeholder for media information (check the <a href=\"http:\/\/video.search.yahoo.com\/mrss\">&#8220;Media RSS&#8221; Specification<\/a>). We then retrieve the corresponding <a href=\"http:\/\/code.google.com\/apis\/gdata\/javadoc\/com\/google\/gdata\/data\/media\/mediarss\/MediaPlayer.html\">MediaPlayer<\/a> and finally the player URL. We can also get information about the accompanying thumbnails, via the <a href=\"http:\/\/code.google.com\/apis\/gdata\/javadoc\/com\/google\/gdata\/data\/media\/mediarss\/MediaThumbnail.html\">MediaThumbnail<\/a> class.<\/p>\n<p>Let&#8217;s get started with the code. First we create two model classes which will be used to hold information about the feeds and the videos. The first one is called YouTubeMedia and contains the media content URL and the media content type. The second one is named YouTubeVideo and contains all the information regarding a specific video (URL, embedded player URL, thumbnails and instances of YoutTubeMedia). The source code for these is following:<\/p>\n<pre class=\"brush: java\">package com.javacodegeeks.youtube.model;\r\n\r\npublic class YouTubeMedia {\r\n \r\n     private String location;\r\n     private String type;\r\n \r\n     public YouTubeMedia(String location, String type) {\r\n          super();\r\n          this.location = location;\r\n          this.type = type;\r\n     }\r\n \r\n     public String getLocation() {\r\n          return location;\r\n     }\r\n     public void setLocation(String location) {\r\n          this.location = location;\r\n     }\r\n \r\n     public String getType() {\r\n          return type;\r\n     }\r\n     public void setType(String type) {\r\n          this.type = type;\r\n     } \r\n \r\n}\r\n<\/pre>\n<pre class=\"brush: java\">package com.javacodegeeks.youtube.model;\r\n\r\nimport java.util.List;\r\n\r\npublic class YouTubeVideo {\r\n \r\n     private List&lt;String&gt; thumbnails;\r\n     private List&lt;YouTubeMedia&gt; medias;\r\n     private String webPlayerUrl;\r\n     private String embeddedWebPlayerUrl;\r\n \r\n     public List&lt;String&gt; getThumbnails() {\r\n          return thumbnails;\r\n     }\r\n     public void setThumbnails(List&lt;String&gt; thumbnails) {\r\n          this.thumbnails = thumbnails;\r\n     }\r\n\r\n     public List&lt;YouTubeMedia&gt; getMedias() {\r\n          return medias;\r\n     }\r\n     public void setMedias(List&lt;YouTubeMedia&gt; medias) {\r\n         this.medias = medias;\r\n     }\r\n \r\n     public String getWebPlayerUrl() {\r\n          return webPlayerUrl;\r\n     }\r\n     public void setWebPlayerUrl(String webPlayerUrl) {\r\n            this.webPlayerUrl = webPlayerUrl;\r\n     }\r\n\r\n     public String getEmbeddedWebPlayerUrl() {\r\n          return embeddedWebPlayerUrl;\r\n     }\r\n     public void setEmbeddedWebPlayerUrl(String embeddedWebPlayerUrl) {\r\n          this.embeddedWebPlayerUrl = embeddedWebPlayerUrl;\r\n     }\r\n \r\n     public String retrieveHttpLocation() {\r\n          if (medias==null || medias.isEmpty()) {\r\n               return null;\r\n          }\r\n          for (YouTubeMedia media : medias) {\r\n               String location = media.getLocation();\r\n               if (location.startsWith(\"http\")) {\r\n                    return location;\r\n               }\r\n          }\r\n          return null;\r\n      }\r\n\r\n}\r\n<\/pre>\n<p>Finally, the YouTubeManager class is presented. It can be used to perform search queries and returns instances of the YouTubeVideo model class with all the relevant information. It also creates the appropriate <a href=\"http:\/\/code.google.com\/apis\/youtube\/player_parameters.html\">embedded web player URL<\/a>. Here is the code for that class:<\/p>\n<pre class=\"brush: java\">package com.javacodegeeks.youtube;\r\n\r\nimport java.net.URL;\r\nimport java.util.LinkedList;\r\nimport java.util.List;\r\n\r\nimport com.google.gdata.client.youtube.YouTubeQuery;\r\nimport com.google.gdata.client.youtube.YouTubeService;\r\nimport com.google.gdata.data.media.mediarss.MediaThumbnail;\r\nimport com.google.gdata.data.youtube.VideoEntry;\r\nimport com.google.gdata.data.youtube.VideoFeed;\r\nimport com.google.gdata.data.youtube.YouTubeMediaContent;\r\nimport com.google.gdata.data.youtube.YouTubeMediaGroup;\r\nimport com.javacodegeeks.youtube.model.YouTubeMedia;\r\nimport com.javacodegeeks.youtube.model.YouTubeVideo;\r\n\r\npublic class YouTubeManager {\r\n \r\n    private static final String YOUTUBE_URL = \"http:\/\/gdata.youtube.com\/feeds\/api\/videos\";\r\n    private static final String YOUTUBE_EMBEDDED_URL = \"http:\/\/www.youtube.com\/v\/\";\r\n \r\n    private String clientID;\r\n \r\n    public YouTubeManager(String clientID) {\r\n        this.clientID = clientID;\r\n    }\r\n \r\n     public List&lt;YouTubeVideo&gt; retrieveVideos(String textQuery, int maxResults, boolean filter, int timeout) throws Exception {\r\n  \r\n        YouTubeService service = new YouTubeService(clientID);\r\n        service.setConnectTimeout(timeout); \/\/ millis\r\n        YouTubeQuery query = new YouTubeQuery(new URL(YOUTUBE_URL));\r\n  \r\n        query.setOrderBy(YouTubeQuery.OrderBy.VIEW_COUNT);\r\n        query.setFullTextQuery(textQuery);\r\n        query.setSafeSearch(YouTubeQuery.SafeSearch.NONE);\r\n        query.setMaxResults(maxResults);\r\n\r\n        VideoFeed videoFeed = service.query(query, VideoFeed.class);  \r\n        List&lt;VideoEntry&gt; videos = videoFeed.getEntries();\r\n  \r\n        return convertVideos(videos);\r\n  \r\n    }\r\n \r\n    private List&lt;YouTubeVideo&gt; convertVideos(List&lt;VideoEntry&gt; videos) {\r\n  \r\n        List&lt;YouTubeVideo&gt; youtubeVideosList = new LinkedList&lt;YouTubeVideo&gt;();\r\n  \r\n        for (VideoEntry videoEntry : videos) {\r\n   \r\n            YouTubeVideo ytv = new YouTubeVideo();\r\n   \r\n            YouTubeMediaGroup mediaGroup = videoEntry.getMediaGroup();\r\n            String webPlayerUrl = mediaGroup.getPlayer().getUrl();\r\n            ytv.setWebPlayerUrl(webPlayerUrl);\r\n   \r\n            String query = \"?v=\";\r\n            int index = webPlayerUrl.indexOf(query);\r\n\r\n            String embeddedWebPlayerUrl = webPlayerUrl.substring(index+query.length());\r\n            embeddedWebPlayerUrl = YOUTUBE_EMBEDDED_URL + embeddedWebPlayerUrl;\r\n            ytv.setEmbeddedWebPlayerUrl(embeddedWebPlayerUrl);\r\n   \r\n            List&lt;String&gt; thumbnails = new LinkedList&lt;String&gt;();\r\n            for (MediaThumbnail mediaThumbnail : mediaGroup.getThumbnails()) {\r\n                thumbnails.add(mediaThumbnail.getUrl());\r\n            }   \r\n            ytv.setThumbnails(thumbnails);\r\n   \r\n            List&lt;YouTubeMedia&gt; medias = new LinkedList&lt;YouTubeMedia&gt;();\r\n            for (YouTubeMediaContent mediaContent : mediaGroup.getYouTubeContents()) {\r\n                medias.add(new YouTubeMedia(mediaContent.getUrl(), mediaContent.getType()));\r\n            }\r\n            ytv.setMedias(medias);\r\n   \r\n            youtubeVideosList.add(ytv);\r\n   \r\n        }\r\n  \r\n        return youtubeVideosList;\r\n  \r\n    }\r\n \r\n}\r\n<\/pre>\n<p>In order to test our class, as well provide a show case example, we create the following simple test class:<\/p>\n<pre class=\"brush: java\">package com.javacodegeeks.youtube.test;\r\n\r\nimport java.util.List;\r\n\r\nimport com.javacodegeeks.youtube.YouTubeManager;\r\nimport com.javacodegeeks.youtube.model.YouTubeVideo;\r\n\r\npublic class YouTubeTester {\r\n \r\n    public static void main(String[] args) throws Exception {\r\n  \r\n        String clientID = \"JavaCodeGeeks\";\r\n        String textQuery = \"java code\";\r\n        int maxResults = 10;\r\n        boolean filter = true;\r\n        int timeout = 2000;\r\n  \r\n        YouTubeManager ym = new YouTubeManager(clientID);\r\n  \r\n        List&lt;YouTubeVideo&gt; videos = ym.retrieveVideos(textQuery, maxResults, filter, timeout);\r\n  \r\n        for (YouTubeVideo youtubeVideo : videos) {\r\n            System.out.println(youtubeVideo.getWebPlayerUrl());\r\n            System.out.println(\"Thumbnails\");\r\n            for (String thumbnail : youtubeVideo.getThumbnails()) {\r\n                System.out.println(\"\\t\" + thumbnail);\r\n            }\r\n            System.out.println(youtubeVideo.getEmbeddedWebPlayerUrl());\r\n            System.out.println(\"************************************\");\r\n        }\r\n  \r\n    }\r\n\r\n}\r\n<\/pre>\n<p>The Eclipse project for this tutorial, including the dependency libraries, can be downloaded <a href=\"http:\/\/dl.dropbox.com\/u\/7215751\/JavaCodeGeeks\/YoutubeApiTutorial\/YouTubeApiProject.zip\">here<\/a>. <\/p>\n<p>Enjoy!<\/p>\n<div style=\"margin: 0px\"><strong><i>Related Articles :<\/i><\/strong><\/div>\n<ul>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/05\/gwt-2-spring-3-jpa-2-hibernate-35.html\">GWT 2 Spring 3 JPA 2 Hibernate 3.5 Tutorial<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/06\/getting-started-smartgwt-gwt-interfaces.html\">Getting Started with SmartGWT for awesome GWT interfaces<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/11\/jaxws-with-spring-and-maven-tutorial.html\">JAX\u2013WS with Spring and Maven Tutorial<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/07\/java-mail-spring-gmail-smtp.html\">Sending e-mails in Java with Spring \u2013 GMail SMTP server example<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/p\/java-tutorials.html\">Java Tutorials and Android Tutorials list<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial I am taking a look at Google&#8217;s YouTube API which allows you to empower your application with YouTube&#8217;s features. YouTube is one of the \u201ckiller\u201d Internet applications and its traffic comprises of a huge portion of the total internet traffic. Before we get started, make sure you have read the API Overview &hellip;<\/p>\n","protected":false},"author":3,"featured_media":260,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[49],"class_list":["post-279","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-desktop-java","tag-youtube-api"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Getting Started with YouTube Java API - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In this tutorial I am taking a look at Google&#039;s YouTube API which allows you to empower your application with YouTube&#039;s features. YouTube is one of the\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting Started with YouTube Java API - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In this tutorial I am taking a look at Google&#039;s YouTube API which allows you to empower your application with YouTube&#039;s features. YouTube is one of the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2010-05-20T21:42:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-21T19:13:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-duke-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ilias Tsagklis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ilias Tsagklis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/05\\\/getting-started-with-youtube-java-api.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/05\\\/getting-started-with-youtube-java-api.html\"},\"author\":{\"name\":\"Ilias Tsagklis\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/9a83496b285d30c61e8a674625c1350e\"},\"headline\":\"Getting Started with YouTube Java API\",\"datePublished\":\"2010-05-20T21:42:00+00:00\",\"dateModified\":\"2012-10-21T19:13:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/05\\\/getting-started-with-youtube-java-api.html\"},\"wordCount\":665,\"commentCount\":13,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/05\\\/getting-started-with-youtube-java-api.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-duke-logo.jpg\",\"keywords\":[\"YouTube API\"],\"articleSection\":[\"Desktop Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/05\\\/getting-started-with-youtube-java-api.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/05\\\/getting-started-with-youtube-java-api.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/05\\\/getting-started-with-youtube-java-api.html\",\"name\":\"Getting Started with YouTube Java API - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/05\\\/getting-started-with-youtube-java-api.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/05\\\/getting-started-with-youtube-java-api.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-duke-logo.jpg\",\"datePublished\":\"2010-05-20T21:42:00+00:00\",\"dateModified\":\"2012-10-21T19:13:04+00:00\",\"description\":\"In this tutorial I am taking a look at Google's YouTube API which allows you to empower your application with YouTube's features. YouTube is one of the\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/05\\\/getting-started-with-youtube-java-api.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/05\\\/getting-started-with-youtube-java-api.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/05\\\/getting-started-with-youtube-java-api.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-duke-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-duke-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/05\\\/getting-started-with-youtube-java-api.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Desktop Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/desktop-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Getting Started with YouTube Java API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/9a83496b285d30c61e8a674625c1350e\",\"name\":\"Ilias Tsagklis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g\",\"caption\":\"Ilias Tsagklis\"},\"description\":\"Ilias is a software developer turned online entrepreneur. He is co-founder and Executive Editor at Java Code Geeks.\",\"sameAs\":[\"http:\\\/\\\/www.iliastsagklis.com\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/iliastsagklis\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/ilias-tsagklis\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Getting Started with YouTube Java API - Java Code Geeks","description":"In this tutorial I am taking a look at Google's YouTube API which allows you to empower your application with YouTube's features. YouTube is one of the","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html","og_locale":"en_US","og_type":"article","og_title":"Getting Started with YouTube Java API - Java Code Geeks","og_description":"In this tutorial I am taking a look at Google's YouTube API which allows you to empower your application with YouTube's features. YouTube is one of the","og_url":"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2010-05-20T21:42:00+00:00","article_modified_time":"2012-10-21T19:13:04+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-duke-logo.jpg","type":"image\/jpeg"}],"author":"Ilias Tsagklis","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Ilias Tsagklis","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html"},"author":{"name":"Ilias Tsagklis","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/9a83496b285d30c61e8a674625c1350e"},"headline":"Getting Started with YouTube Java API","datePublished":"2010-05-20T21:42:00+00:00","dateModified":"2012-10-21T19:13:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html"},"wordCount":665,"commentCount":13,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-duke-logo.jpg","keywords":["YouTube API"],"articleSection":["Desktop Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html","url":"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html","name":"Getting Started with YouTube Java API - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-duke-logo.jpg","datePublished":"2010-05-20T21:42:00+00:00","dateModified":"2012-10-21T19:13:04+00:00","description":"In this tutorial I am taking a look at Google's YouTube API which allows you to empower your application with YouTube's features. YouTube is one of the","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-duke-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-duke-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2010\/05\/getting-started-with-youtube-java-api.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Desktop Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/desktop-java"},{"@type":"ListItem","position":4,"name":"Getting Started with YouTube Java API"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/9a83496b285d30c61e8a674625c1350e","name":"Ilias Tsagklis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g","caption":"Ilias Tsagklis"},"description":"Ilias is a software developer turned online entrepreneur. He is co-founder and Executive Editor at Java Code Geeks.","sameAs":["http:\/\/www.iliastsagklis.com\/","https:\/\/www.linkedin.com\/in\/iliastsagklis"],"url":"https:\/\/www.javacodegeeks.com\/author\/ilias-tsagklis"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=279"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/279\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/260"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}